Distributed Ruby and SSH: drbssh

drbssh: A protocol implementation for Distributed Ruby (DRb), supporting SSH-connections.

[~/ruby/distributedRuby]$ cat drbssh_example.rb 
require 'drbssh'

DRb.start_service 'drbssh://'
remote = DRbObject.new_with_uri("drbssh://banot.etsii.ull.es/")
s = remote.eval(%q{
  { 
    :uname => `uname -a`, 
    :pwd => `pwd`,
    :version => `ruby -v`
  }
})
puts s.inspect

Ejecución

[~/ruby/distributedRuby]$ ruby drbssh_example.rb 
{
 :uname=>"Linux banot.etsii.ull.es 2.6.18-308.24.1.el5 #1 SMP Tue Dec 4 17:42:30 EST 2012 i686 i686 i386 GNU/Linux\n", 
 :pwd=>"/home/casiano\n", 
 :version=>"ruby 1.9.2dev (2010-07-11 revision 28618) [i686-linux]\n"
}



Subsecciones

Casiano Rodriguez León 2015-01-07