chef_cap 0.3.12 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/chef_cap/version.rb +1 -1
- data/recipes/chef_cap.rb +8 -3
- data/spec/chef_cap_spec.rb +2 -2
- metadata +7 -7
data/lib/chef_cap/version.rb
CHANGED
data/recipes/chef_cap.rb
CHANGED
@@ -159,19 +159,24 @@ set :debug_flag, ENV['DEBUG'] ? '-l debug' : ''
|
|
159
159
|
|
160
160
|
namespace :chef do
|
161
161
|
task :setup do
|
162
|
-
bundler_install_cmd = "gem install bundler --no-ri --no-rdoc"
|
163
162
|
case ruby_version_switcher
|
164
163
|
when 'rbenv'
|
165
164
|
gem_check_for_chef_cmd = "gem specification --version '>=#{chef_version}' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }'"
|
166
165
|
install_chef_cmd = "gem install chef --no-ri --no-rdoc"
|
167
166
|
run "#{gem_check_for_chef_cmd} || #{install_chef_cmd} && echo 'Chef Solo already on this server.'"
|
168
|
-
|
167
|
+
|
168
|
+
gem_check_for_bundler_cmd = "gem specification --version '>0' bundler 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }'"
|
169
|
+
install_bundler_cmd = "gem install bundler --no-ri --no-rdoc"
|
170
|
+
run "#{gem_check_for_bundler_cmd} || #{install_bundler_cmd} && echo 'Bundler already on this server.'"
|
169
171
|
run "rbenv rehash"
|
170
172
|
else
|
171
173
|
gem_check_for_chef_cmd = "gem specification --version '>=#{chef_version}' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }'"
|
172
174
|
install_chef_cmd = "sudo `cat #{rvm_bin_path}` default exec gem install chef --no-ri --no-rdoc"
|
173
175
|
sudo "`cat #{rvm_bin_path}` default exec #{gem_check_for_chef_cmd} || #{install_chef_cmd} && echo 'Chef Solo already on this server.'"
|
174
|
-
|
176
|
+
|
177
|
+
gem_check_for_bundler_cmd = "gem specification --version '>0' bundler 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }'"
|
178
|
+
install_chef_cmd = "sudo `cat #{rvm_bin_path}` default exec gem install bundler --no-ri --no-rdoc"
|
179
|
+
sudo "`cat #{rvm_bin_path}` default exec #{gem_check_for_bundler_cmd} || #{install_bundler_cmd} && echo 'Bundler already on this server.'"
|
175
180
|
sudo "`cat #{rvm_bin_path}` default exec which chef-solo"
|
176
181
|
end
|
177
182
|
end
|
data/spec/chef_cap_spec.rb
CHANGED
@@ -485,7 +485,7 @@ describe "chef_cap" do
|
|
485
485
|
it "sets up chef gem" do
|
486
486
|
chef_cap.cap_servers.should_not be_empty
|
487
487
|
chef_cap.should_receive(:sudo).ordered.with("`cat /tmp/.chef_cap_rvm_path` default exec gem specification --version '>=0.1982.1234' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }' || sudo `cat /tmp/.chef_cap_rvm_path` default exec gem install chef --no-ri --no-rdoc && echo 'Chef Solo already on this server.'").and_return("mocked")
|
488
|
-
chef_cap.should_receive(:sudo).ordered.with("`cat /tmp/.chef_cap_rvm_path` default exec gem
|
488
|
+
chef_cap.should_receive(:sudo).ordered.with("`cat /tmp/.chef_cap_rvm_path` default exec gem specification --version '>0' bundler 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }' || && echo 'Bundler already on this server.'").and_return("mocked")
|
489
489
|
chef_cap.should_receive(:sudo).ordered.with("`cat /tmp/.chef_cap_rvm_path` default exec which chef-solo").and_return("mocked")
|
490
490
|
|
491
491
|
chef_cap.cap_task["bootstrap:ruby"].call
|
@@ -537,7 +537,7 @@ describe "chef_cap" do
|
|
537
537
|
chef_cap.cap_servers.should_not be_empty
|
538
538
|
chef_cap.stub!(:put => "stubbed")
|
539
539
|
chef_cap.should_receive(:run).ordered.with("gem specification --version '>=0.1982.1234' chef 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }' || gem install chef --no-ri --no-rdoc && echo 'Chef Solo already on this server.'").and_return("mocked")
|
540
|
-
chef_cap.should_receive(:run).ordered.with("gem install bundler --no-ri --no-rdoc").and_return("mocked")
|
540
|
+
chef_cap.should_receive(:run).ordered.with("gem specification --version '>0' bundler 2>&1 | awk 'BEGIN { s = 0 } /^name:/ { s = 1; exit }; END { if(s == 0) exit 1 }' || gem install bundler --no-ri --no-rdoc && echo 'Bundler already on this server.'").and_return("mocked")
|
541
541
|
chef_cap.should_receive(:run).ordered.with("rbenv rehash").and_return("mocked")
|
542
542
|
|
543
543
|
chef_cap.cap_task["bootstrap:ruby"].call
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_cap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &2248518500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.5.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2248518500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &2248518000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.1'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2248518000
|
36
36
|
description: chef_cap uses chef"s JSON config format to drive both capistrano and
|
37
37
|
chef-solo"
|
38
38
|
email:
|
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
segments:
|
95
95
|
- 0
|
96
|
-
hash: -
|
96
|
+
hash: -2885690206937113614
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
segments:
|
104
104
|
- 0
|
105
|
-
hash: -
|
105
|
+
hash: -2885690206937113614
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
108
|
rubygems_version: 1.8.15
|