Class: Helmsnap::Runner
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args) ⇒ Runner
constructor
A new instance of Runner.
Methods inherited from Service
Constructor Details
#initialize(args) ⇒ Runner
Returns a new instance of Runner.
4 5 6 7 |
# File 'lib/helmsnap/runner.rb', line 4 def initialize(args) super() self.args = args.dup end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/helmsnap/runner.rb', line 9 def call parser = Helmsnap::ArgsParser.new(args) self. = parser. self.config = Helmsnap::Config.new(.config_path) cmd, *rest = args if cmd.nil? parser.print_help!("Command not provided.") end if rest.size.positive? parser.print_help!("Too many arguments.") end case cmd when "generate", "gen" generate! when "check" check! when "dependencies", "deps" setup_deps! else parser.print_help!("Unknown command: #{cmd}.") end end |