cape 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/.rspec +2 -0
  2. data/Gemfile +1 -1
  3. data/Guardfile +4 -1
  4. data/History.markdown +4 -0
  5. data/License.markdown +1 -1
  6. data/README.markdown +9 -4
  7. data/Rakefile +3 -3
  8. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace.feature +40 -0
  9. data/features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature +23 -53
  10. data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options.feature +39 -0
  11. data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature +6 -186
  12. data/features/dsl/mirror_rake_tasks/with_defined_task_argument.feature +11 -26
  13. data/features/dsl/mirror_rake_tasks/with_defined_task_argument_and_environment_variables.feature +43 -0
  14. data/features/dsl/mirror_rake_tasks/with_environment_variables.feature +29 -0
  15. data/features/dsl/mirror_rake_tasks/with_undefined_argument.feature +3 -17
  16. data/features/dsl/mirror_rake_tasks/with_valid_options_argument.feature +2 -67
  17. data/features/dsl/mirror_rake_tasks/with_valid_options_arguments_and_environment_variables.feature +26 -0
  18. data/features/dsl/mirror_rake_tasks/without_arguments.feature +5 -2
  19. data/lib/cape/capistrano.rb +9 -6
  20. data/lib/cape/core_ext/hash.rb +1 -0
  21. data/lib/cape/core_ext/symbol.rb +1 -0
  22. data/lib/cape/dsl.rb +29 -13
  23. data/lib/cape/hash_list.rb +80 -0
  24. data/lib/cape/rake.rb +12 -7
  25. data/lib/cape/util.rb +3 -1
  26. data/lib/cape/version.rb +1 -1
  27. data/spec/cape/capistrano_spec.rb +1 -0
  28. data/spec/cape/core_ext/hash_spec.rb +1 -0
  29. data/spec/cape/core_ext/symbol_spec.rb +1 -0
  30. data/spec/cape/dsl_spec.rb +1 -1
  31. data/spec/cape/hash_list_spec.rb +48 -0
  32. data/spec/cape/rake_spec.rb +5 -2
  33. data/spec/cape/util_spec.rb +1 -0
  34. data/spec/cape/version_spec.rb +1 -0
  35. data/spec/cape_spec.rb +1 -0
  36. data/spec/spec_helper.rb +18 -3
  37. metadata +92 -80
  38. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_namespace_argument.feature +0 -110
  39. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_task_argument.feature +0 -60
  40. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_undefined_argument.feature +0 -35
  41. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature +0 -290
@@ -1,110 +0,0 @@
1
- Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an argument of a defined namespace
2
-
3
- In order to include Rake tasks with descriptions in my Capistrano recipes,
4
- As a developer using Cape,
5
- I want to use the Cape DSL.
6
-
7
- Scenario: mirror only the Rake tasks in the matching namespace
8
- Given a full-featured Rakefile
9
- And a Capfile with:
10
- """
11
- namespace :ns do
12
- Cape do |cape|
13
- cape.mirror_rake_tasks 'my_namespace'
14
- end
15
- end
16
- """
17
- When I run `cap -vT`
18
- Then the output should not contain "cap ns:with_period"
19
- And the output should contain:
20
- """
21
- cap ns:my_namespace # A task that shadows a names...
22
- """
23
- And the output should contain:
24
- """
25
- cap ns:my_namespace:in_a_namespace # My task in a namespace.
26
- """
27
- And the output should contain:
28
- """
29
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
30
- """
31
-
32
- Scenario: do not mirror Rake task 'with_period'
33
- Given a full-featured Rakefile
34
- And a Capfile with:
35
- """
36
- namespace :ns do
37
- Cape do |cape|
38
- cape.mirror_rake_tasks :my_namespace
39
- end
40
- end
41
- """
42
- When I run `cap -e ns:with_period`
43
- Then the output should contain exactly:
44
- """
45
- The task `ns:with_period' does not exist.
46
-
47
- """
48
-
49
- Scenario: mirror Rake task 'my_namespace' with its description
50
- Given a full-featured Rakefile
51
- And a Capfile with:
52
- """
53
- namespace :ns do
54
- Cape do |cape|
55
- cape.mirror_rake_tasks :my_namespace
56
- end
57
- end
58
- """
59
- When I run `cap -e ns:my_namespace`
60
- Then the output should contain exactly:
61
- """
62
- ------------------------------------------------------------
63
- cap ns:my_namespace
64
- ------------------------------------------------------------
65
- A task that shadows a namespace.
66
-
67
-
68
- """
69
-
70
- Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
71
- Given a full-featured Rakefile
72
- And a Capfile with:
73
- """
74
- namespace :ns do
75
- Cape do |cape|
76
- cape.mirror_rake_tasks :my_namespace
77
- end
78
- end
79
- """
80
- When I run `cap -e ns:my_namespace:in_a_namespace`
81
- Then the output should contain exactly:
82
- """
83
- ------------------------------------------------------------
84
- cap ns:my_namespace:in_a_namespace
85
- ------------------------------------------------------------
86
- My task in a namespace.
87
-
88
-
89
- """
90
-
91
- Scenario: mirror Rake task 'my_namespace:my_nested_namespace:in_a_nested_namespace' with its description
92
- Given a full-featured Rakefile
93
- And a Capfile with:
94
- """
95
- namespace :ns do
96
- Cape do |cape|
97
- cape.mirror_rake_tasks :my_namespace
98
- end
99
- end
100
- """
101
- When I run `cap -e ns:my_namespace:my_nested_namespace:in_a_nested_namespace`
102
- Then the output should contain exactly:
103
- """
104
- ------------------------------------------------------------
105
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace
106
- ------------------------------------------------------------
107
- My task in a nested namespace.
108
-
109
-
110
- """
@@ -1,60 +0,0 @@
1
- Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an argument of a defined task
2
-
3
- In order to include Rake tasks with descriptions in my Capistrano recipes,
4
- As a developer using Cape,
5
- I want to use the Cape DSL.
6
-
7
- Scenario: mirror only the matching Rake task
8
- Given a full-featured Rakefile
9
- And a Capfile with:
10
- """
11
- namespace :ns do
12
- Cape do |cape|
13
- cape.mirror_rake_tasks 'with_period'
14
- end
15
- end
16
- """
17
- When I run `cap -vT`
18
- Then the output should contain:
19
- """
20
- cap ns:with_period # Ends with period.
21
- """
22
- And the output should not contain "cap ns:without_period"
23
-
24
- Scenario: mirror Rake task 'with_period' with its description
25
- Given a full-featured Rakefile
26
- And a Capfile with:
27
- """
28
- namespace :ns do
29
- Cape do |cape|
30
- cape.mirror_rake_tasks :with_period
31
- end
32
- end
33
- """
34
- When I run `cap -e ns:with_period`
35
- Then the output should contain exactly:
36
- """
37
- ------------------------------------------------------------
38
- cap ns:with_period
39
- ------------------------------------------------------------
40
- Ends with period.
41
-
42
-
43
- """
44
-
45
- Scenario: do not mirror Rake task 'without_period'
46
- Given a full-featured Rakefile
47
- And a Capfile with:
48
- """
49
- namespace :ns do
50
- Cape do |cape|
51
- cape.mirror_rake_tasks :with_period
52
- end
53
- end
54
- """
55
- When I run `cap -e ns:without_period`
56
- Then the output should contain exactly:
57
- """
58
- The task `ns:without_period' does not exist.
59
-
60
- """
@@ -1,35 +0,0 @@
1
- Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an undefined argument
2
-
3
- In order to include Rake tasks with descriptions in my Capistrano recipes,
4
- As a developer using Cape,
5
- I want to use the Cape DSL.
6
-
7
- Scenario: do not mirror any Rake tasks
8
- Given a full-featured Rakefile
9
- And a Capfile with:
10
- """
11
- namespace :ns do
12
- Cape do |cape|
13
- cape.mirror_rake_tasks 'this_does_not_exist'
14
- end
15
- end
16
- """
17
- When I run `cap -vT`
18
- Then the output should not contain "cap ns:with_period"
19
-
20
- Scenario: do not mirror Rake task 'with_period'
21
- Given a full-featured Rakefile
22
- And a Capfile with:
23
- """
24
- namespace :ns do
25
- Cape do |cape|
26
- cape.mirror_rake_tasks :this_does_not_exist
27
- end
28
- end
29
- """
30
- When I run `cap -e ns:with_period`
31
- Then the output should contain exactly:
32
- """
33
- The task `ns:with_period' does not exist.
34
-
35
- """
@@ -1,290 +0,0 @@
1
- Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, without arguments
2
-
3
- In order to include Rake tasks with descriptions in my Capistrano recipes,
4
- As a developer using Cape,
5
- I want to use the Cape DSL.
6
-
7
- Scenario: mirror all Rake tasks
8
- Given a full-featured Rakefile
9
- And a Capfile with:
10
- """
11
- namespace :ns do
12
- Cape do |cape|
13
- cape.mirror_rake_tasks
14
- end
15
- end
16
- """
17
- When I run `cap -vT`
18
- Then the output should contain:
19
- """
20
- cap ns:with_period # Ends with period.
21
- """
22
- And the output should contain:
23
- """
24
- cap ns:without_period # Ends without period.
25
- """
26
- And the output should contain:
27
- """
28
- cap ns:long # My long task -- it has a ve...
29
- """
30
- And the output should contain:
31
- """
32
- cap ns:with_one_arg # My task with one argument.
33
- """
34
- And the output should contain:
35
- """
36
- cap ns:my_namespace # A task that shadows a names...
37
- """
38
- And the output should contain:
39
- """
40
- cap ns:my_namespace:in_a_namespace # My task in a namespace.
41
- """
42
- And the output should contain:
43
- """
44
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
45
- """
46
- And the output should contain:
47
- """
48
- cap ns:with_two_args # My task with two arguments.
49
- """
50
- And the output should contain:
51
- """
52
- cap ns:with_three_args # My task with three arguments.
53
- """
54
-
55
- Scenario: mirror Rake task 'with_period' with its description
56
- Given a full-featured Rakefile
57
- And a Capfile with:
58
- """
59
- namespace :ns do
60
- Cape do |cape|
61
- cape.mirror_rake_tasks
62
- end
63
- end
64
- """
65
- When I run `cap -e ns:with_period`
66
- Then the output should contain exactly:
67
- """
68
- ------------------------------------------------------------
69
- cap ns:with_period
70
- ------------------------------------------------------------
71
- Ends with period.
72
-
73
-
74
- """
75
-
76
- Scenario: mirror Rake task 'with_period' with its implementation
77
- Given a full-featured Rakefile
78
- And a Capfile with:
79
- """
80
- set :current_path, '/path/to/current/deployed/application'
81
-
82
- namespace :ns do
83
- Cape do |cape|
84
- cape.mirror_rake_tasks
85
- end
86
- end
87
- """
88
- When I run `cap ns:with_period`
89
- Then the output should contain:
90
- """
91
- * executing `ns:with_period'
92
- * executing "cd /path/to/current/deployed/application && /usr/bin/env `/usr/bin/env bundle check >/dev/null 2>&1; case $? in 0|1 ) echo bundle exec ;; esac` rake with_period"
93
- """
94
-
95
- Scenario: mirror Rake task 'without_period' with its description
96
- Given a full-featured Rakefile
97
- And a Capfile with:
98
- """
99
- namespace :ns do
100
- Cape do |cape|
101
- cape.mirror_rake_tasks
102
- end
103
- end
104
- """
105
- When I run `cap -e ns:without_period`
106
- Then the output should contain exactly:
107
- """
108
- ------------------------------------------------------------
109
- cap ns:without_period
110
- ------------------------------------------------------------
111
- Ends without period.
112
-
113
-
114
- """
115
-
116
- Scenario: mirror Rake task 'long' with its description
117
- Given a full-featured Rakefile
118
- And a Capfile with:
119
- """
120
- namespace :ns do
121
- Cape do |cape|
122
- cape.mirror_rake_tasks
123
- end
124
- end
125
- """
126
- When I run `cap -e ns:long`
127
- Then the output should contain exactly:
128
- """
129
- ------------------------------------------------------------
130
- cap ns:long
131
- ------------------------------------------------------------
132
- My long task -- it has a very, very, very, very, very, very, very, very, very,
133
- very, very, very, very, very, very, very, very, very, very, very, very, very,
134
- very, very, very, very long description.
135
-
136
-
137
- """
138
-
139
- Scenario: mirror Rake task 'with_one_arg' with its description
140
- Given a full-featured Rakefile
141
- And a Capfile with:
142
- """
143
- namespace :ns do
144
- Cape do |cape|
145
- cape.mirror_rake_tasks
146
- end
147
- end
148
- """
149
- When I run `cap -e ns:with_one_arg`
150
- Then the output should contain exactly:
151
- """
152
- ------------------------------------------------------------
153
- cap ns:with_one_arg
154
- ------------------------------------------------------------
155
- My task with one argument.
156
-
157
- Set environment variable THE_ARG if you want to pass a Rake task argument.
158
-
159
-
160
- """
161
-
162
- Scenario: mirror Rake task 'my_namespace' with its description
163
- Given a full-featured Rakefile
164
- And a Capfile with:
165
- """
166
- namespace :ns do
167
- Cape do |cape|
168
- cape.mirror_rake_tasks
169
- end
170
- end
171
- """
172
- When I run `cap -e ns:my_namespace`
173
- Then the output should contain exactly:
174
- """
175
- ------------------------------------------------------------
176
- cap ns:my_namespace
177
- ------------------------------------------------------------
178
- A task that shadows a namespace.
179
-
180
-
181
- """
182
-
183
- Scenario: mirror Rake task 'my_namespace' with its implementation
184
- Given a full-featured Rakefile
185
- And a Capfile with:
186
- """
187
- set :current_path, '/path/to/current/deployed/application'
188
-
189
- namespace :ns do
190
- Cape do |cape|
191
- cape.mirror_rake_tasks
192
- end
193
- end
194
- """
195
- When I run `cap ns:my_namespace`
196
- Then the output should contain:
197
- """
198
- * executing `ns:my_namespace'
199
- * executing "cd /path/to/current/deployed/application && /usr/bin/env `/usr/bin/env bundle check >/dev/null 2>&1; case $? in 0|1 ) echo bundle exec ;; esac` rake my_namespace"
200
- """
201
-
202
- Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
203
- Given a full-featured Rakefile
204
- And a Capfile with:
205
- """
206
- namespace :ns do
207
- Cape do |cape|
208
- cape.mirror_rake_tasks
209
- end
210
- end
211
- """
212
- When I run `cap -e ns:my_namespace:in_a_namespace`
213
- Then the output should contain exactly:
214
- """
215
- ------------------------------------------------------------
216
- cap ns:my_namespace:in_a_namespace
217
- ------------------------------------------------------------
218
- My task in a namespace.
219
-
220
-
221
- """
222
-
223
- Scenario: mirror Rake task 'my_namespace:my_nested_namespace:in_a_nested_namespace' with its description
224
- Given a full-featured Rakefile
225
- And a Capfile with:
226
- """
227
- namespace :ns do
228
- Cape do |cape|
229
- cape.mirror_rake_tasks
230
- end
231
- end
232
- """
233
- When I run `cap -e ns:my_namespace:my_nested_namespace:in_a_nested_namespace`
234
- Then the output should contain exactly:
235
- """
236
- ------------------------------------------------------------
237
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace
238
- ------------------------------------------------------------
239
- My task in a nested namespace.
240
-
241
-
242
- """
243
-
244
- Scenario: mirror Rake task 'with_two_args' with its description
245
- Given a full-featured Rakefile
246
- And a Capfile with:
247
- """
248
- namespace :ns do
249
- Cape do |cape|
250
- cape.mirror_rake_tasks
251
- end
252
- end
253
- """
254
- When I run `cap -e ns:with_two_args`
255
- Then the output should contain exactly:
256
- """
257
- ------------------------------------------------------------
258
- cap ns:with_two_args
259
- ------------------------------------------------------------
260
- My task with two arguments.
261
-
262
- Set environment variables MY_ARG1 and MY_ARG2 if you want to pass Rake task
263
- arguments.
264
-
265
-
266
- """
267
-
268
- Scenario: mirror Rake task 'with_three_args' with its description
269
- Given a full-featured Rakefile
270
- And a Capfile with:
271
- """
272
- namespace :ns do
273
- Cape do |cape|
274
- cape.mirror_rake_tasks
275
- end
276
- end
277
- """
278
- When I run `cap -e ns:with_three_args`
279
- Then the output should contain exactly:
280
- """
281
- ------------------------------------------------------------
282
- cap ns:with_three_args
283
- ------------------------------------------------------------
284
- My task with three arguments.
285
-
286
- Set environment variables AN_ARG1, AN_ARG2, and AN_ARG3 if you want to pass Rake
287
- task arguments.
288
-
289
-
290
- """