Class: Settlers::JavaCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/settlers/java_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(class_path, class_name) ⇒ JavaCommand

Returns a new instance of JavaCommand.



3
4
5
# File 'lib/settlers/java_command.rb', line 3

def initialize(class_path, class_name)
  @class_path, @class_name = class_path, class_name
end

Instance Method Details

#run(*args) ⇒ Object



7
8
9
# File 'lib/settlers/java_command.rb', line 7

def run(*args)
  system command(args)
end

#start(*args) ⇒ Object



11
12
13
14
# File 'lib/settlers/java_command.rb', line 11

def start(*args)
  pid = fork { exec command(args) }
  at_exit { Process.kill 'INT', pid }
end