config-hash 0.5.0 → 0.6.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7f537363101a24d151beb368c314f42bc796eb78ae656b35653ca2499674ed3
4
- data.tar.gz: 8c8ff79e58f1801c8e930beb1edf645b9d7761ca98c9a76b043af37a3e12ba65
3
+ metadata.gz: 5d7d77612387f4c98acb30d2174f842e9bc686cee148dd35971a50b1af1ffc36
4
+ data.tar.gz: 5be88d29ba90fb1f0076fb690969e642c8bfc5d7faa98f3235c592f059f7397d
5
5
  SHA512:
6
- metadata.gz: 326d2911fe5917de0b68c5041e82cd70a80deb2b4bff3c506185d19075105129039a8125e7fa7089068c374b56061df508697877f805a62d501f5011f7a9c7aa
7
- data.tar.gz: a43d76d8d41c52e002328d3484a8b77aa48eac43e3068f3eaaf967c66ab2d164917e617bf069fafdf25531f0c60560572430b48617c8e9e99f81dfa162f0a3d7
6
+ metadata.gz: 945fb4e4c3fcadc7dc433f36a512ed26ef06bfc17349ea14dae2e6f5bfc063c9821649739fe9bdb85c4ea2f48e8a3ec8bd60ab52fcc79c8175dde38c89c37509
7
+ data.tar.gz: 35a042c344fa0e43902ed11d7b36111af477bd37eeab5e155b35b1360e85f3fe7898df22a84da19e56415b5e9de262f02972eac1d39a3d657d9677555a4f827b
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.5
data/config-hash.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "config-hash"
5
- s.version = "0.5.0"
5
+ s.version = "0.6.0"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "A safe, homoiconic, Ruby hash supporting dot notation"
data/lib/config-hash.rb CHANGED
@@ -1,19 +1,15 @@
1
1
  Encoding.default_external = "UTF-8"
2
2
 
3
3
  class Hash
4
- def -@
5
- NormalHash.new.merge!(self)
6
- end
7
- def +@
8
- ConfigHash.new(self)
9
- end
4
+ def -@; NormalHash[self]; end
5
+ def +@; ConfigHash[self]; end
10
6
  end
11
7
 
12
8
  class NormalHash < Hash
13
9
  end
14
10
 
15
11
  class ConfigHash < Hash
16
- SEPARATORS = %r|[./]|
12
+ SEPARATORS ||= %r|[./]|
17
13
 
18
14
  def self.load(path="config.rb", var="config")
19
15
  path = File.expand_path(path)
@@ -110,7 +106,7 @@ class ConfigHash < Hash
110
106
  def method_missing(sym, *args, &block)
111
107
  if sym =~ /=$/
112
108
  self[$`] = args.first
113
- elsif args.empty? # or... key?(sym)
109
+ elsif args.empty?
114
110
  self[sym]
115
111
  else
116
112
  super
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config-hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-05-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem makes it easy to work with configuration data.
14
14
  email: steve.shreeve@gmail.com