Class: Buildless::Cli::Processor
- Inherits:
-
Object
- Object
- Buildless::Cli::Processor
- Defined in:
- lib/buildless/cli/processor.rb
Constant Summary collapse
- COMMANDS =
%w[apply].freeze
- InvalidCommand =
Class.new(StandardError)
- InvalidUid =
Class.new(StandardError)
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args) ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize(args) ⇒ Processor
Returns a new instance of Processor.
11 12 13 14 |
# File 'lib/buildless/cli/processor.rb', line 11 def initialize(args) @command = args[0] @uid = args[1] end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/buildless/cli/processor.rb', line 16 def call validate_command raise InvalidUid, "Configuration not found for #{@uid}" if json_template.nil? ::Buildless.apply(json_template) end |