really-confy 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/really_confy.rb +8 -1
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c302d38b29348f70a6e2246add5eb28fb4d25b58
4
- data.tar.gz: b7cf55ba7d1bc753a253a38c5d952405189d8c72
3
+ metadata.gz: d8b66a182e1d7c887d75d5f344831351c1735eb0
4
+ data.tar.gz: cf7768c87280384cd1e23ce19956420f97e3f77a
5
5
  SHA512:
6
- metadata.gz: 26538073af0b6b3089785ca7eab1d97d4b3601dd7d32b55d2c5aa1305c2531890d5c9fbddea68ae64f42d6733962932cf256c076f03513849390ac8007d9ff02
7
- data.tar.gz: fad912633f37944bca950a92800c5b66f0f5386fdd539cf93f6d7583f45b09fcb5d85c2f9a5e7504cfc3b9c7b70a7713287f6ef1feefe32d7ede7b8467165539
6
+ metadata.gz: cb7418f5d8c25342d2e28d6f30e96212fea238692d9c8f525bcc5358986d4e19119d10d27434706299255f5b21127d6363a6be3e8d746905cf61a1fd3fa106ee
7
+ data.tar.gz: 6aa643bb79169707716d299dd983c31358a8d64b304f6e2bd7cae37164588a5988545482baaea65d5b9c7c2c335bcecb447a99abb591aabd2bc22d5195f310a7
data/lib/really_confy.rb CHANGED
@@ -226,12 +226,19 @@ class ReallyConfy
226
226
  include Hashie::Extensions::DeepFetch
227
227
 
228
228
  def freeze
229
+ return self if frozen?
229
230
  super
230
231
  self.values.each do |v|
231
- v.freeze
232
+ v.freeze unless frozen? || value_is_a_singleton?(v)
232
233
  end
233
234
  self
234
235
  end
236
+
237
+ private
238
+
239
+ def value_is_a_singleton?(value)
240
+ value.nil? || value == true || value == false
241
+ end
235
242
  end
236
243
 
237
244
  class ConfigError < StandardError
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: really-confy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zukowski
8
+ - Edward Tam
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  version: '0'
66
67
  requirements: []
67
68
  rubyforge_project:
68
- rubygems_version: 2.4.8
69
+ rubygems_version: 2.2.2
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Simple YAML configuration loader