Class: Burner::Cli

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#payloadObject (readonly)

Returns the value of attribute payload.



15
16
17
# File 'lib/burner/cli.rb', line 15

def payload
  @payload
end

#pipelineObject (readonly)

Returns the value of attribute pipeline.



15
16
17
# File 'lib/burner/cli.rb', line 15

def pipeline
  @pipeline
end

Instance Method Details

#executeObject



27
28
29
# File 'lib/burner/cli.rb', line 27

def execute
  pipeline.execute(payload: payload)
end