Sha256: 24caf8aa72838d52b33c330a510ec67aba17bd4e18f60b06c5da852f24e02dd6

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

require "drb"

require "ro_commands/helpers/all_files"
require "ro_commands/helpers/out"
require "ro_commands/core_ext/string"


item = ARGV.shift
DRb.start_service
file = RoCommands.file_map.keys.grep(%r{#{item}}).first

if file
  port = RoCommands.file_map[file.to_sym]
end

if ARGV.length == 0
  #drb_obj = DRbObject.new_with_uri("druby://localhost:#{port}")
  #drb_obj.start
else
  #Out.out "ARGV:#{ARGV}   file:#{File.basename __FILE__} line:#{__LINE__}", "red"
  meth = ARGV.shift
  args = ARGV

  #Out.out "starting #{File.basename(file.to_s).gsub(%r{\.rb}, "")}"
  drb_obj = DRbObject.new_with_uri("druby://localhost:#{port}")

  r = drb_obj.start(["drb_#{meth}", *args, {pwd: Dir.pwd}])
  #Out.out "r:#{r}   file:#{File.basename __FILE__} line:#{__LINE__}"
  Out.out(r)
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ro_commands-0.0.3 lib/drb/client.rb
ro_commands-0.0.2 lib/drb/client.rb