phase_shift 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,5 +2,5 @@
2
2
  $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
3
3
  require 'phase_shift'
4
4
 
5
- runner = PhaseShift::Runner.new
5
+ runner = PhaseShift::Runner.new(ARGV.first)
6
6
  runner.run
@@ -3,9 +3,10 @@ require_relative 'builder'
3
3
  module PhaseShift
4
4
  # Run a defined pipeline
5
5
  class Runner
6
- def initialize(options = nil)
7
- fail 'No specified pipeline' unless options.include? :pipeline
8
- @options = options
6
+ attr_reader :options
7
+
8
+ def initialize(pipeline)
9
+ @options = { pipeline: pipeline }
9
10
  end
10
11
 
11
12
  def run
@@ -15,21 +16,5 @@ module PhaseShift
15
16
  def pipeline
16
17
  @pipeline ||= Builder.parse_file "#{options[:pipeline]}.rb"
17
18
  end
18
-
19
- def options
20
- @options ||= parse_options(ARGV)
21
- end
22
-
23
- def default_options
24
- {}
25
- end
26
-
27
- private
28
-
29
- def parse_options(argv)
30
- @options = default_options
31
- @options[:pipeline] = argv.first if argv.length > 0
32
- @options
33
- end
34
19
  end
35
20
  end
@@ -1,4 +1,4 @@
1
1
  # A simple pipeline processing implementation similiar to rack middleware
2
2
  module PhaseShift
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
@@ -2,18 +2,12 @@ require 'spec_helper'
2
2
  require 'phase_shift/runner'
3
3
 
4
4
  describe 'PhaseShift::Runner' do
5
- subject { PhaseShift::Runner.new(pipeline: 'spec/test') }
5
+ subject { PhaseShift::Runner.new('spec/test') }
6
6
 
7
7
  context '#initialize' do
8
8
  it 'requires a specified pipeline' do
9
9
  expect {PhaseShift::Runner.new}.to raise_error
10
10
  end
11
-
12
- it 'sets the passed options' do
13
- runner = PhaseShift::Runner.new(pipeline: 'spec/test', test: 'value')
14
- expect(runner.options).to include(:test)
15
- expect(runner.options[:test]).to eq 'value'
16
- end
17
11
  end
18
12
 
19
13
  context '#run' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phase_shift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-14 00:00:00.000000000 Z
12
+ date: 2014-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -112,12 +112,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  - - ! '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
+ segments:
116
+ - 0
117
+ hash: 3616887609329350633
115
118
  required_rubygems_version: !ruby/object:Gem::Requirement
116
119
  none: false
117
120
  requirements:
118
121
  - - ! '>='
119
122
  - !ruby/object:Gem::Version
120
123
  version: '0'
124
+ segments:
125
+ - 0
126
+ hash: 3616887609329350633
121
127
  requirements: []
122
128
  rubyforge_project:
123
129
  rubygems_version: 1.8.23