ultra_config 0.6.1 → 0.7.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 +7 -6
- 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: 295fbba3cf717f20c88cb9eb553f8be75db7ea84
|
4
|
+
data.tar.gz: f7d2de63cdd2ff5b114773d14985a9b01edd9551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cf1f7b6b587b60ad941c5a5ae25f6092765274b4e87eac881d4f61183971eab2a254ff7c4be0d09255418a5def0b66e4bba1dd524c99ce06edeae72b8ce4b3f
|
7
|
+
data.tar.gz: 3d1c9cc568c01a6de93622ecb3810d06bd12a57619645ec02b77fd9755c88e1884e2e432aeebae00d858336d8ae0f147f41dcdd894bde70f09a703cb0a71d1aa
|
@@ -3,10 +3,15 @@ require_relative 'config'
|
|
3
3
|
module UltraConfig
|
4
4
|
class Namespace
|
5
5
|
def initialize(&block)
|
6
|
-
@configuration = block
|
6
|
+
@configuration = [block]
|
7
7
|
reset
|
8
8
|
end
|
9
9
|
|
10
|
+
def extend(&block)
|
11
|
+
@configuration << block
|
12
|
+
self.instance_eval(&block)
|
13
|
+
end
|
14
|
+
|
10
15
|
def setting(name, value)
|
11
16
|
Settings.set(name, value)
|
12
17
|
end
|
@@ -15,10 +20,6 @@ module UltraConfig
|
|
15
20
|
@objects[name] = Namespace.new(&block)
|
16
21
|
end
|
17
22
|
|
18
|
-
def constants(constants)
|
19
|
-
@constants ||= constants
|
20
|
-
end
|
21
|
-
|
22
23
|
def config(name, default = nil, &block)
|
23
24
|
@objects[name] = Config.new(default, &block)
|
24
25
|
end
|
@@ -37,7 +38,7 @@ module UltraConfig
|
|
37
38
|
|
38
39
|
def reset
|
39
40
|
@objects = {}
|
40
|
-
self.instance_eval(
|
41
|
+
@configuration.each { |config| self.instance_eval(&config) }
|
41
42
|
end
|
42
43
|
|
43
44
|
def to_s
|
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.7.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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|