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
- #create_tmp_dir ⇒ Object
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #kit_root ⇒ Object
- #tmp_dir ⇒ Object
- #tty? ⇒ Boolean
- #variables ⇒ Object
Constructor Details
#initialize ⇒ Command
Returns a new instance of Command.
5 6 7 8 9 10 11 12 |
# File 'lib/devkitkat/command.rb', line 5 def initialize @options = {} option_parser.parse! @script, @target, *@args = ARGV show_help if script == 'help' end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/devkitkat/command.rb', line 3 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/devkitkat/command.rb', line 3 def @options end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
3 4 5 |
# File 'lib/devkitkat/command.rb', line 3 def script @script end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
3 4 5 |
# File 'lib/devkitkat/command.rb', line 3 def target @target end |
Instance Method Details
#create_tmp_dir ⇒ Object
26 27 28 |
# File 'lib/devkitkat/command.rb', line 26 def create_tmp_dir FileUtils.mkdir_p(tmp_dir) end |
#kit_root ⇒ Object
30 31 32 |
# File 'lib/devkitkat/command.rb', line 30 def kit_root Dir.pwd # TODO: root_path end |
#tmp_dir ⇒ Object
22 23 24 |
# File 'lib/devkitkat/command.rb', line 22 def tmp_dir File.join(kit_root, 'tmp') end |
#tty? ⇒ Boolean
14 15 16 |
# File 'lib/devkitkat/command.rb', line 14 def tty? [:tty] end |
#variables ⇒ Object
18 19 20 |
# File 'lib/devkitkat/command.rb', line 18 def variables [:variables] end |