unobtainium 0.3.3 → 0.3.4

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: 0e112a3d91217d71a4550b176c685c73f0f110ce
4
- data.tar.gz: 15203bf4fe2029dfd4caffa8297dda3ca45f3ef5
3
+ metadata.gz: d0256dcb12c516843f4cd830fc7f8d6e6fa18ee9
4
+ data.tar.gz: 1b1ff9e98627ca94e302a23e9fe88ac02962745d
5
5
  SHA512:
6
- metadata.gz: 6136aef43435b04c188977f12f693c8478d1c64de28c46dc33a661e81006fe0e97f1bc536ddbe506c0e6d86db9b3c8aab52370d288c7ad107643a0d17291e2e1
7
- data.tar.gz: 72a1d82a85bba5e639e5a440704dc464b1914ddcdab8708920643fe981f4ae618ec8e3d3e6aee68e8f8e7837583fe9603005d9cd5ff8faa5422a66de723d05dc
6
+ metadata.gz: 300c4af9f0ab8d9558a0d7bbb6a7915c9daba4ee419460df199465b129832931bb7189022bf98a747f2bca1494330233548f92a6a8db77baf13d265fa7cc5cca
7
+ data.tar.gz: d10fce97363e2777e1a1aad0e6dd31bbc7135b800685b2a43eda1f689be6b54bcfaa9cb9f7af6200e567b825b52015b26df5f9db68621aa7bf88efd30422e2a3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unobtainium (0.3.3)
4
+ unobtainium (0.3.4)
5
5
  sys-proctable (~> 1.0)
6
6
 
7
7
  GEM
@@ -188,7 +188,7 @@ module Unobtainium
188
188
 
189
189
  # If we're a write function, then we need to create intermediary objects,
190
190
  # i.e. what's at head if nothing is there.
191
- if options[:create] and data.fetch(head, nil).nil?
191
+ if options[:create] and data[head].nil?
192
192
  data[head] = {}
193
193
  end
194
194
 
@@ -8,5 +8,5 @@
8
8
  #
9
9
  module Unobtainium
10
10
  # The current release version
11
- VERSION = "0.3.3".freeze
11
+ VERSION = "0.3.4".freeze
12
12
  end
@@ -172,4 +172,21 @@ describe ::Unobtainium::PathedHash do
172
172
  expect(ph2["foo.bar"]).to eql 42
173
173
  expect(ph2["foo.baz"]).to eql "quux"
174
174
  end
175
+
176
+ it "can write with indifferent access without overwriting" do
177
+ sample = {
178
+ foo: {
179
+ bar: 42,
180
+ baz: 'quux',
181
+ }
182
+ }
183
+ ph = ::Unobtainium::PathedHash.new(sample)
184
+
185
+ expect(ph['foo.bar']).to eql 42
186
+ expect(ph['foo.baz']).to eql 'quux'
187
+
188
+ ph['foo.bar'] = 123
189
+ expect(ph['foo.bar']).to eql 123
190
+ expect(ph['foo.baz']).to eql 'quux'
191
+ end
175
192
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unobtainium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Finkhaeuser