harrison 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +23 -0
- data/README.md +62 -9
- data/harrison.gemspec +1 -0
- data/lib/harrison.rb +18 -14
- data/lib/harrison/base.rb +13 -5
- data/lib/harrison/deploy.rb +160 -42
- data/lib/harrison/deploy/phase.rb +51 -0
- data/lib/harrison/package.rb +18 -10
- data/lib/harrison/ssh.rb +12 -6
- data/lib/harrison/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/unit/harrison/base_spec.rb +4 -13
- data/spec/unit/harrison/deploy/phase_spec.rb +152 -0
- data/spec/unit/harrison/deploy_spec.rb +352 -63
- data/spec/unit/harrison_spec.rb +13 -11
- metadata +22 -3
data/spec/unit/harrison_spec.rb
CHANGED
@@ -2,13 +2,13 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Harrison do
|
4
4
|
before(:all) do
|
5
|
-
[ :@@args, :@@
|
5
|
+
[ :@@args, :@@task_runners, :@@config, :@@runner ].each do |class_var|
|
6
6
|
Harrison.class_variable_set(class_var, nil)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
[ :@@args, :@@
|
11
|
+
[ :@@args, :@@task_runners, :@@config, :@@runner ].each do |class_var|
|
12
12
|
Harrison.class_variable_set(class_var, nil)
|
13
13
|
end
|
14
14
|
end
|
@@ -78,21 +78,22 @@ describe Harrison do
|
|
78
78
|
describe '.package' do
|
79
79
|
before(:each) do
|
80
80
|
Harrison.class_variable_set(:@@args, ['package'])
|
81
|
-
Harrison.class_variable_set(:@@runner, lambda { Harrison.class_variable_get(:@@
|
81
|
+
Harrison.class_variable_set(:@@runner, lambda { Harrison.class_variable_get(:@@task_runners)[:package] if Harrison.class_variable_defined?(:@@task_runners) && Harrison.class_variable_get(:@@task_runners).has_key?(:package) })
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'should yield a new Harrison::Package' do
|
85
85
|
mock_package = double(:package, parse: true)
|
86
|
-
|
86
|
+
Harrison.class_variable_set(:@@task_runners, Hash.new)
|
87
87
|
|
88
|
+
expect(Harrison::Package).to receive(:new).and_return(mock_package)
|
88
89
|
expect { |b| Harrison.package(&b) }.to yield_with_args(mock_package)
|
89
90
|
end
|
90
91
|
|
91
92
|
it 'should yield existing Harrison::Package if defined' do
|
92
93
|
mock_package = double(:package, parse: true)
|
93
|
-
Harrison.class_variable_set(:@@
|
94
|
-
expect(Harrison::Package).to_not receive(:new)
|
94
|
+
Harrison.class_variable_set(:@@task_runners, { package: mock_package })
|
95
95
|
|
96
|
+
expect(Harrison::Package).to_not receive(:new)
|
96
97
|
expect { |b| Harrison.package(&b) }.to yield_with_args(mock_package)
|
97
98
|
end
|
98
99
|
end
|
@@ -100,21 +101,22 @@ describe Harrison do
|
|
100
101
|
describe '.deploy' do
|
101
102
|
before(:each) do
|
102
103
|
Harrison.class_variable_set(:@@args, ['deploy'])
|
103
|
-
Harrison.class_variable_set(:@@runner, lambda { Harrison.class_variable_get(:@@
|
104
|
+
Harrison.class_variable_set(:@@runner, lambda { Harrison.class_variable_get(:@@task_runners)[:deploy] if Harrison.class_variable_defined?(:@@task_runners) && Harrison.class_variable_get(:@@task_runners).has_key?(:deploy) })
|
104
105
|
end
|
105
106
|
|
106
107
|
it 'should yield a new Harrison::Deploy' do
|
107
108
|
mock_deploy = double(:deploy, parse: true)
|
108
|
-
|
109
|
+
Harrison.class_variable_set(:@@task_runners, Hash.new)
|
109
110
|
|
111
|
+
expect(Harrison::Deploy).to receive(:new).and_return(mock_deploy)
|
110
112
|
expect { |b| Harrison.deploy(&b) }.to yield_with_args(mock_deploy)
|
111
113
|
end
|
112
114
|
|
113
|
-
it 'should yield existing Harrison::
|
115
|
+
it 'should yield existing Harrison::Deploy if defined' do
|
114
116
|
mock_deploy = double(:deploy, parse: true)
|
115
|
-
Harrison.class_variable_set(:@@
|
116
|
-
expect(Harrison::Deploy).to_not receive(:new)
|
117
|
+
Harrison.class_variable_set(:@@task_runners, { deploy: mock_deploy })
|
117
118
|
|
119
|
+
expect(Harrison::Deploy).to_not receive(:new)
|
118
120
|
expect { |b| Harrison.deploy(&b) }.to yield_with_args(mock_deploy)
|
119
121
|
end
|
120
122
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harrison
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
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-
|
12
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|
@@ -107,6 +107,22 @@ dependencies:
|
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '3.0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: simplecov
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
110
126
|
- !ruby/object:Gem::Dependency
|
111
127
|
name: debugger
|
112
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,6 +178,7 @@ files:
|
|
162
178
|
- lib/harrison/base.rb
|
163
179
|
- lib/harrison/config.rb
|
164
180
|
- lib/harrison/deploy.rb
|
181
|
+
- lib/harrison/deploy/phase.rb
|
165
182
|
- lib/harrison/package.rb
|
166
183
|
- lib/harrison/ssh.rb
|
167
184
|
- lib/harrison/version.rb
|
@@ -170,6 +187,7 @@ files:
|
|
170
187
|
- spec/fixtures/nested/.gitkeep
|
171
188
|
- spec/spec_helper.rb
|
172
189
|
- spec/unit/harrison/base_spec.rb
|
190
|
+
- spec/unit/harrison/deploy/phase_spec.rb
|
173
191
|
- spec/unit/harrison/deploy_spec.rb
|
174
192
|
- spec/unit/harrison/package_spec.rb
|
175
193
|
- spec/unit/harrison/ssh_spec.rb
|
@@ -195,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
213
|
version: '0'
|
196
214
|
segments:
|
197
215
|
- 0
|
198
|
-
hash:
|
216
|
+
hash: 2429299049933717858
|
199
217
|
requirements: []
|
200
218
|
rubyforge_project:
|
201
219
|
rubygems_version: 1.8.29
|
@@ -208,6 +226,7 @@ test_files:
|
|
208
226
|
- spec/fixtures/nested/.gitkeep
|
209
227
|
- spec/spec_helper.rb
|
210
228
|
- spec/unit/harrison/base_spec.rb
|
229
|
+
- spec/unit/harrison/deploy/phase_spec.rb
|
211
230
|
- spec/unit/harrison/deploy_spec.rb
|
212
231
|
- spec/unit/harrison/package_spec.rb
|
213
232
|
- spec/unit/harrison/ssh_spec.rb
|