cape 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/Gemfile +1 -1
- data/Guardfile +4 -1
- data/History.markdown +4 -0
- data/License.markdown +1 -1
- data/README.markdown +9 -4
- data/Rakefile +3 -3
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace.feature +40 -0
- data/features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature +23 -53
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options.feature +39 -0
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature +6 -186
- data/features/dsl/mirror_rake_tasks/with_defined_task_argument.feature +11 -26
- data/features/dsl/mirror_rake_tasks/with_defined_task_argument_and_environment_variables.feature +43 -0
- data/features/dsl/mirror_rake_tasks/with_environment_variables.feature +29 -0
- data/features/dsl/mirror_rake_tasks/with_undefined_argument.feature +3 -17
- data/features/dsl/mirror_rake_tasks/with_valid_options_argument.feature +2 -67
- data/features/dsl/mirror_rake_tasks/with_valid_options_arguments_and_environment_variables.feature +26 -0
- data/features/dsl/mirror_rake_tasks/without_arguments.feature +5 -2
- data/lib/cape/capistrano.rb +9 -6
- data/lib/cape/core_ext/hash.rb +1 -0
- data/lib/cape/core_ext/symbol.rb +1 -0
- data/lib/cape/dsl.rb +29 -13
- data/lib/cape/hash_list.rb +80 -0
- data/lib/cape/rake.rb +12 -7
- data/lib/cape/util.rb +3 -1
- data/lib/cape/version.rb +1 -1
- data/spec/cape/capistrano_spec.rb +1 -0
- data/spec/cape/core_ext/hash_spec.rb +1 -0
- data/spec/cape/core_ext/symbol_spec.rb +1 -0
- data/spec/cape/dsl_spec.rb +1 -1
- data/spec/cape/hash_list_spec.rb +48 -0
- data/spec/cape/rake_spec.rb +5 -2
- data/spec/cape/util_spec.rb +1 -0
- data/spec/cape/version_spec.rb +1 -0
- data/spec/cape_spec.rb +1 -0
- data/spec/spec_helper.rb +18 -3
- metadata +92 -80
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_namespace_argument.feature +0 -110
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_task_argument.feature +0 -60
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_undefined_argument.feature +0 -35
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature +0 -290
data/.rspec
ADDED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
guard :rspec, :cli => '--
|
1
|
+
guard :rspec, :cli => '--debugger' do
|
2
2
|
# Run the corresponding spec (or all specs) when code changes.
|
3
3
|
watch( %r{^lib/(.+)\.rb$} ) do |match|
|
4
4
|
corresponding_spec = "spec/#{match[1]}_spec.rb"
|
@@ -12,6 +12,9 @@ guard :rspec, :cli => '--color --debugger' do
|
|
12
12
|
# Run a spec when it changes.
|
13
13
|
watch %r{^spec/.+_spec\.rb$}
|
14
14
|
|
15
|
+
# Run all specs when the RSpec configuration changes.
|
16
|
+
watch( 'spec/spec_helper.rb' ) { 'spec' }
|
17
|
+
|
15
18
|
# Run all specs when the bundle changes.
|
16
19
|
watch( 'Gemfile.lock' ) { 'spec' }
|
17
20
|
end
|
data/History.markdown
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Version history for the _Cape_ project
|
2
2
|
|
3
|
+
## <a name="v1.6.1"></a>v1.6.1, Mon 2/18/2013
|
4
|
+
|
5
|
+
* Respect the specified order of environment variables in the remote command line
|
6
|
+
|
3
7
|
## <a name="v1.6.0"></a>v1.6.0, Wed 11/14/2012
|
4
8
|
|
5
9
|
* Enable mirroring and enumeration of hidden Rake tasks for versions of Rake that make it possible
|
data/License.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License
|
2
2
|
|
3
|
-
Source code for _Cape_ is Copyright © 2011–
|
3
|
+
Source code for _Cape_ is Copyright © 2011–2013 [Nils Jonsson](mailto:cape@nilsjonsson.com) and [contributors](http://github.com/njonsson/cape/contributors "Cape contributors at GitHub").
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
6
|
|
data/README.markdown
CHANGED
@@ -29,7 +29,12 @@
|
|
29
29
|
<hNNBNBh=(. / \ `
|
30
30
|
..
|
31
31
|
|
32
|
-
# [<img align="right" src="https://
|
32
|
+
# [<img align="right" src="https://badge.fury.io/rb/cape.png" title="RubyGems release" height="13" />][rubygems-release] [<img align="right" src="https://codeclimate.com/github/njonsson/cape.png" title="Code Climate report" height="13" />][code-climate-report] [<img align="right" src="https://gemnasium.com/njonsson/cape.png" title="Gemnasium build status" height="13" />][gemnasium-build-status] [<img align="right" src="https://secure.travis-ci.org/njonsson/cape.png?branch=master" title="Travis CI build status" height="13" />][travis-ci-build-status] Cape
|
33
|
+
|
34
|
+
[rubygems-release]: http://rubygems.org/gems/cape
|
35
|
+
[code-climate-report]: http://codeclimate.com/github/njonsson/cape
|
36
|
+
[gemnasium-build-status]: http://gemnasium.com/njonsson/cape
|
37
|
+
[travis-ci-build-status]: http://travis-ci.org/njonsson/cape
|
33
38
|
|
34
39
|
If
|
35
40
|
|
@@ -156,8 +161,8 @@ Cape lets you filter the Rake tasks to be mirrored. Note that Cape statements mu
|
|
156
161
|
require 'cape'
|
157
162
|
|
158
163
|
Cape do
|
159
|
-
# Create Capistrano recipes for the Rake task 'foo' and/or for the tasks in
|
160
|
-
# 'foo' namespace.
|
164
|
+
# Create Capistrano recipes for the Rake task 'foo' and/or for the tasks in
|
165
|
+
# the 'foo' namespace.
|
161
166
|
mirror_rake_tasks :foo
|
162
167
|
end
|
163
168
|
|
@@ -273,7 +278,7 @@ Note that Cape statements must be contained in a `Cape` block.
|
|
273
278
|
|
274
279
|
## Known issues
|
275
280
|
|
276
|
-
**A Rake task that lacks a description can be mirrored or enumerated only if Rake v0.9.3 or newer is installed.** Older versions of Rake did not support enumerating such tasks. You may want to make Rake v0.9.3 a dependency of your project
|
281
|
+
**A Rake task that lacks a description can be mirrored or enumerated only if Rake v0.9.3 or newer is installed.** Older versions of Rake did not support enumerating such tasks. You may want to make Rake v0.9.3 a dependency of your project.
|
277
282
|
|
278
283
|
# Gemfile
|
279
284
|
|
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ end
|
|
21
21
|
|
22
22
|
def define_spec_task(name, options={})
|
23
23
|
RSpec::Core::RakeTask.new name do |t|
|
24
|
-
t.rspec_opts
|
24
|
+
t.rspec_opts ||= []
|
25
25
|
unless options[:debug] == false
|
26
26
|
begin
|
27
27
|
require 'ruby-debug'
|
@@ -34,10 +34,10 @@ def define_spec_task(name, options={})
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
desc 'Run
|
37
|
+
desc 'Run specs'
|
38
38
|
define_spec_task :spec
|
39
39
|
|
40
|
-
desc 'Run
|
40
|
+
desc 'Run specs and test features'
|
41
41
|
task '' => [:spec, :features]
|
42
42
|
task :default => [:spec, :features]
|
43
43
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Feature: The #mirror_rake_tasks DSL method, inside a Capistrano 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 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
|
+
|
23
|
+
Scenario: mirror a Rake task with its implementation
|
24
|
+
Given a full-featured Rakefile
|
25
|
+
And a Capfile with:
|
26
|
+
"""
|
27
|
+
set :current_path, '/path/to/current/deployed/application'
|
28
|
+
|
29
|
+
namespace :ns do
|
30
|
+
Cape do |cape|
|
31
|
+
cape.mirror_rake_tasks
|
32
|
+
end
|
33
|
+
end
|
34
|
+
"""
|
35
|
+
When I run `cap ns:with_period`
|
36
|
+
Then the output should contain:
|
37
|
+
"""
|
38
|
+
* executing `ns:with_period'
|
39
|
+
* 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"
|
40
|
+
"""
|
@@ -9,11 +9,14 @@ Feature: The #mirror_rake_tasks DSL method with an argument of a defined namespa
|
|
9
9
|
And a Capfile with:
|
10
10
|
"""
|
11
11
|
Cape do
|
12
|
-
mirror_rake_tasks
|
12
|
+
mirror_rake_tasks :my_namespace
|
13
13
|
end
|
14
14
|
"""
|
15
15
|
When I run `cap -vT`
|
16
|
-
Then the output should
|
16
|
+
Then the output should contain:
|
17
|
+
"""
|
18
|
+
cap my_namespace # A task that shadows a names...
|
19
|
+
"""
|
17
20
|
And the output should contain:
|
18
21
|
"""
|
19
22
|
cap my_namespace:in_a_namespace # My task in a namespace.
|
@@ -22,75 +25,42 @@ Feature: The #mirror_rake_tasks DSL method with an argument of a defined namespa
|
|
22
25
|
"""
|
23
26
|
cap my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
|
24
27
|
"""
|
28
|
+
And the output should not contain "cap with_period"
|
25
29
|
|
26
|
-
Scenario:
|
30
|
+
Scenario: mirror a Rake task that shadows the matching namespace with its implementation
|
27
31
|
Given a full-featured Rakefile
|
28
32
|
And a Capfile with:
|
29
33
|
"""
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
"""
|
34
|
-
When I run `cap -e with_period`
|
35
|
-
Then the output should contain exactly:
|
36
|
-
"""
|
37
|
-
The task `with_period' does not exist.
|
38
|
-
|
39
|
-
"""
|
34
|
+
set :current_path, '/path/to/current/deployed/application'
|
35
|
+
set :rails_env, 'production'
|
40
36
|
|
41
|
-
Scenario: mirror Rake task 'my_namespace' with its description
|
42
|
-
Given a full-featured Rakefile
|
43
|
-
And a Capfile with:
|
44
|
-
"""
|
45
37
|
Cape do
|
46
|
-
mirror_rake_tasks
|
38
|
+
mirror_rake_tasks 'my_namespace'
|
47
39
|
end
|
48
40
|
"""
|
49
|
-
|
50
|
-
Then the output should contain
|
41
|
+
When I run `cap my_namespace`
|
42
|
+
Then the output should contain:
|
51
43
|
"""
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
A task that shadows a namespace.
|
56
|
-
|
57
|
-
|
44
|
+
* executing `my_namespace'
|
45
|
+
* 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"
|
46
|
+
`my_namespace' is only run for servers matching {}, but no servers matched
|
58
47
|
"""
|
59
48
|
|
60
|
-
Scenario: mirror Rake task
|
49
|
+
Scenario: mirror a Rake task in the matching namespace with its implementation
|
61
50
|
Given a full-featured Rakefile
|
62
51
|
And a Capfile with:
|
63
52
|
"""
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
"""
|
68
|
-
When I run `cap -e my_namespace:in_a_namespace`
|
69
|
-
Then the output should contain exactly:
|
70
|
-
"""
|
71
|
-
------------------------------------------------------------
|
72
|
-
cap my_namespace:in_a_namespace
|
73
|
-
------------------------------------------------------------
|
74
|
-
My task in a namespace.
|
75
|
-
|
53
|
+
set :current_path, '/path/to/current/deployed/application'
|
54
|
+
set :rails_env, 'production'
|
76
55
|
|
77
|
-
"""
|
78
|
-
|
79
|
-
Scenario: mirror Rake task 'my_namespace:my_nested_namespace:in_a_nested_namespace' with its description
|
80
|
-
Given a full-featured Rakefile
|
81
|
-
And a Capfile with:
|
82
|
-
"""
|
83
56
|
Cape do
|
84
57
|
mirror_rake_tasks :my_namespace
|
85
58
|
end
|
86
59
|
"""
|
87
|
-
|
88
|
-
Then the output should contain
|
60
|
+
When I run `cap my_namespace:my_nested_namespace:in_a_nested_namespace`
|
61
|
+
Then the output should contain:
|
89
62
|
"""
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
My task in a nested namespace.
|
94
|
-
|
95
|
-
|
63
|
+
* executing `my_namespace:my_nested_namespace:in_a_nested_namespace'
|
64
|
+
* 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:my_nested_namespace:in_a_nested_namespace"
|
65
|
+
`my_namespace:my_nested_namespace:in_a_nested_namespace' is only run for servers matching {}, but no servers matched
|
96
66
|
"""
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and valid options, and with environment variables
|
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
|
+
Cape do
|
12
|
+
mirror_rake_tasks :with_period, :roles => :app
|
13
|
+
end
|
14
|
+
"""
|
15
|
+
When I run `cap -vT`
|
16
|
+
Then the output should contain:
|
17
|
+
"""
|
18
|
+
cap with_period # Ends with period.
|
19
|
+
"""
|
20
|
+
And the output should not contain "without_period"
|
21
|
+
|
22
|
+
Scenario: mirror the matching Rake task with its implementation
|
23
|
+
Given a full-featured Rakefile
|
24
|
+
And a Capfile with:
|
25
|
+
"""
|
26
|
+
set :current_path, '/path/to/current/deployed/application'
|
27
|
+
set :rails_env, 'production'
|
28
|
+
|
29
|
+
Cape do
|
30
|
+
mirror_rake_tasks 'with_period', :roles => :app
|
31
|
+
end
|
32
|
+
"""
|
33
|
+
When I run `cap with_period`
|
34
|
+
Then the output should contain:
|
35
|
+
"""
|
36
|
+
* executing `with_period'
|
37
|
+
* 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"
|
38
|
+
`with_period' is only run for servers matching {:roles=>:app}, but no servers matched
|
39
|
+
"""
|
@@ -4,12 +4,12 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
|
|
4
4
|
As a developer using Cape,
|
5
5
|
I want to use the Cape DSL.
|
6
6
|
|
7
|
-
Scenario: mirror
|
7
|
+
Scenario: mirror only the matching Rake task
|
8
8
|
Given a full-featured Rakefile
|
9
9
|
And a Capfile with:
|
10
10
|
"""
|
11
11
|
Cape do
|
12
|
-
mirror_rake_tasks :roles => :app do |env|
|
12
|
+
mirror_rake_tasks :with_period, :roles => :app do |env|
|
13
13
|
env['RAILS_ENV'] = rails_env
|
14
14
|
end
|
15
15
|
end
|
@@ -17,63 +17,11 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
|
|
17
17
|
When I run `cap -vT`
|
18
18
|
Then the output should contain:
|
19
19
|
"""
|
20
|
-
cap with_period
|
21
|
-
"""
|
22
|
-
And the output should contain:
|
23
|
-
"""
|
24
|
-
cap without_period # Ends without period.
|
25
|
-
"""
|
26
|
-
And the output should contain:
|
27
|
-
"""
|
28
|
-
cap long # My long task -- it has a ve...
|
29
|
-
"""
|
30
|
-
And the output should contain:
|
31
|
-
"""
|
32
|
-
cap with_one_arg # My task with one argument.
|
33
|
-
"""
|
34
|
-
And the output should contain:
|
35
|
-
"""
|
36
|
-
cap my_namespace # A task that shadows a names...
|
37
|
-
"""
|
38
|
-
And the output should contain:
|
39
|
-
"""
|
40
|
-
cap my_namespace:in_a_namespace # My task in a namespace.
|
41
|
-
"""
|
42
|
-
And the output should contain:
|
43
|
-
"""
|
44
|
-
cap 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 with_two_args # My task with two arguments.
|
49
|
-
"""
|
50
|
-
And the output should contain:
|
51
|
-
"""
|
52
|
-
cap with_three_args # My task with three arguments.
|
20
|
+
cap with_period # Ends with period.
|
53
21
|
"""
|
22
|
+
And the output should not contain "without_period"
|
54
23
|
|
55
|
-
Scenario: mirror Rake task
|
56
|
-
Given a full-featured Rakefile
|
57
|
-
And a Capfile with:
|
58
|
-
"""
|
59
|
-
Cape do
|
60
|
-
mirror_rake_tasks :roles => :app do |env|
|
61
|
-
env['RAILS_ENV'] = rails_env
|
62
|
-
end
|
63
|
-
end
|
64
|
-
"""
|
65
|
-
When I run `cap -e with_period`
|
66
|
-
Then the output should contain exactly:
|
67
|
-
"""
|
68
|
-
------------------------------------------------------------
|
69
|
-
cap with_period
|
70
|
-
------------------------------------------------------------
|
71
|
-
Ends with period.
|
72
|
-
|
73
|
-
|
74
|
-
"""
|
75
|
-
|
76
|
-
Scenario: mirror Rake task 'with_period' with its implementation
|
24
|
+
Scenario: mirror the matching Rake task with its implementation
|
77
25
|
Given a full-featured Rakefile
|
78
26
|
And a Capfile with:
|
79
27
|
"""
|
@@ -81,7 +29,7 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
|
|
81
29
|
set :rails_env, 'production'
|
82
30
|
|
83
31
|
Cape do
|
84
|
-
mirror_rake_tasks :roles => :app do |env|
|
32
|
+
mirror_rake_tasks 'with_period', :roles => :app do |env|
|
85
33
|
env['RAILS_ENV'] = rails_env
|
86
34
|
end
|
87
35
|
end
|
@@ -93,131 +41,3 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
|
|
93
41
|
* 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 RAILS_ENV=\"production\""
|
94
42
|
`with_period' is only run for servers matching {:roles=>:app}, but no servers matched
|
95
43
|
"""
|
96
|
-
|
97
|
-
Scenario: mirror Rake task 'with_period' with its implementation, ignoring nil environment variable names
|
98
|
-
Given a full-featured Rakefile
|
99
|
-
And a Capfile with:
|
100
|
-
"""
|
101
|
-
set :current_path, '/path/to/current/deployed/application'
|
102
|
-
set :rails_env, 'production'
|
103
|
-
|
104
|
-
Cape do
|
105
|
-
mirror_rake_tasks :roles => :app do |env|
|
106
|
-
env[nil] = 'foo'
|
107
|
-
end
|
108
|
-
end
|
109
|
-
"""
|
110
|
-
When I run `cap with_period`
|
111
|
-
Then the output should contain:
|
112
|
-
"""
|
113
|
-
* executing `with_period'
|
114
|
-
* 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"
|
115
|
-
`with_period' is only run for servers matching {:roles=>:app}, but no servers matched
|
116
|
-
"""
|
117
|
-
|
118
|
-
Scenario: mirror Rake task 'with_period' with its implementation, ignoring nil environment variable values
|
119
|
-
Given a full-featured Rakefile
|
120
|
-
And a Capfile with:
|
121
|
-
"""
|
122
|
-
set :current_path, '/path/to/current/deployed/application'
|
123
|
-
set :rails_env, 'production'
|
124
|
-
|
125
|
-
Cape do
|
126
|
-
mirror_rake_tasks :roles => :app do |env|
|
127
|
-
env['FOO'] = nil
|
128
|
-
end
|
129
|
-
end
|
130
|
-
"""
|
131
|
-
When I run `cap with_period`
|
132
|
-
Then the output should contain:
|
133
|
-
"""
|
134
|
-
* executing `with_period'
|
135
|
-
* 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"
|
136
|
-
`with_period' is only run for servers matching {:roles=>:app}, but no servers matched
|
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
|
-
Cape do
|
144
|
-
mirror_rake_tasks :roles => :app do |env|
|
145
|
-
env['RAILS_ENV'] = rails_env
|
146
|
-
end
|
147
|
-
end
|
148
|
-
"""
|
149
|
-
When I run `cap -e with_one_arg`
|
150
|
-
Then the output should contain exactly:
|
151
|
-
"""
|
152
|
-
------------------------------------------------------------
|
153
|
-
cap 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:in_a_namespace' with its description
|
163
|
-
Given a full-featured Rakefile
|
164
|
-
And a Capfile with:
|
165
|
-
"""
|
166
|
-
Cape do
|
167
|
-
mirror_rake_tasks :roles => :app do |env|
|
168
|
-
env['RAILS_ENV'] = rails_env
|
169
|
-
end
|
170
|
-
end
|
171
|
-
"""
|
172
|
-
When I run `cap -e my_namespace:in_a_namespace`
|
173
|
-
Then the output should contain exactly:
|
174
|
-
"""
|
175
|
-
------------------------------------------------------------
|
176
|
-
cap my_namespace:in_a_namespace
|
177
|
-
------------------------------------------------------------
|
178
|
-
My task in a namespace.
|
179
|
-
|
180
|
-
|
181
|
-
"""
|
182
|
-
|
183
|
-
Scenario: mirror Rake task 'with_three_args' 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
|
-
set :rails_env, 'production'
|
189
|
-
|
190
|
-
Cape do
|
191
|
-
mirror_rake_tasks :roles => :app do |env|
|
192
|
-
env['RAILS_ENV'] = rails_env
|
193
|
-
end
|
194
|
-
end
|
195
|
-
"""
|
196
|
-
When I run `cap with_three_args AN_ARG1="a value for an_arg1" AN_ARG2="a value for an_arg2" AN_ARG3="a value for an_arg3"`
|
197
|
-
Then the output should contain:
|
198
|
-
"""
|
199
|
-
* executing `with_three_args'
|
200
|
-
* 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_three_args[\"a value for an_arg1\",\"a value for an_arg2\",\"a value for an_arg3\"] RAILS_ENV=\"production\""
|
201
|
-
`with_three_args' is only run for servers matching {:roles=>:app}, but no servers matched
|
202
|
-
"""
|
203
|
-
|
204
|
-
Scenario: mirror Rake task 'with_three_args' with its implementation not enforcing arguments
|
205
|
-
Given a full-featured Rakefile
|
206
|
-
And a Capfile with:
|
207
|
-
"""
|
208
|
-
set :current_path, '/path/to/current/deployed/application'
|
209
|
-
set :rails_env, 'production'
|
210
|
-
|
211
|
-
Cape do
|
212
|
-
mirror_rake_tasks :roles => :app do |env|
|
213
|
-
env['RAILS_ENV'] = rails_env
|
214
|
-
end
|
215
|
-
end
|
216
|
-
"""
|
217
|
-
When I run `cap with_three_args AN_ARG2="a value for an_arg2"`
|
218
|
-
Then the output should contain:
|
219
|
-
"""
|
220
|
-
* executing `with_three_args'
|
221
|
-
* 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_three_args[,\"a value for an_arg2\",] RAILS_ENV=\"production\""
|
222
|
-
`with_three_args' is only run for servers matching {:roles=>:app}, but no servers matched
|
223
|
-
"""
|