Class: Burner::Cli
- Inherits:
-
Object
- Object
- Burner::Cli
- Defined in:
- lib/burner/cli.rb
Overview
Process a single string as a Pipeline. This is mainly to back the command-line interface.
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#pipeline ⇒ Object
readonly
Returns the value of attribute pipeline.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
17 18 19 20 21 22 23 24 25 |
# File 'lib/burner/cli.rb', line 17 def initialize(args) path = args.first params = extract_cli_params(args) config = read_yaml(path) @pipeline = Burner::Pipeline.make(jobs: config['jobs'], steps: config['steps']) @payload = Payload.new(params: params) freeze end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
15 16 17 |
# File 'lib/burner/cli.rb', line 15 def payload @payload end |
#pipeline ⇒ Object (readonly)
Returns the value of attribute pipeline.
15 16 17 |
# File 'lib/burner/cli.rb', line 15 def pipeline @pipeline end |
Instance Method Details
#execute ⇒ Object
27 28 29 |
# File 'lib/burner/cli.rb', line 27 def execute pipeline.execute(payload: payload) end |