Class: Kerbi::Cli::RootHandler
- Inherits:
-
BaseHandler
- Object
- Thor
- BaseHandler
- Kerbi::Cli::RootHandler
- Defined in:
- lib/cli/root_handler.rb
Overview
Top level CLI command handler with Thor.
Class Method Summary collapse
-
.start(*args, **kwargs) ⇒ Object
Two things happen here: 1.
Instance Method Summary collapse
Class Method Details
.start(*args, **kwargs) ⇒ Object
Two things happen here:
-
Kerbi::Globals.reset is necessary for testing, because memory
is not flushed.
24 25 26 27 28 29 30 31 32 |
# File 'lib/cli/root_handler.rb', line 24 def self.start(*args, **kwargs) begin Kerbi::Globals.reset super rescue Kerbi::Error => e #noinspection RubyResolve puts e.to_s.colorize(:red).bold end end |
Instance Method Details
#console ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/cli/root_handler.rb', line 46 def console utils::Cli.load_kerbifile(run_opts.project_root) values = compile_values ARGV.clear IRB.setup(eval("__FILE__"), argv: []) workspace = IRB::WorkSpace.new(Console.new(values)) IRB::Irb.new(workspace).run(IRB.conf) end |
#template(release_name) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/cli/root_handler.rb', line 36 def template(release_name) utils::Cli.load_kerbifile(run_opts.project_root) values = compile_values persist_compiled_values mixer_classes = Kerbi::Globals.mixers res_dicts = utils::Cli.run_mixers(mixer_classes, values, release_name) echo_data(res_dicts, coerce_type: "Array") end |
#version ⇒ Object
56 57 58 |
# File 'lib/cli/root_handler.rb', line 56 def version puts "1" end |