Sha256: b483e17bf0a8e81af13fc53468c4b9c3de6c06d73320c9585c4c6fcb6ffee31d

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

#!/usr/bin/env ruby1.9

require "base64"
require "#{File.dirname(__FILE__)}/../lib/ruby_process.rb"

$stdin.sync = true
$stdout.sync = true
$stderr.sync = true

debug = false
pid = nil

ARGV.each do |arg|
  if arg == "--debug"
    debug = true
  elsif match = arg.match(/--pid=(\d+)$/)
    pid = match[1].to_i
  elsif match = arg.match(/--title=(.+)$/)
    #ignore - its for finding process via 'ps aux'.
  else
    raise "Unknown argument: '#{arg}'."
  end
end

debug = true if ARGV.index("--debug") != nil
raise "No PID given of parent process." if !pid

rps = RubyProcess.new(
  in: $stdin,
  out: $stdout,
  err: $stderr,
  debug: debug,
  pid: pid
)
rps.listen
$stdout.puts("ruby_process_started")
rps.join

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
ruby_process-0.0.13 scripts/ruby_process_script.rb
RubyProcess-0.0.12 scripts/ruby_process_script.rb