From: gabriele renzi Date: 2004-07-26T08:57:33+09:00 Subject: Re: [ANN] Net::SSH 0.0.4 "Happy Birthday To Me" il Mon, 26 Jul 2004 07:33:54 +0900, Jamis Buck ha scritto:: >gabriele renzi wrote: >> thanks for this, I'm looking forward to see openuri-like support for >> sftp stuff :) > >Can you give me an example or two of the syntax you'd like to see? I'd >be happy to add something like it into Net::SSH, if at all possible. > well, I was thinking something really dumb like: require 'net/ssh/open-sftp' uri=URI.parse 'sftp://user@host.foo/file.txt' # add magic to handle key/pass txt=uri.open.read btw this has the same problem that handling https with open-uri, wich I think relates to proper key management. Anyway, while playing with this I discovered that on windows open-uri fails with ftp files, due to relying on dev/null: >> u=URI.parse('ftp://me:foo@host.it') => # >> u.open Errno::ENOENT: No such file or directory - /dev/null from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:87:in `initialize' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:87:in `open_uri_original _open' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:87:in `open' from C:/Programmi/Ruby/lib/ruby/1.8/net/ftp.rb:497:in `getbinaryfile' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:594:in `direct_open' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:169:in `open_loop' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:164:in `catch' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:164:in `open_loop' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:134:in `open_uri' from C:/Programmi/Ruby/lib/ruby/1.8/open-uri.rb:424:in `open' from (irb):6 ruby -v ruby 1.8.2 (2004-06-29) [i386-mswin32]