chef_cap 0.3.22 → 0.3.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ChefCap
2
- VERSION = "0.3.22"
2
+ VERSION = "0.3.23"
3
3
  end
@@ -30,15 +30,15 @@ class ChefCapHelper
30
30
  when "Hash_Hash"
31
31
  hash[key].merge!(value) do |k, oldvalue, newvalue|
32
32
  case "#{oldvalue.class}_#{newvalue.class}"
33
- when "Hash_Hash"
34
- if oldvalue.has_key?(oldvalue) && newvalue.has_key?(newvalue)
35
- recursive_merge(oldvalue, k, newvalue)
36
- else
37
- oldvalue.merge(newvalue)
38
- end
33
+ when "Hash_Hash"
34
+ if oldvalue.has_key?(oldvalue) && newvalue.has_key?(newvalue)
35
+ recursive_merge(oldvalue, k, newvalue)
39
36
  else
40
- newvalue
37
+ oldvalue.merge(newvalue)
41
38
  end
39
+ else
40
+ newvalue
41
+ end
42
42
  end
43
43
  else
44
44
  hash[key] = value
@@ -94,8 +94,7 @@ class ChefCapHelper
94
94
  return nil if json_hash["run_list"].nil?
95
95
  new_run_list = json_hash["run_list"].dup
96
96
  if json_hash.has_key? "deploy_recipe"
97
- deploy_recipe = new_run_list.delete(json_hash["deploy_recipe"])
98
- new_run_list << deploy_recipe if deploy_recipe && !should_not_deploy
97
+ new_run_list.delete(json_hash["deploy_recipe"]) if should_not_deploy
99
98
  end
100
99
  new_run_list
101
100
  end
@@ -169,15 +169,6 @@ describe ChefCapHelper do
169
169
  end
170
170
 
171
171
  describe ".rewrite_run_list_for_deploy" do
172
- it "should move the deploy recipe to the end of the run list if it is specified" do
173
- json_with_run_list = {
174
- "run_list" => ["something", "something", "deployrecipe", "darkside"],
175
- "deploy_recipe" => "deployrecipe"
176
- }
177
-
178
- ChefCapHelper.rewrite_run_list_for_deploy(json_with_run_list).should == ["something", "something", "darkside", "deployrecipe"]
179
- end
180
-
181
172
  it "should do nothing if the run list does not contain the deploy recipe" do
182
173
  json_with_run_list = {
183
174
  "run_list" => ["something", "something", "darkside"],
@@ -902,25 +902,6 @@ describe "chef_cap" do
902
902
  JS
903
903
  chef_cap.stub(:system).and_return(true)
904
904
  end
905
-
906
- it "puts the specified deploy_recipe at the very end of the run list" do
907
- chef_cap.stub!(:put => "stubbed")
908
- chef_cap.stub!(:upload => "stubbed")
909
- chef_cap.stub!(:sudo => "stubbed")
910
-
911
- chef_cap.cap_task[:some_env].call
912
-
913
- chef_cap.parallel_mocks << proc { |server_session|
914
- server_session.stub!(:put => "stubbed")
915
- server_session.stub!(:sudo => "stubbed")
916
- }
917
-
918
- chef_cap.cap_task["chef:deploy"].call
919
-
920
- chef_cap.parallel_sessions.each do |server_session|
921
- server_session.things_that_were_set["node_hash_for_localhost"]["run_list"].should == ["role1", "roleshared", "something", "darkside", "my_deploy_recipe"]
922
- end
923
- end
924
905
  end
925
906
 
926
907
  describe "node[:environment]" do
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.22
4
+ version: 0.3.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-10 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: -1470809278621786492
106
+ hash: -3750775212043426267
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: -1470809278621786492
115
+ hash: -3750775212043426267
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 1.8.19