Class: Wolfpack::CLI
- Inherits:
-
Thor
- Object
- Thor
- Wolfpack::CLI
- Defined in:
- lib/wolfpack.rb
Constant Summary collapse
- RETURN_CODE_SUCCESS =
0
- RETURN_CODE_FAILURE =
1
Instance Method Summary collapse
Instance Method Details
#exec(command) ⇒ Object
93 94 95 96 97 98 99 100 |
# File 'lib/wolfpack.rb', line 93 def exec(command) # Parse out an integer for the # of processors the user specifies since # thor doesn't return an integer for its params. processes = [:processes].to_i if [:processes] success = Wolfpack::Runner.new(command, [:args], [:config]).run(processes) exit(success ? RETURN_CODE_SUCCESS : RETURN_CODE_FAILURE) end |
#processors ⇒ Object
108 109 110 |
# File 'lib/wolfpack.rb', line 108 def processors puts Wolfpack.processor_count end |