Class: Wolfpack::CLI

Inherits:
Thor
  • Object
show all
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 = options[:processes].to_i if options[:processes]

  success = Wolfpack::Runner.new(command, options[:args], options[:config]).run(processes)
  exit(success ? RETURN_CODE_SUCCESS : RETURN_CODE_FAILURE)
end

#processorsObject



108
109
110
# File 'lib/wolfpack.rb', line 108

def processors
  puts Wolfpack.processor_count
end

#versionObject



103
104
105
# File 'lib/wolfpack.rb', line 103

def version
  puts Wolfpack::VERSION
end