cape 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -1
- data/.rspec +1 -1
- data/.travis.yml +6 -2
- data/Appraisals +11 -0
- data/Gemfile +4 -4
- data/Guardfile +10 -4
- data/History.markdown +6 -0
- data/README.markdown +32 -17
- data/Rakefile +33 -13
- data/cape.gemspec +6 -2
- data/features/dsl/each_rake_task/unqualified.feature +0 -6
- data/features/dsl/each_rake_task/with_defined_namespace.feature +1 -1
- data/features/dsl/each_rake_task/with_defined_task.feature +4 -4
- data/features/dsl/each_rake_task/with_undefined_task_or_namespace.feature +2 -2
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace.feature +3 -4
- data/features/dsl/mirror_rake_tasks/unqualified.feature +89 -32
- data/features/dsl/mirror_rake_tasks/with_cd.feature +18 -12
- data/features/dsl/mirror_rake_tasks/with_cd_and_environment_variables.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_defined_namespace.feature +7 -3
- data/features/dsl/mirror_rake_tasks/with_defined_task.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_cd.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_cd_and_environment_variables.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_environment_variables.feature +21 -17
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_cd.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_cd_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_cd.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_cd_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options.feature +22 -18
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_cd.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_cd_and_environment_variables.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_environment_variables.feature +22 -18
- data/features/dsl/mirror_rake_tasks/with_environment_variables.feature +14 -10
- data/features/dsl/mirror_rake_tasks/with_rename.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_cd.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_cd_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_cd.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_cd_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_undefined_task_or_namespace.feature +2 -2
- data/features/dsl/mirror_rake_tasks/with_valid_options.feature +12 -8
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_cd.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_cd_and_environment_variables.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_environment_variables.feature +14 -10
- data/features/dsl/rake_executable.feature +1 -6
- data/features/step_definitions.rb +0 -12
- data/gemfiles/capistrano_v2.x.gemfile +7 -0
- data/gemfiles/capistrano_v2.x.gemfile.lock +66 -0
- data/gemfiles/rake_v0.9.3.gemfile +7 -0
- data/gemfiles/rake_v0.9.3.gemfile.lock +66 -0
- data/gemfiles/rake_v10.x.gemfile +7 -0
- data/gemfiles/rake_v10.x.gemfile.lock +66 -0
- data/lib/cape/capistrano.rb +39 -29
- data/lib/cape/version.rb +1 -1
- data/lib/cape/xterm.rb +1 -1
- data/spec/cape/capistrano_spec.rb +13 -3
- data/spec/cape/core_ext/hash_spec.rb +5 -5
- data/spec/cape/core_ext/symbol_spec.rb +10 -8
- data/spec/cape/deprecation/base_sharedspec.rb +6 -2
- data/spec/cape/deprecation/capistrano_deprecated_define_rake_wrapper_spec.rb +123 -101
- data/spec/cape/deprecation/dsl_deprecated_mirror_rake_tasks_spec.rb +119 -97
- data/spec/cape/dsl_deprecated_spec.rb +128 -134
- data/spec/cape/dsl_spec.rb +56 -63
- data/spec/cape/hash_list_spec.rb +40 -20
- data/spec/cape/rake_spec.rb +59 -51
- data/spec/cape/recipe_definition_spec.rb +44 -32
- data/spec/cape/util_spec.rb +18 -18
- data/spec/cape/version_spec.rb +1 -1
- data/spec/cape/xterm_spec.rb +33 -33
- data/spec/cape_spec.rb +9 -7
- data/spec/spec_helper.rb +5 -1
- metadata +100 -86
@@ -15,13 +15,15 @@ Feature: The #mirror_rake_tasks DSL method with valid options
|
|
15
15
|
mirror_rake_tasks :roles => :app
|
16
16
|
end
|
17
17
|
"""
|
18
|
-
When I run `cap
|
18
|
+
When I run `cap long`
|
19
19
|
Then the output should contain:
|
20
20
|
"""
|
21
21
|
*** DEPRECATED: `mirror_rake_tasks :roles => :app`. Use this instead: `mirror_rake_tasks { |recipes| recipes.options[:roles] = :app }`
|
22
|
-
* executing `
|
23
|
-
|
24
|
-
|
22
|
+
* executing `long'
|
23
|
+
"""
|
24
|
+
And the output should contain:
|
25
|
+
"""
|
26
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
25
27
|
"""
|
26
28
|
|
27
29
|
Scenario: mirror a Rake task with its implementation
|
@@ -36,11 +38,13 @@ Feature: The #mirror_rake_tasks DSL method with valid options
|
|
36
38
|
end
|
37
39
|
end
|
38
40
|
"""
|
39
|
-
When I run `cap
|
41
|
+
When I run `cap long`
|
40
42
|
Then the output should contain:
|
41
43
|
"""
|
42
|
-
* executing `
|
43
|
-
|
44
|
-
|
44
|
+
* executing `long'
|
45
|
+
"""
|
46
|
+
And the output should contain:
|
47
|
+
"""
|
48
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
45
49
|
"""
|
46
50
|
And the output should not contain "DEPRECATED"
|
@@ -17,10 +17,12 @@ Feature: The #mirror_rake_tasks DSL method with valid options and a different di
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
"""
|
20
|
-
When I run `cap
|
20
|
+
When I run `cap long`
|
21
21
|
Then the output should contain:
|
22
22
|
"""
|
23
|
-
* executing `
|
24
|
-
|
25
|
-
|
23
|
+
* executing `long'
|
24
|
+
"""
|
25
|
+
And the output should contain:
|
26
|
+
"""
|
27
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
26
28
|
"""
|
data/features/dsl/mirror_rake_tasks/with_valid_options_and_cd_and_environment_variables.feature
CHANGED
@@ -19,10 +19,12 @@ Feature: The #mirror_rake_tasks DSL method with valid options, a different direc
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
"""
|
22
|
-
When I run `cap
|
22
|
+
When I run `cap long`
|
23
23
|
Then the output should contain:
|
24
24
|
"""
|
25
|
-
* executing `
|
26
|
-
|
27
|
-
|
25
|
+
* executing `long'
|
26
|
+
"""
|
27
|
+
And the output should contain:
|
28
|
+
"""
|
29
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
28
30
|
"""
|
@@ -5,7 +5,7 @@ Feature: The #mirror_rake_tasks DSL method with valid options and environment va
|
|
5
5
|
I want to use the Cape DSL.
|
6
6
|
|
7
7
|
@deprecated
|
8
|
-
Scenario: mirror
|
8
|
+
Scenario: mirror a Rake task with its implementation (deprecated)
|
9
9
|
Given a full-featured Rakefile
|
10
10
|
And a Capfile with:
|
11
11
|
"""
|
@@ -18,16 +18,18 @@ Feature: The #mirror_rake_tasks DSL method with valid options and environment va
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
"""
|
21
|
-
When I run `cap
|
21
|
+
When I run `cap long`
|
22
22
|
Then the output should contain:
|
23
23
|
"""
|
24
24
|
*** DEPRECATED: `mirror_rake_tasks(:roles => :app) { |env| env["RAILS_ENV"] = "rails-env" }`. Use this instead: `mirror_rake_tasks { |recipes| recipes.options[:roles] = :app; recipes.env["RAILS_ENV"] = "rails-env" }`
|
25
|
-
* executing `
|
26
|
-
|
27
|
-
|
25
|
+
* executing `long'
|
26
|
+
"""
|
27
|
+
And the output should contain:
|
28
|
+
"""
|
29
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
28
30
|
"""
|
29
31
|
|
30
|
-
Scenario: mirror
|
32
|
+
Scenario: mirror a Rake task with its implementation
|
31
33
|
Given a full-featured Rakefile
|
32
34
|
And a Capfile with:
|
33
35
|
"""
|
@@ -41,11 +43,13 @@ Feature: The #mirror_rake_tasks DSL method with valid options and environment va
|
|
41
43
|
end
|
42
44
|
end
|
43
45
|
"""
|
44
|
-
When I run `cap
|
46
|
+
When I run `cap long`
|
45
47
|
Then the output should contain:
|
46
48
|
"""
|
47
|
-
* executing `
|
48
|
-
|
49
|
-
|
49
|
+
* executing `long'
|
50
|
+
"""
|
51
|
+
And the output should contain:
|
52
|
+
"""
|
53
|
+
`long' is only run for servers matching {:roles=>:app}, but no servers matched
|
50
54
|
"""
|
51
55
|
And the output should not contain "DEPRECATED"
|
@@ -54,7 +54,7 @@ Feature: The #local_rake_executable and #remote_rake_executable DSL attributes
|
|
54
54
|
mirror_rake_tasks
|
55
55
|
end
|
56
56
|
"""
|
57
|
-
When I run `cap
|
57
|
+
When I run `cap long`
|
58
58
|
Then the output should contain:
|
59
59
|
"""
|
60
60
|
We changed the remote Rake executable to "echo \"This comes from overridden Rake\" #"
|
@@ -63,8 +63,3 @@ Feature: The #local_rake_executable and #remote_rake_executable DSL attributes
|
|
63
63
|
"""
|
64
64
|
We left the local Rake executable as "/usr/bin/env `/usr/bin/env bundle check >/dev/null 2>&1; case $? in 0|1 ) echo bundle exec ;; esac` rake"
|
65
65
|
"""
|
66
|
-
And the output should contain:
|
67
|
-
"""
|
68
|
-
* executing `with_period'
|
69
|
-
* executing "cd /current/path && echo \"This comes from overridden Rake\" # with_period"
|
70
|
-
"""
|
@@ -9,12 +9,6 @@ end
|
|
9
9
|
|
10
10
|
Given 'a full-featured Rakefile' do
|
11
11
|
step 'a file named "Rakefile" with:', <<-end_step
|
12
|
-
desc 'Ends with period.'
|
13
|
-
task :with_period
|
14
|
-
|
15
|
-
desc 'Ends without period'
|
16
|
-
task :without_period
|
17
|
-
|
18
12
|
desc 'My long task -- it has a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long description'
|
19
13
|
task :long
|
20
14
|
|
@@ -49,12 +43,6 @@ Given 'a full-featured Rakefile defining a Ruby-method-shadowing task' do
|
|
49
43
|
desc 'A task that shadows a Ruby method'
|
50
44
|
task :load
|
51
45
|
|
52
|
-
desc 'Ends with period.'
|
53
|
-
task :with_period
|
54
|
-
|
55
|
-
desc 'Ends without period'
|
56
|
-
task :without_period
|
57
|
-
|
58
46
|
desc 'My long task -- it has a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long description'
|
59
47
|
task :long
|
60
48
|
|
@@ -0,0 +1,66 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/nils/Sources/personal/cape
|
3
|
+
specs:
|
4
|
+
cape (1.7.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
appraisal (0.5.2)
|
10
|
+
bundler
|
11
|
+
rake
|
12
|
+
aruba (0.5.3)
|
13
|
+
childprocess (>= 0.3.6)
|
14
|
+
cucumber (>= 1.1.1)
|
15
|
+
rspec-expectations (>= 2.7.0)
|
16
|
+
builder (3.2.2)
|
17
|
+
capistrano (2.15.5)
|
18
|
+
highline
|
19
|
+
net-scp (>= 1.0.0)
|
20
|
+
net-sftp (>= 2.0.0)
|
21
|
+
net-ssh (>= 2.0.14)
|
22
|
+
net-ssh-gateway (>= 1.1.0)
|
23
|
+
childprocess (0.3.9)
|
24
|
+
ffi (~> 1.0, >= 1.0.11)
|
25
|
+
cucumber (1.3.10)
|
26
|
+
builder (>= 2.1.2)
|
27
|
+
diff-lcs (>= 1.1.3)
|
28
|
+
gherkin (~> 2.12)
|
29
|
+
multi_json (>= 1.7.5, < 2.0)
|
30
|
+
multi_test (>= 0.0.2)
|
31
|
+
diff-lcs (1.2.5)
|
32
|
+
ffi (1.9.3)
|
33
|
+
gherkin (2.12.2)
|
34
|
+
multi_json (~> 1.3)
|
35
|
+
highline (1.6.20)
|
36
|
+
json_pure (1.8.1)
|
37
|
+
multi_json (1.8.2)
|
38
|
+
multi_test (0.0.2)
|
39
|
+
net-scp (1.1.2)
|
40
|
+
net-ssh (>= 2.6.5)
|
41
|
+
net-sftp (2.1.2)
|
42
|
+
net-ssh (>= 2.6.5)
|
43
|
+
net-ssh (2.7.0)
|
44
|
+
net-ssh-gateway (1.2.0)
|
45
|
+
net-ssh (>= 2.6.5)
|
46
|
+
rake (10.1.0)
|
47
|
+
rspec (2.14.1)
|
48
|
+
rspec-core (~> 2.14.0)
|
49
|
+
rspec-expectations (~> 2.14.0)
|
50
|
+
rspec-mocks (~> 2.14.0)
|
51
|
+
rspec-core (2.14.7)
|
52
|
+
rspec-expectations (2.14.4)
|
53
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
54
|
+
rspec-mocks (2.14.4)
|
55
|
+
|
56
|
+
PLATFORMS
|
57
|
+
ruby
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
appraisal (~> 0)
|
61
|
+
aruba (~> 0)
|
62
|
+
cape!
|
63
|
+
capistrano (~> 2)
|
64
|
+
json_pure
|
65
|
+
rake (>= 0.9.3)
|
66
|
+
rspec (~> 2)
|
@@ -0,0 +1,66 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/nils/Sources/personal/cape
|
3
|
+
specs:
|
4
|
+
cape (1.7.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
appraisal (0.5.2)
|
10
|
+
bundler
|
11
|
+
rake
|
12
|
+
aruba (0.5.3)
|
13
|
+
childprocess (>= 0.3.6)
|
14
|
+
cucumber (>= 1.1.1)
|
15
|
+
rspec-expectations (>= 2.7.0)
|
16
|
+
builder (3.2.2)
|
17
|
+
capistrano (2.15.5)
|
18
|
+
highline
|
19
|
+
net-scp (>= 1.0.0)
|
20
|
+
net-sftp (>= 2.0.0)
|
21
|
+
net-ssh (>= 2.0.14)
|
22
|
+
net-ssh-gateway (>= 1.1.0)
|
23
|
+
childprocess (0.3.9)
|
24
|
+
ffi (~> 1.0, >= 1.0.11)
|
25
|
+
cucumber (1.3.10)
|
26
|
+
builder (>= 2.1.2)
|
27
|
+
diff-lcs (>= 1.1.3)
|
28
|
+
gherkin (~> 2.12)
|
29
|
+
multi_json (>= 1.7.5, < 2.0)
|
30
|
+
multi_test (>= 0.0.2)
|
31
|
+
diff-lcs (1.2.5)
|
32
|
+
ffi (1.9.3)
|
33
|
+
gherkin (2.12.2)
|
34
|
+
multi_json (~> 1.3)
|
35
|
+
highline (1.6.20)
|
36
|
+
json_pure (1.8.1)
|
37
|
+
multi_json (1.8.2)
|
38
|
+
multi_test (0.0.2)
|
39
|
+
net-scp (1.1.2)
|
40
|
+
net-ssh (>= 2.6.5)
|
41
|
+
net-sftp (2.1.2)
|
42
|
+
net-ssh (>= 2.6.5)
|
43
|
+
net-ssh (2.7.0)
|
44
|
+
net-ssh-gateway (1.2.0)
|
45
|
+
net-ssh (>= 2.6.5)
|
46
|
+
rake (0.9.3)
|
47
|
+
rspec (2.14.1)
|
48
|
+
rspec-core (~> 2.14.0)
|
49
|
+
rspec-expectations (~> 2.14.0)
|
50
|
+
rspec-mocks (~> 2.14.0)
|
51
|
+
rspec-core (2.14.7)
|
52
|
+
rspec-expectations (2.14.4)
|
53
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
54
|
+
rspec-mocks (2.14.4)
|
55
|
+
|
56
|
+
PLATFORMS
|
57
|
+
ruby
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
appraisal (~> 0)
|
61
|
+
aruba (~> 0)
|
62
|
+
cape!
|
63
|
+
capistrano (~> 2)
|
64
|
+
json_pure
|
65
|
+
rake (= 0.9.3)
|
66
|
+
rspec (~> 2)
|
@@ -0,0 +1,66 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/nils/Sources/personal/cape
|
3
|
+
specs:
|
4
|
+
cape (1.7.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
appraisal (0.5.2)
|
10
|
+
bundler
|
11
|
+
rake
|
12
|
+
aruba (0.5.3)
|
13
|
+
childprocess (>= 0.3.6)
|
14
|
+
cucumber (>= 1.1.1)
|
15
|
+
rspec-expectations (>= 2.7.0)
|
16
|
+
builder (3.2.2)
|
17
|
+
capistrano (2.15.5)
|
18
|
+
highline
|
19
|
+
net-scp (>= 1.0.0)
|
20
|
+
net-sftp (>= 2.0.0)
|
21
|
+
net-ssh (>= 2.0.14)
|
22
|
+
net-ssh-gateway (>= 1.1.0)
|
23
|
+
childprocess (0.3.9)
|
24
|
+
ffi (~> 1.0, >= 1.0.11)
|
25
|
+
cucumber (1.3.10)
|
26
|
+
builder (>= 2.1.2)
|
27
|
+
diff-lcs (>= 1.1.3)
|
28
|
+
gherkin (~> 2.12)
|
29
|
+
multi_json (>= 1.7.5, < 2.0)
|
30
|
+
multi_test (>= 0.0.2)
|
31
|
+
diff-lcs (1.2.5)
|
32
|
+
ffi (1.9.3)
|
33
|
+
gherkin (2.12.2)
|
34
|
+
multi_json (~> 1.3)
|
35
|
+
highline (1.6.20)
|
36
|
+
json_pure (1.8.1)
|
37
|
+
multi_json (1.8.2)
|
38
|
+
multi_test (0.0.2)
|
39
|
+
net-scp (1.1.2)
|
40
|
+
net-ssh (>= 2.6.5)
|
41
|
+
net-sftp (2.1.2)
|
42
|
+
net-ssh (>= 2.6.5)
|
43
|
+
net-ssh (2.7.0)
|
44
|
+
net-ssh-gateway (1.2.0)
|
45
|
+
net-ssh (>= 2.6.5)
|
46
|
+
rake (10.1.0)
|
47
|
+
rspec (2.14.1)
|
48
|
+
rspec-core (~> 2.14.0)
|
49
|
+
rspec-expectations (~> 2.14.0)
|
50
|
+
rspec-mocks (~> 2.14.0)
|
51
|
+
rspec-core (2.14.7)
|
52
|
+
rspec-expectations (2.14.4)
|
53
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
54
|
+
rspec-mocks (2.14.4)
|
55
|
+
|
56
|
+
PLATFORMS
|
57
|
+
ruby
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
appraisal (~> 0)
|
61
|
+
aruba (~> 0)
|
62
|
+
cape!
|
63
|
+
capistrano (~> 2)
|
64
|
+
json_pure
|
65
|
+
rake (~> 10)
|
66
|
+
rspec (~> 2)
|
data/lib/cape/capistrano.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'cape/rake'
|
2
2
|
require 'cape/recipe_definition'
|
3
3
|
require 'cape/util'
|
4
|
+
require 'cape/xterm'
|
4
5
|
|
5
6
|
module Cape
|
6
7
|
|
@@ -105,40 +106,49 @@ Set environment #{noun} #{parameters_list} if you want to pass #{noun_phrase}.
|
|
105
106
|
if recipe_definition.rename
|
106
107
|
recipe_name = recipe_definition.rename.call(name_tokens.last)
|
107
108
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
value =
|
109
|
+
begin
|
110
|
+
context.task recipe_name, recipe_definition.options do
|
111
|
+
arguments = Array(task[:parameters]).collect do |a|
|
112
|
+
if (value = ENV[a.upcase])
|
113
|
+
value = value.inspect
|
114
|
+
end
|
115
|
+
value
|
116
|
+
end
|
117
|
+
if arguments.empty?
|
118
|
+
arguments = nil
|
119
|
+
else
|
120
|
+
arguments = "[#{arguments.join ','}]"
|
112
121
|
end
|
113
|
-
value
|
114
|
-
end
|
115
|
-
if arguments.empty?
|
116
|
-
arguments = nil
|
117
|
-
else
|
118
|
-
arguments = "[#{arguments.join ','}]"
|
119
|
-
end
|
120
122
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
123
|
+
unless env
|
124
|
+
env_strings = recipe_definition.env.collect do |var_name, var_value|
|
125
|
+
if var_name.nil? || var_value.nil?
|
126
|
+
nil
|
127
|
+
else
|
128
|
+
if var_value.is_a?(Proc)
|
129
|
+
var_value = context.instance_eval do
|
130
|
+
var_value.call
|
131
|
+
end
|
129
132
|
end
|
133
|
+
"#{var_name}=#{var_value.inspect}"
|
130
134
|
end
|
131
|
-
|
132
|
-
|
133
|
-
end
|
134
|
-
env = env_strings.empty? ? nil : (' ' + env_strings.join(' '))
|
135
|
-
end
|
135
|
+
end.compact
|
136
|
+
env = env_strings.empty? ? nil : (' ' + env_strings.join(' '))
|
137
|
+
end
|
136
138
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
path = recipe_definition.cd || context.current_path
|
140
|
+
path = path.call if path.respond_to?(:call)
|
141
|
+
command = "cd #{path} && #{rake.remote_executable} " +
|
142
|
+
"#{task[:name]}#{arguments}#{env}"
|
143
|
+
context.run command
|
144
|
+
end
|
145
|
+
rescue => e
|
146
|
+
$stderr.puts XTerm.bold_and_foreground_red('*** WARNING:') +
|
147
|
+
' ' +
|
148
|
+
XTerm.bold("You must use Cape's renaming API in order " +
|
149
|
+
'to mirror Rake task ') +
|
150
|
+
XTerm.bold_and_underlined(task[:name]) +
|
151
|
+
XTerm.bold(" (#{e.message})")
|
142
152
|
end
|
143
153
|
}
|
144
154
|
# Nest the recipe inside its containing namespaces.
|