Class: Ing::Commands::Help
- Inherits:
-
Object
- Object
- Ing::Commands::Help
- Includes:
- Ing::CommonOptions
- Defined in:
- lib/ing/commands/help.rb
Constant Summary collapse
- DEFAULTS =
{ namespace: 'ing:commands', ing_file: 'ing.rb' }
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
- #shell ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
-
#before ⇒ Object
Require each passed file or library before running and require the ing file if it exists.
- #call(cmd = "help") ⇒ Object
-
#initialize(options) ⇒ Help
constructor
A new instance of Help.
Methods included from Ing::CommonOptions
#debug, #debug?, included, #ing_file, #namespace, #require_ing_file, #require_libs, #requires
Constructor Details
#initialize(options) ⇒ Help
Returns a new instance of Help.
28 29 30 |
# File 'lib/ing/commands/help.rb', line 28 def initialize() self. = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/ing/commands/help.rb', line 21 def @options end |
#shell ⇒ Object
24 25 26 |
# File 'lib/ing/commands/help.rb', line 24 def shell @shell ||= ::Ing.shell_class.new end |
Class Method Details
.specify_options(parser) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/ing/commands/help.rb', line 11 def self.(parser) parser.text "Display help on specified command" parser.text "\nUsage:" parser.text " ing help generate # help on built-in command generate" parser.text " ing help --namespace test unit # help on command within namespace" parser.text " ing help # display this message" end |
Instance Method Details
#before ⇒ Object
Require each passed file or library before running and require the ing file if it exists
34 35 36 37 |
# File 'lib/ing/commands/help.rb', line 34 def before require_libs require_ing_file end |
#call(cmd = "help") ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ing/commands/help.rb', line 39 def call(cmd="help") before klass = Util.decode_class(cmd, _namespace_class) help = Command.new(klass).help shell.say help end |