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