phase_shift 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/phase_shift.rb +1 -1
- data/lib/phase_shift/runner.rb +4 -19
- data/lib/phase_shift/version.rb +1 -1
- data/spec/phase_shift/runner_spec.rb +1 -7
- metadata +8 -2
data/bin/phase_shift.rb
CHANGED
data/lib/phase_shift/runner.rb
CHANGED
@@ -3,9 +3,10 @@ require_relative 'builder'
|
|
3
3
|
module PhaseShift
|
4
4
|
# Run a defined pipeline
|
5
5
|
class Runner
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
data/lib/phase_shift/version.rb
CHANGED
@@ -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(
|
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.
|
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-
|
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
|