From: Eric Schwartz Date: 2006-02-16T09:53:27+09:00 Subject: Re: Ruby script to Module/Class refactor "James b. Byrne" writes: > Many thanks. I have clue where to begin now. I will try and redo this > more or less along the lines you recommend and post the result back > here. Just to clarify one point, the HP3000 drops off the files onto > the host that is running the Ruby script. There is no service running > on the HP3000 that will respond to a file transfer request, although, as > you point out, that does not preclude a scenario where the drop machine > is not the script runner. Exactly. HP3000#get_file might in that case look something like: class HP3000 def initialize(hostname) @drop_dir = "/path/to/dropdir/#{hostname}" end def get_file(filename, destination) system("cp #{@dropdir}/#{filename} #{destination}") end end Or some such silliness-- and yes, there are more Rubyish ways to do that, but, like Perl, one of the things I like about Ruby is that you can do more or less in pure Ruby, depending on your taste and your application. -=Eric