Class: Kojo::Commands::FileCmd
- Inherits:
-
CommandBase
- Object
- MisterBin::Command
- CommandBase
- Kojo::Commands::FileCmd
- Defined in:
- lib/kojo/commands/file.rb
Overview
Handle calls to the kojo file command
Instance Attribute Summary collapse
-
#import_base ⇒ Object
readonly
Returns the value of attribute import_base.
-
#infile ⇒ Object
readonly
Returns the value of attribute infile.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#outfile ⇒ Object
readonly
Returns the value of attribute outfile.
Instance Method Summary collapse
Methods inherited from CommandBase
Instance Attribute Details
#import_base ⇒ Object (readonly)
Returns the value of attribute import_base.
9 10 11 |
# File 'lib/kojo/commands/file.rb', line 9 def import_base @import_base end |
#infile ⇒ Object (readonly)
Returns the value of attribute infile.
9 10 11 |
# File 'lib/kojo/commands/file.rb', line 9 def infile @infile end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
9 10 11 |
# File 'lib/kojo/commands/file.rb', line 9 def opts @opts end |
#outfile ⇒ Object (readonly)
Returns the value of attribute outfile.
9 10 11 |
# File 'lib/kojo/commands/file.rb', line 9 def outfile @outfile end |
Instance Method Details
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/kojo/commands/file.rb', line 28 def run @opts = args['ARGS'].args_to_hash @outfile = args['--save'] @infile = args['INFILE'] @import_base = args['--imports'] argfile = args['--args'] if argfile fileopts = YAML.load_file(argfile).symbolize_keys @opts = fileopts.merge opts end run! end |