ultra_config 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ultra_config/namespace.rb +13 -7
- data/ultra_config.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ce95b60966551465286031c7252fb02681c8bdb
|
4
|
+
data.tar.gz: 7a4679adbb01cbeca22a67401c8899b780a28be0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a23263c099c183c8549a5c8bff397abbb4fcb9add5e730804e424c0426b9e2c9e7fb5f8c45bf5572f47f82ee2661249afbff14cbb30dd9926d050bcaf8cf068e
|
7
|
+
data.tar.gz: 91ea6d74b8d32dacece74cfddb608bb6b8dff20bc01d50f0ef69b3397f1ab3f4b02708bb94367fba11168b6c7528f60fba95b14f13bfe412924e38cbeb9fadb4
|
@@ -4,6 +4,8 @@ module UltraConfig
|
|
4
4
|
class Namespace
|
5
5
|
class ObjectNotFoundError < StandardError; end
|
6
6
|
|
7
|
+
attr_reader :objects
|
8
|
+
|
7
9
|
def initialize(&block)
|
8
10
|
@configuration = [block]
|
9
11
|
reset
|
@@ -38,16 +40,20 @@ module UltraConfig
|
|
38
40
|
@configuration.each { |config| self.instance_eval(&config) }
|
39
41
|
end
|
40
42
|
|
41
|
-
def
|
42
|
-
|
43
|
+
def to_h
|
44
|
+
hash = {}
|
45
|
+
@objects.each do |name, object|
|
46
|
+
if object.is_a?(Config)
|
47
|
+
hash[name] = object.value
|
48
|
+
else
|
49
|
+
hash[name] = object.to_h
|
50
|
+
end
|
51
|
+
end
|
43
52
|
|
44
|
-
|
45
|
-
@objects.each { |name, object| objs << "#{name}: #{object.to_s}" }
|
46
|
-
output << objs.join(', ')
|
47
|
-
output << ' }'
|
53
|
+
hash
|
48
54
|
end
|
49
55
|
|
50
|
-
def
|
56
|
+
def to_sanitized_h
|
51
57
|
hash = {}
|
52
58
|
@objects.each do |name, object|
|
53
59
|
if object.is_a?(Config)
|
data/ultra_config.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultra_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Kuruc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|