lib/shexy.rb in shexy-0.3.4 vs lib/shexy.rb in shexy-0.3.5

- old
+ new

@@ -31,11 +31,11 @@ # Shexy.copy_to 'test@test-host', '/home/rubiojr/my-uber-file', '/tmp/' # module Shexy - VERSION = '0.3.4' + VERSION = '0.3.5' [:user, :password, :key, :cmd, :host].each do |n| instance_eval %{ def #{n}; Thread.current[:shexy_#{n}]; end def #{n}=(v); Thread.current[:shexy_#{n}] = v; end @@ -143,22 +143,21 @@ end end def self.batch(&block) require 'tempfile' - out, err = nil,nil def self.script(script) f = Tempfile.new 'shexy' begin f.puts script f.flush copy_to f.path, "#{f.path}.remote" - out, err = exe "/bin/bash #{f.path}.remote" + out, err, ecode, esig = exe "/bin/bash #{f.path}.remote" ensure f.close f.unlink end - return out, err + return out, err, ecode, esig end instance_eval &block end #