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.
26 27 28 29 30 31 32 33 34 |
# File 'lib/cli/root_handler.rb', line 26 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
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/cli/root_handler.rb', line 48 def console utils::Cli.load_kerbifile(run_opts.project_root) values = compile_values default_values = compile_default_values ARGV.clear IRB.setup(eval("__FILE__"), argv: []) wrapper = Console.new(values, default_values) workspace = IRB::WorkSpace.new(wrapper) IRB::Irb.new(workspace).run(IRB.conf) end |
#template(release_name, project_uri) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/cli/root_handler.rb', line 39 def template(release_name, project_uri) mem_dna(release_name, project_uri) utils::Cli.load_kerbifile(run_opts.project_root) res_dicts = perform_templating persist_compiled_values echo_data(res_dicts, coerce_type: "Array") end |
#version ⇒ Object
60 61 62 |
# File 'lib/cli/root_handler.rb', line 60 def version puts "1" end |