Class: Nonnative::Command
- Inherits:
-
Object
- Object
- Nonnative::Command
- Defined in:
- lib/nonnative/command.rb
Instance Method Summary collapse
-
#initialize(process) ⇒ Command
constructor
A new instance of Command.
- #name ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(process) ⇒ Command
Returns a new instance of Command.
5 6 7 8 |
# File 'lib/nonnative/command.rb', line 5 def initialize(process) @process = process @started = false end |
Instance Method Details
#name ⇒ Object
10 11 12 |
# File 'lib/nonnative/command.rb', line 10 def name process.command end |
#start ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/nonnative/command.rb', line 14 def start unless started @pid = spawn(process.command, %i[out err] => [process.file, 'a']) @started = true end pid end |