Class: Devkitkat::Command
- Inherits:
-
Object
- Object
- Devkitkat::Command
- Defined in:
- lib/devkitkat/command.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #debug? ⇒ Boolean
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #interactive? ⇒ Boolean
- #kit_root ⇒ Object
- #name ⇒ Object
- #quiet? ⇒ Boolean
- #variables ⇒ Object
Constructor Details
#initialize ⇒ Command
Returns a new instance of Command.
7 8 9 10 11 12 13 14 15 |
# File 'lib/devkitkat/command.rb', line 7 def initialize @options = {} option_parser.parse! @script, @target, *@args = ARGV show_help if script == 'help' show_version if script == 'version' end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/devkitkat/command.rb', line 5 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/devkitkat/command.rb', line 5 def @options end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
5 6 7 |
# File 'lib/devkitkat/command.rb', line 5 def script @script end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
5 6 7 |
# File 'lib/devkitkat/command.rb', line 5 def target @target end |
Instance Method Details
#debug? ⇒ Boolean
25 26 27 |
# File 'lib/devkitkat/command.rb', line 25 def debug? [:debug] end |
#interactive? ⇒ Boolean
17 18 19 |
# File 'lib/devkitkat/command.rb', line 17 def interactive? [:interactive] end |
#kit_root ⇒ Object
33 34 35 |
# File 'lib/devkitkat/command.rb', line 33 def kit_root [:root_path] || Dir.pwd end |
#name ⇒ Object
37 38 39 |
# File 'lib/devkitkat/command.rb', line 37 def name script.tr('-', '_') end |
#quiet? ⇒ Boolean
29 30 31 |
# File 'lib/devkitkat/command.rb', line 29 def quiet? [:quiet] end |
#variables ⇒ Object
21 22 23 |
# File 'lib/devkitkat/command.rb', line 21 def variables [:variables] end |