producer-core 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/condition_target.feature +15 -0
- data/features/task_target.feature +11 -0
- data/lib/producer/core/condition.rb +1 -1
- data/lib/producer/core/task.rb +3 -0
- data/lib/producer/core/version.rb +1 -1
- data/spec/producer/core/condition_spec.rb +11 -0
- data/spec/producer/core/task_spec.rb +8 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb43f3bef9d4d62b0d7b1b74a2c8e71f58410e2
|
4
|
+
data.tar.gz: ec652f99e4273ba9f603bcbc8e602abbbf583437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e6d71a688e80c7a9e806c67de3f917dd51fb322af9dfb8f45379980579894423c149812e2f653dba3d11f460dce998ed9422c035c069d535d3857f133be081c
|
7
|
+
data.tar.gz: 3ea4adbcebff73ab03680bee2f3c579df399738c6a5c638fdbd08755262bb219efd6fcdfc2be81d5f2f577b044bd9fdbf5ac0c3035db02de1e75959497537588
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Feature: `target' condition keyword
|
2
|
+
|
3
|
+
Scenario: returns the current target
|
4
|
+
Given a recipe with:
|
5
|
+
"""
|
6
|
+
target 'some_host.example'
|
7
|
+
|
8
|
+
task :test_target do
|
9
|
+
condition { target == 'some_host.example' }
|
10
|
+
|
11
|
+
echo 'OK'
|
12
|
+
end
|
13
|
+
"""
|
14
|
+
When I execute the recipe
|
15
|
+
Then the output must contain "OK"
|
data/lib/producer/core/task.rb
CHANGED
@@ -182,5 +182,16 @@ module Producer::Core
|
|
182
182
|
described_class.evaluate(env, []) { get :some_key }
|
183
183
|
end
|
184
184
|
end
|
185
|
+
|
186
|
+
describe '#target' do
|
187
|
+
let(:env) { Env.new }
|
188
|
+
|
189
|
+
before { env.target = :some_target }
|
190
|
+
|
191
|
+
it 'returns current env target' do
|
192
|
+
condition = described_class.evaluate(env, []) { target == :some_target }
|
193
|
+
expect(condition).to be_met
|
194
|
+
end
|
195
|
+
end
|
185
196
|
end
|
186
197
|
end
|
@@ -159,5 +159,13 @@ module Producer::Core
|
|
159
159
|
expect(task.get :some_key).to eq :some_value
|
160
160
|
end
|
161
161
|
end
|
162
|
+
|
163
|
+
describe '#target' do
|
164
|
+
before { env.target = :some_target }
|
165
|
+
|
166
|
+
it 'returns current env target' do
|
167
|
+
expect(task.target).to eq :some_target
|
168
|
+
end
|
169
|
+
end
|
162
170
|
end
|
163
171
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- features/cli_usage.feature
|
134
134
|
- features/cli_verbose.feature
|
135
135
|
- features/condition_negated_test.feature
|
136
|
+
- features/condition_target.feature
|
136
137
|
- features/recipe_compose_macro.feature
|
137
138
|
- features/recipe_macro.feature
|
138
139
|
- features/recipe_source.feature
|
@@ -153,6 +154,7 @@ files:
|
|
153
154
|
- features/task_ask.feature
|
154
155
|
- features/task_condition.feature
|
155
156
|
- features/task_nested_tasks.feature
|
157
|
+
- features/task_target.feature
|
156
158
|
- features/test_dir.feature
|
157
159
|
- features/test_env.feature
|
158
160
|
- features/test_executable.feature
|
@@ -269,6 +271,7 @@ test_files:
|
|
269
271
|
- features/cli_usage.feature
|
270
272
|
- features/cli_verbose.feature
|
271
273
|
- features/condition_negated_test.feature
|
274
|
+
- features/condition_target.feature
|
272
275
|
- features/recipe_compose_macro.feature
|
273
276
|
- features/recipe_macro.feature
|
274
277
|
- features/recipe_source.feature
|
@@ -289,6 +292,7 @@ test_files:
|
|
289
292
|
- features/task_ask.feature
|
290
293
|
- features/task_condition.feature
|
291
294
|
- features/task_nested_tasks.feature
|
295
|
+
- features/task_target.feature
|
292
296
|
- features/test_dir.feature
|
293
297
|
- features/test_env.feature
|
294
298
|
- features/test_executable.feature
|