Class: PhaseShift::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/phase_shift/runner.rb

Overview

Run a defined pipeline

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Runner

Returns a new instance of Runner.



6
7
8
9
# File 'lib/phase_shift/runner.rb', line 6

def initialize(options = nil)
  fail 'No specified pipeline' unless options.include? :pipeline
  @options = options
end

Instance Method Details

#default_optionsObject



23
24
25
# File 'lib/phase_shift/runner.rb', line 23

def default_options
  {}
end

#optionsObject



19
20
21
# File 'lib/phase_shift/runner.rb', line 19

def options
  @options ||= parse_options(ARGV)
end

#pipelineObject



15
16
17
# File 'lib/phase_shift/runner.rb', line 15

def pipeline
  @pipeline ||= Builder.parse_file "#{options[:pipeline]}.rb"
end

#runObject



11
12
13
# File 'lib/phase_shift/runner.rb', line 11

def run
  pipeline.call
end