Class: Testjour::CLI::BaseCommand
- Inherits:
-
Object
- Object
- Testjour::CLI::BaseCommand
- Defined in:
- lib/testjour/commands/base_command.rb
Direct Known Subclasses
HelpCommand, List, LocalRun, Run, SlaveRun, SlaveStart, SlaveStop, SlaveWarm, VersionCommand, Warm
Instance Attribute Summary collapse
-
#non_options ⇒ Object
readonly
Returns the value of attribute non_options.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parser, args) ⇒ BaseCommand
constructor
def self.usage message = [] if help.nil? message << command else message << “#BaseCommand.command: #BaseCommand.help” end message << detailed_help unless detailed_help.nil? message << “” message << “Valid options:” message @option_parser.summarize(message) end.
- #option_parser ⇒ Object
Constructor Details
#initialize(parser, args) ⇒ BaseCommand
def self.usage
= []
if help.nil?
<< command
else
<< "#{command}: #{help}"
end
<< detailed_help unless detailed_help.nil?
<< ""
<< "Valid options:"
@option_parser.summarize()
end
40 41 42 43 44 |
# File 'lib/testjour/commands/base_command.rb', line 40 def initialize(parser, args) @parser = parser = {} = option_parser.parse(args) end |
Instance Attribute Details
#non_options ⇒ Object (readonly)
Returns the value of attribute non_options.
7 8 9 |
# File 'lib/testjour/commands/base_command.rb', line 7 def end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/testjour/commands/base_command.rb', line 7 def end |
Class Method Details
.command ⇒ Object
9 10 11 |
# File 'lib/testjour/commands/base_command.rb', line 9 def self.command self.name.downcase end |
.detailed_help ⇒ Object
21 22 23 |
# File 'lib/testjour/commands/base_command.rb', line 21 def self.detailed_help nil end |
.help ⇒ Object
17 18 19 |
# File 'lib/testjour/commands/base_command.rb', line 17 def self.help nil end |
.options ⇒ Object
13 14 15 |
# File 'lib/testjour/commands/base_command.rb', line 13 def self. {} end |
Instance Method Details
#option_parser ⇒ Object
46 47 48 |
# File 'lib/testjour/commands/base_command.rb', line 46 def option_parser OptionParser.new end |