Class: Nonnative::Process
- Inherits:
-
Object
- Object
- Nonnative::Process
- Defined in:
- lib/nonnative/process.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Process
constructor
A new instance of Process.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Process
Returns a new instance of Process.
5 6 7 |
# File 'lib/nonnative/process.rb', line 5 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#start ⇒ Object
9 10 11 12 |
# File 'lib/nonnative/process.rb', line 9 def start @pid = spawn(configuration.process) [port_open?, pid] end |
#stop ⇒ Object
14 15 16 17 |
# File 'lib/nonnative/process.rb', line 14 def stop ::Process.kill('SIGHUP', pid) [port_closed?, pid] end |