cape 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +1 -1
  3. data/Gemfile +11 -9
  4. data/Guardfile +17 -0
  5. data/History.markdown +10 -0
  6. data/MIT-LICENSE.markdown +1 -1
  7. data/README.markdown +58 -9
  8. data/Rakefile +1 -1
  9. data/cape.gemspec +13 -12
  10. data/features/dsl/each_rake_task/with_defined_namespace_argument.feature +8 -0
  11. data/features/dsl/each_rake_task/with_undefined_argument.feature +25 -1
  12. data/features/dsl/each_rake_task/without_arguments.feature +8 -0
  13. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_namespace_argument.feature +25 -0
  14. data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature +50 -4
  15. data/features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature +19 -0
  16. data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature +199 -0
  17. data/features/dsl/mirror_rake_tasks/with_valid_options_argument.feature +90 -0
  18. data/features/dsl/mirror_rake_tasks/without_arguments.feature +48 -5
  19. data/features/dsl/rake_executable.feature +10 -6
  20. data/features/step_definitions.rb +3 -0
  21. data/lib/cape/capistrano.rb +70 -40
  22. data/lib/cape/dsl.rb +76 -13
  23. data/lib/cape/rake.rb +30 -6
  24. data/lib/cape/version.rb +1 -1
  25. data/spec/cape/capistrano_spec.rb +16 -0
  26. data/spec/cape/dsl_spec.rb +108 -29
  27. data/spec/cape/rake_spec.rb +40 -0
  28. data/spec/cape/util_spec.rb +2 -2
  29. data/spec/cape/version_spec.rb +0 -1
  30. data/spec/cape_spec.rb +21 -3
  31. metadata +24 -18
  32. data/spec/cape/task_spec.rb +0 -0
@@ -0,0 +1,40 @@
1
+ require 'cape/rake'
2
+
3
+ describe Cape::Rake do
4
+ describe '::DEFAULT_EXECUTABLE' do
5
+ subject { Cape::Rake::DEFAULT_EXECUTABLE }
6
+
7
+ it { should == '/usr/bin/env rake' }
8
+
9
+ it { should be_frozen }
10
+ end
11
+
12
+ describe '#==' do
13
+ it('should recognize equivalent instances to be equal') {
14
+ described_class.new.should == described_class.new
15
+ }
16
+
17
+ it('should compare using #local_executable') {
18
+ described_class.new.should_not == described_class.new(:local_executable => 'foo')
19
+ }
20
+
21
+ it('should compare using #remote_executable') {
22
+ described_class.new.should_not == described_class.new(:remote_executable => 'foo')
23
+ }
24
+ end
25
+
26
+ describe 'without specified attributes' do
27
+ its(:local_executable) { should == '/usr/bin/env rake' }
28
+
29
+ its(:remote_executable) { should == '/usr/bin/env rake' }
30
+ end
31
+
32
+ describe 'with specified attributes' do
33
+ subject { described_class.new :local_executable => 'And now for something',
34
+ :remote_executable => 'completely different' }
35
+
36
+ its(:local_executable) { should == 'And now for something' }
37
+
38
+ its(:remote_executable) { should == 'completely different' }
39
+ end
40
+ end
@@ -1,7 +1,7 @@
1
1
  require 'cape/util'
2
2
 
3
3
  describe Cape::Util do
4
- describe '::pluralize' do
4
+ describe '.pluralize' do
5
5
  it "should pluralize 'foo' as expected" do
6
6
  Cape::Util.pluralize('foo').should == 'foos'
7
7
  end
@@ -23,7 +23,7 @@ describe Cape::Util do
23
23
  end
24
24
  end
25
25
 
26
- describe '::to_list_phrase' do
26
+ describe '.to_list_phrase' do
27
27
  it 'should make the expected list phrase of an empty array' do
28
28
  Cape::Util.to_list_phrase([]).should == ''
29
29
  end
@@ -1,4 +1,3 @@
1
- require 'rspec'
2
1
  require 'cape/version'
3
2
 
4
3
  describe Cape::VERSION do
@@ -1,5 +1,23 @@
1
- require 'cape/version'
1
+ require 'cape'
2
+ require 'cape/dsl'
2
3
 
3
- describe Cape::VERSION do
4
- it { should match(/^\d+\.\d+\.\d+$/) }
4
+ describe Cape do
5
+ Cape::DSL.instance_methods.each do |m|
6
+ it { should respond_to(m) }
7
+ end
8
+ end
9
+
10
+ describe '#Cape' do
11
+ it 'should yield the Cape module if given a unary block' do
12
+ yielded = nil
13
+ Cape do |c|
14
+ yielded = c
15
+ end
16
+ yielded.should == Cape
17
+ end
18
+
19
+ it 'should accept a nullary block' do
20
+ Cape do
21
+ end
22
+ end
5
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cape
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nils Jonsson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-30 00:00:00 Z
18
+ date: 2012-02-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: aruba
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
- - - ">="
26
+ - - ~>
27
27
  - !ruby/object:Gem::Version
28
28
  hash: 3
29
29
  segments:
@@ -37,12 +37,12 @@ dependencies:
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
38
  none: false
39
39
  requirements:
40
- - - ">="
40
+ - - ~>
41
41
  - !ruby/object:Gem::Version
42
- hash: 3
42
+ hash: 7
43
43
  segments:
44
- - 0
45
- version: "0"
44
+ - 2
45
+ version: "2"
46
46
  type: :development
47
47
  version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirement: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
- - - ">="
54
+ - - ~>
55
55
  - !ruby/object:Gem::Version
56
56
  hash: 3
57
57
  segments:
@@ -67,14 +67,17 @@ dependencies:
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- hash: 13
70
+ hash: 7
71
71
  segments:
72
72
  - 2
73
- - 7
74
- version: "2.7"
73
+ version: "2"
75
74
  type: :development
76
75
  version_requirements: *id004
77
- description: Cape provides a simple DSL for selecting Rake tasks to be made available as documented Capistrano recipes. You can pass required arguments to Rake tasks via environment variables.
76
+ description: |-
77
+ Cape dynamically generates Capistrano recipes for Rake tasks.
78
+ It provides a DSL for reflecting on Rake tasks and mirroring
79
+ them as documented Capistrano recipes. You can pass Rake task
80
+ arguments via environment variables.
78
81
  email:
79
82
  - cape@nilsjonsson.com
80
83
  executables: []
@@ -89,6 +92,7 @@ files:
89
92
  - .travis.yml
90
93
  - .yardopts
91
94
  - Gemfile
95
+ - Guardfile
92
96
  - History.markdown
93
97
  - MIT-LICENSE.markdown
94
98
  - README.markdown
@@ -103,8 +107,10 @@ files:
103
107
  - features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_undefined_argument.feature
104
108
  - features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature
105
109
  - features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature
110
+ - features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature
106
111
  - features/dsl/mirror_rake_tasks/with_defined_task_argument.feature
107
112
  - features/dsl/mirror_rake_tasks/with_undefined_argument.feature
113
+ - features/dsl/mirror_rake_tasks/with_valid_options_argument.feature
108
114
  - features/dsl/mirror_rake_tasks/without_arguments.feature
109
115
  - features/dsl/rake_executable.feature
110
116
  - features/step_definitions.rb
@@ -123,11 +129,10 @@ files:
123
129
  - spec/cape/core_ext/symbol_spec.rb
124
130
  - spec/cape/dsl_spec.rb
125
131
  - spec/cape/rake_spec.rb
126
- - spec/cape/task_spec.rb
127
132
  - spec/cape/util_spec.rb
128
133
  - spec/cape/version_spec.rb
129
134
  - spec/cape_spec.rb
130
- homepage: ""
135
+ homepage: http://github.com/njonsson/cape
131
136
  licenses:
132
137
  - MIT
133
138
  post_install_message:
@@ -157,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
162
  version: "0"
158
163
  requirements: []
159
164
 
160
- rubyforge_project:
165
+ rubyforge_project: cape
161
166
  rubygems_version: 1.8.11
162
167
  signing_key:
163
168
  specification_version: 3
@@ -172,8 +177,10 @@ test_files:
172
177
  - features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_undefined_argument.feature
173
178
  - features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature
174
179
  - features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature
180
+ - features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature
175
181
  - features/dsl/mirror_rake_tasks/with_defined_task_argument.feature
176
182
  - features/dsl/mirror_rake_tasks/with_undefined_argument.feature
183
+ - features/dsl/mirror_rake_tasks/with_valid_options_argument.feature
177
184
  - features/dsl/mirror_rake_tasks/without_arguments.feature
178
185
  - features/dsl/rake_executable.feature
179
186
  - features/step_definitions.rb
@@ -183,7 +190,6 @@ test_files:
183
190
  - spec/cape/core_ext/symbol_spec.rb
184
191
  - spec/cape/dsl_spec.rb
185
192
  - spec/cape/rake_spec.rb
186
- - spec/cape/task_spec.rb
187
193
  - spec/cape/util_spec.rb
188
194
  - spec/cape/version_spec.rb
189
195
  - spec/cape_spec.rb
File without changes