| Class | URI::Ssh |
| In: |
lib/uri/ssh.rb
|
| Parent: | GenericEx |
| SCHEME | = | 'ssh'.freeze |
| DEFAULT_HOST | = | 'localhost'.freeze |
| DEFAULT_PORT | = | 22 |
| DEFAULT_QUERY | = | ''.freeze |
| COMPONENT | = | [ :scheme, :userinfo, :host, :path, :query |
# File lib/uri/ssh.rb, line 39 def checkout out = TempPath.new('checkout', pathname.basename.to_s) [out, shell.scp!(mk_opts, mk_scp_arg, out)] end
# File lib/uri/ssh.rb, line 52 def jump_and_eval ( aString, ruby='ruby', ruby_opts=[], &block ) tag = "=== RESULT ===\n" TempPath.new do |tmp| tmp.open('w') do |f| f.print " aProc = proc { #{aString} } result = begin [true, aProc[]] rescue Exception => ex [false, ex] end STDERR.print '#{tag}' STDERR.print Marshal.dump(result) " end cmd = shell.ssh(mk_opts, mk_ssh_arg, ruby, *ruby_opts) < tmp data = cmd.popen block[data.output] data.waitpid if data.status.success? err = data.error.read err, result = err.split(tag) STDERR.print err st, obj = Marshal.load(result) if st return obj else raise obj end else data.display raise "Command failed #{cmd}" end end end
# File lib/uri/ssh.rb, line 23 def mk_opts opts = ['-q'] opts << '-P' << @port if @port != DEFAULT_PORT opts + mk_custom_opts end