Chris Brand | 1 Jun 2008 01:07
Picon

NET::SFTP downloading multiple directories.

Hi guys,

Im pretty new to ruby, and I want to re-write a bash script I wrote to
backup some data on an iphone to a local comp, in ruby.

This is the bash version: http://pastebin.com/m1a34a96

Here is what i have in ruby so far: http://pastebin.com/m1c2282c0

What I basically want to do is have an array of remote directories
downloaded via stfp to a local folder in a loop, or something to this
effect, and I cant seem to figure it out...

Any help is greatly appreciated!!

-Chris
--

-- 
Posted via http://www.ruby-forum.com/.

Wesley Silva | 1 Jun 2008 01:25
Picon
Gravatar

Re: Class Module

Thanks a lot David!

I would like to make another question please...:)

If i just change Modules's name for Father for example:

class Father
   <at>  <at> docs = {}
  def doc(str)
     <at>  <at> docs[self.name] = self.name + ":\n" + str.gsub(/^\s+/, '')
  end
  def Father::show_doc(aClass)
    aClass = aClass.name if aClass.class <= Module
     <at>  <at> docs[aClass] || "No documentation for #{aClass}"
  end
end
class Example<Father
  doc("This is a sample documentation string")
end

puts Father::show_doc(Example)

Produces:

undefined method `doc' for Example:Class (NoMethodError)

Can you tell why? :)

--

-- 
Posted via http://www.ruby-forum.com/.
(Continue reading)

ara.t.howard | 1 Jun 2008 01:26
Picon
Gravatar

Re: getting standard error and output from ruby script in real time


On May 31, 2008, at 10:16 AM, Stefano Crocco wrote:

>
> I don't think that would work. If I understand correctly what you  
> mean, that
> should be put in the script which produces the output, not not in  
> the one
> displaying it. But since the output I want to display is from a  
> script written
> by the user, I can't do that.

what you want to do is easily accomplished using session.rb

http://codeforpeople.com/lib/ruby/session/session-2.4.0/README

gem install session

note that i wrote to do *exactly* what you are doing - but it was for  
a tk gui.  anyhow, you *must* do this in a background thread as there  
are certain things child programs can do (like setvbuf) which can  
defeat any counter buffering techniques you may try - so you must  
always process the stdout/stderr asynchronously in a background thread  
which updates the gui.  session makes this trivial to accomplish.

kind regards.

a  <at>  http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
(Continue reading)

David A. Black | 1 Jun 2008 02:16

Re: Class Module

Hi --

On Sun, 1 Jun 2008, Wesley Silva wrote:

> Thanks a lot David!
>
> I would like to make another question please...:)
>
> If i just change Modules's name for Father for example:
>
> class Father
>   <at>  <at> docs = {}
>  def doc(str)
>     <at>  <at> docs[self.name] = self.name + ":\n" + str.gsub(/^\s+/, '')
>  end
>  def Father::show_doc(aClass)
>    aClass = aClass.name if aClass.class <= Module
>     <at>  <at> docs[aClass] || "No documentation for #{aClass}"
>  end
> end
> class Example<Father
>  doc("This is a sample documentation string")
> end
>
> puts Father::show_doc(Example)
>
> Produces:
>
> undefined method `doc' for Example:Class (NoMethodError)
>
(Continue reading)

Tom Copeland | 1 Jun 2008 02:20
Gravatar

Re: Gems not working


On Fri, 2008-05-30 at 03:55 +0900, Jim Hoskins wrote:
> I am currently not able to install any gems. I was using Gem 1.1.1 but
> kept receiving the following errors:
> 
> ERROR:  While executing gem ... (Gem::RemoteSourceException)
>     Error fetching remote gem cache: Errno::EPIPE: Broken pipe reading
> http://gems.rubyonrails.org/yaml

Hm, that "yaml" file is 20 MB now... is your client timing out, or maybe
refusing to fetch that much data?

Yours,

Tom

Charles Oliver Nutter | 1 Jun 2008 03:14
Picon
Gravatar

Re: Huge performance gap

Roger Pack wrote:
> Maybe something is possible along the lines of
> 
> vm_optimized :no_frame_pointer, :fast_math, :no_thread_checkpointing do
>       # some code that should run very fast
> end
> 
> :)
> Thanks for your work :)
> -R

Yeah, I'm looking into those possibilities, trying to find a 
nonintrusive way to introduce compiler pragmas that we could use for 
implementing parts of JRuby in Ruby code (or that others could use). For 
example, something like this (a bogus name...I don't want to reveal any 
pragmas yet):

def foo
   ____NO_FRAMING = true
end

- Charlie

Roger Pack | 1 Jun 2008 03:20
Picon
Gravatar

Re: Huge performance gap


> Yeah, I'm looking into those possibilities, trying to find a
> nonintrusive way to introduce compiler pragmas that we could use for
> implementing parts of JRuby in Ruby code (or that others could use). For
> example, something like this (a bogus name...I don't want to reveal any
> pragmas yet):
> 
> def foo
>    ____NO_FRAMING = true
> end

One option that YARV could use is compiler definitions. :)
Programatically would seem easier on the user.
-R
--

-- 
Posted via http://www.ruby-forum.com/.

Michael Fellinger | 1 Jun 2008 03:33
Picon
Gravatar

Re: Ruby 1.8.7 has been released

On Sun, Jun 1, 2008 at 12:25 AM, Akinori MUSHA <knu <at> idaemons.org> wrote:
> Folks,
>
> It is my pleasure to announce that Ruby 1.8.7 has just been released.
>
> The new version of Ruby includes many bug fixes, lots of feature
> enhancements backported from 1.9 and some performance improvements
> since 1.8.6 while maintaining stability and backward compatibility
> with the previous release to a high degree.  See the bundled
> documentation for details about compatibility issues.
>
> The source code package is available in three formats at the following
> locations:
>
>        ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.bz2
>        ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
>        ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.zip
>
> Checksums:
>
>        MD5 (ruby-1.8.7.tar.bz2) = f17f14c8d55e731b3ce1bc35c42f0a6c
>        SHA256 (ruby-1.8.7.tar.bz2) = 65f2a862ba5e88bac7a78cff15bcb88d7534e741b51a1ffb79a0136c7041359a
>        SIZE (ruby-1.8.7.tar.bz2) = 4100024
>
>        MD5 (ruby-1.8.7.tar.gz) = de906850f9a012c12ffc6e9f56fb1b66
>        SHA256 (ruby-1.8.7.tar.gz) = 600dccf13bca3e4179fa6ff554220ce4ba67ffc72bce1ac3bf74c2599c03a0ca
>        SIZE (ruby-1.8.7.tar.gz) = 4799732
>
>        MD5 (ruby-1.8.7.zip) = 14d3eb37b32e4a26966bdd80f361ccd2
>        SHA256 (ruby-1.8.7.zip) = 805987ad167d8f9cac90e4b9342686e96a7708664111be27a3c6d680ce21d6c1
(Continue reading)

Tony Arcieri | 1 Jun 2008 05:08
Favicon

rev 0.2.2 released

I'm pleased to announce the release of Rev 0.2.2, an event library for Ruby
which combines the high performance event monitoring of libev with I/O and
networking done with Ruby's own native IO objects and sockets.

This release incorporates the the latest libev release, 3.41, which has its
own fair share of performance improvements and bugfixes.  Rev 0.2.2 also
brings with it bugfixes, including correcting a data corruption bug in the
buffering code, and also further relaxing the HTTP parser to handle more
types of HTTP responses.

Rev is available as a gem and can be installed with: gem install rev

If you're having trouble getting the latest version, it can be downloaded
directly at:

http://files.rubyforge.vm.bytemark.co.uk/rev/rev-0.2.2.gem

Enjoy!

--
Tony Arcieri
medioh.com
Michael Fellinger | 1 Jun 2008 05:24
Picon
Gravatar

Re: Ruby 1.8.7 has been released

On Sun, Jun 1, 2008 at 10:33 AM, Michael Fellinger
<m.fellinger <at> gmail.com> wrote:
> On Sun, Jun 1, 2008 at 12:25 AM, Akinori MUSHA <knu <at> idaemons.org> wrote:
>> Folks,
...
>>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
>>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/ChangeLog
>>
>> Enjoy!
>
> I'm trying to, but it seems like this release breaks Hpricot due to an
> unknown issue.

After checking the source and change log I've found that Hpricot
depends on the erroneous Array#slice! return value which is nil now,
i've made a fix and put up a Hpricot mirror with the changes necessary
on:

http://github.com/manveru/hpricot

--
^ manveru

>> --
>> Akinori MUSHA / http://akinori.org/


Gmane