Class: Settlers::Java
- Inherits:
-
Object
- Object
- Settlers::Java
- Defined in:
- lib/settlers/java.rb
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(class_name) ⇒ Java
constructor
A new instance of Java.
- #run(*args) ⇒ Object
- #start(*args) ⇒ Object
Constructor Details
#initialize(class_name) ⇒ Java
Returns a new instance of Java.
13 14 15 |
# File 'lib/settlers/java.rb', line 13 def initialize(class_name) @class_name = class_name end |
Class Method Details
.client ⇒ Object
7 8 9 |
# File 'lib/settlers/java.rb', line 7 def self.client new('soc.client.SOCPlayerClient') end |
.server ⇒ Object
3 4 5 |
# File 'lib/settlers/java.rb', line 3 def self.server new('soc.server.SOCServer') end |
Instance Method Details
#run(*args) ⇒ Object
17 18 19 20 |
# File 'lib/settlers/java.rb', line 17 def run(*args) pid = quietly_fork(args) Process.waitpid(pid) end |
#start(*args) ⇒ Object
22 23 24 25 |
# File 'lib/settlers/java.rb', line 22 def start(*args) pid = quietly_fork(args) at_exit { Process.kill 'INT', pid } end |