diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-04-21 10:02:21 +0200 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-04-21 10:02:21 +0200 |
commit | bc3f7d771f8ec4b8bb6c39619cba036b6f20b9cd (patch) | |
tree | 40f3f50ddb76a759878585029ca92e83fbcc9ba3 /toys/brhute-rb/spike/drbssh_test.rb | |
parent | add de - ideas on distributed execution (diff) | |
download | laurent-tools-bc3f7d771f8ec4b8bb6c39619cba036b6f20b9cd.tar.xz laurent-tools-bc3f7d771f8ec4b8bb6c39619cba036b6f20b9cd.zip |
brhute: start for the rb version
Diffstat (limited to '')
-rw-r--r-- | toys/brhute-rb/spike/drbssh_test.rb | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/toys/brhute-rb/spike/drbssh_test.rb b/toys/brhute-rb/spike/drbssh_test.rb deleted file mode 100644 index 8a1f2c2..0000000 --- a/toys/brhute-rb/spike/drbssh_test.rb +++ /dev/null @@ -1,68 +0,0 @@ -$:.unshift File.dirname(__FILE__) - -require 'drbssh' # local version of drbssh sudo gem install drbssh - -class Ohmy - def toto - puts 'i am '+`hostname` - return 'i am '+`hostname` - end -end - -# Connect - OK -DRb.start_service 'drbssh://' -remote = DRbObject.new_with_uri("drbssh://_sd/ruby") - -# Simple eval - OK -puts remote.eval('`hostname`') -puts remote.eval('1+1') - -# Send classobj - FAIL -#o = DRbObject.new_with_uri "drbssh://_sd/ruby", Ohmy.new -#Ohmy.new -#o = remote.eval("Ohmy.new") -#class << remote -# undef :instance_eval -# def bla -# puts 'i am '+`hostname` -# end -#end -#remote.bla - -# Create objects - OK -#l = Hash -#l2 = DRbObject.new(l, "drbssh://_sd/ruby") -#remote_hash = remote.eval("@a = {}.extend(DRb::DRbUndumped)") -#puts l2 -#remote_hash = remote.eval("@a = {}.extend(DRb::DRbUndumped)") - -# Send object - OK -l = [1,2,3] -obj = remote.eval("@data = \""+Marshal.dump(l)+"\"") -obj = remote.eval("@a = Marshal.load(@data)") -obj = remote.eval("@a += [4]") -obj += [5] -puts obj - -# Send class object - FAIL -#o = Ohmy.new -#eval("puts o.toto") -#eval("puts Ohmy.new.toto") -#eval("@c = \"Marshal.dump(Ohmy)\"; @d=Marshal.load(eval(@c))") -#eval("@d.new.toto") -#obj = remote.eval("@c = \""+Marshal.dump(Ohmy)+"\"") -#puts obj -#obj = remote.eval("@c.class") -#puts obj -#obj = remote.eval("@c.size") -#puts obj -#obj = remote.eval("@cc = Marshal.load(eval(@c))") -#puts obj -#obj = remote.eval("@o = @cc.new.toto") -#puts obj -#obj = remote.eval("@obj = @o.toto") -#puts obj -#obj = remote.eval("@obj = \""+Marshal.dump(o)+"\"") -#puts obj -#obj = remote.eval("puts Ohmy.new.toto") -#puts obj |