ridley 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb6b2d972e7cad1c5ff8f3146d8f89bb13b195d8
4
- data.tar.gz: 528c096c325dbd733bdf34bfd9db7626e0b4c881
3
+ metadata.gz: 362b667bff0340e4cba7d750a251c91003811218
4
+ data.tar.gz: 173dd3384ef80483faa2d7f4137e2ffca339a310
5
5
  SHA512:
6
- metadata.gz: f61bf70fb4e308195fa5217b993a5e4bc143532ed544f2904b97936b054a5c5f123a0a7e204b14b836fec1e1deb3189111252ed78c0bc876273d31b6470a51a5
7
- data.tar.gz: ac987d268761de5aeb80435726d81c0436c8adf40b750774d7e129b98f29838dcd748a3e0234333edb1876b10a78c44b1f75b1bb6e41646ce13fefc5dd5160fa
6
+ metadata.gz: 21d2e559ff5a3dc38a4dbae1fed6b33013aa8612771bac3199442ed7844eeea767fcc5a8affa920df3a2c48f2872b33709b81cab643655d4f9d683105325d215
7
+ data.tar.gz: 07af89b3508d66d6533ac7b8c7353ca015d461fd240a9942b6af6466b6457b85027fffa8067b4e18f4405abc98ef34e614284a5830c55fd8407455c56e934158
@@ -1,3 +1,7 @@
1
+ # 2.4.2
2
+
3
+ * [#244](https://github.com/RiotGames/ridley/pull/244) Fix a bug with deleting deeply nested environment attributes.
4
+
1
5
  # 2.4.0
2
6
 
3
7
  * Add support for Chef 11 User Objects
data/README.md CHANGED
@@ -201,6 +201,13 @@ ridley.role.all #=> [
201
201
  #<Ridley::RoleObject chef_id:motherbrain_proxy ...>
202
202
  ]
203
203
  ```
204
+ Notify: You have to send the #reload message to node objects returned from a full listing. Their attributes aren't automatically populated from the initial search.
205
+
206
+ ```ruby
207
+ ridley = Ridley.new(...)
208
+ ridley.role.all.first => #<Ridley::RoleObject chef_id:some_chef_id, attributes:#<VariaModel::Attributes chef_type="role" default_attributes=#<Hashie::Mash> description="" env_run_lists=#<VariaModel::Attributes> json_class="Chef::Role" name="some_chef_id" override_attributes=#<Hashie::Mash> run_list=[]>>
209
+ ridley.role.all.first.reload => #<Ridley::RoleObject chef_id:some_chef_id, attributes:#<VariaModel::Attributes chef_type="role" default_attributes=#<Hashie::Mash SOME ATTRIBUTES> description="Some description" env_run_lists=#<VariaModel::Attributes> json_class="Chef::Role" name="some_chef_id" override_attributes=#<Hashie::Mash> run_list=[ SOME RUN LIST ]>>
210
+ ````
204
211
 
205
212
  ##### Finding
206
213
 
@@ -96,7 +96,7 @@ module Ridley
96
96
  when :override
97
97
  attributes_to_change = self.override_attributes
98
98
  end
99
- leaf_hash = dotted_path.inject(attributes_to_change) { |hash, element| hash[element] }
99
+ leaf_hash = dotted_path.inject(attributes_to_change) { |hash, element| hash[element] unless hash == nil }
100
100
  leaf_hash.delete(leaf_key) unless leaf_hash.nil?
101
101
  attributes_to_change
102
102
  end
@@ -1,3 +1,3 @@
1
1
  module Ridley
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
3
3
  end
@@ -75,6 +75,19 @@ describe Ridley::EnvironmentObject do
75
75
  expect(subject.default_attributes[:hello][:world]).to be_true
76
76
  end
77
77
  end
78
+
79
+ context "when an internal hash is nil" do
80
+ let(:delete_default_attribute) { subject.delete_default_attribute("never.not.existing") }
81
+
82
+ before do
83
+ subject.default_attributes = Hash.new
84
+ end
85
+
86
+ it "does not delete anything" do
87
+ delete_default_attribute
88
+ expect(subject.default_attributes).to be_empty
89
+ end
90
+ end
78
91
  end
79
92
 
80
93
  describe "#delete_override_attribute" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridley
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-16 00:00:00.000000000 Z
12
+ date: 2014-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable