Class: Kojo::Commands::DirCmd
- Inherits:
-
MisterBin::Command
- Object
- MisterBin::Command
- Kojo::Commands::DirCmd
- Defined in:
- lib/kojo/commands/dir.rb
Overview
Handle calls to the kojo dir command
Instance Attribute Summary collapse
-
#import_base ⇒ Object
readonly
Returns the value of attribute import_base.
-
#indir ⇒ Object
readonly
Returns the value of attribute indir.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#outdir ⇒ Object
readonly
Returns the value of attribute outdir.
Instance Method Summary collapse
Instance Attribute Details
#import_base ⇒ Object (readonly)
Returns the value of attribute import_base.
6 7 8 |
# File 'lib/kojo/commands/dir.rb', line 6 def import_base @import_base end |
#indir ⇒ Object (readonly)
Returns the value of attribute indir.
6 7 8 |
# File 'lib/kojo/commands/dir.rb', line 6 def indir @indir end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
6 7 8 |
# File 'lib/kojo/commands/dir.rb', line 6 def opts @opts end |
#outdir ⇒ Object (readonly)
Returns the value of attribute outdir.
6 7 8 |
# File 'lib/kojo/commands/dir.rb', line 6 def outdir @outdir end |
Instance Method Details
#run(args) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/kojo/commands/dir.rb', line 24 def run(args) @opts = args['ARGS'].args_to_hash @indir = args['INDIR'] @outdir = args['--save'] @import_base = args['--imports'] argfile = args['--args'] if argfile fileopts = YAML.load_file(argfile).symbolize_keys @opts = fileopts.merge @opts end run! end |