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 +4 -4
- data/.ruby-version +1 -1
- data/config-hash.gemspec +1 -1
- data/lib/config-hash.rb +4 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d7d77612387f4c98acb30d2174f842e9bc686cee148dd35971a50b1af1ffc36
|
4
|
+
data.tar.gz: 5be88d29ba90fb1f0076fb690969e642c8bfc5d7faa98f3235c592f059f7397d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 945fb4e4c3fcadc7dc433f36a512ed26ef06bfc17349ea14dae2e6f5bfc063c9821649739fe9bdb85c4ea2f48e8a3ec8bd60ab52fcc79c8175dde38c89c37509
|
7
|
+
data.tar.gz: 35a042c344fa0e43902ed11d7b36111af477bd37eeab5e155b35b1360e85f3fe7898df22a84da19e56415b5e9de262f02972eac1d39a3d657d9677555a4f827b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5
|
1
|
+
2.5
|
data/config-hash.gemspec
CHANGED
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
|
-
|
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
|
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?
|
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.
|
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-
|
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
|