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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: faae8b0f6b12bc463661b9cebc0f45824056172f
4
- data.tar.gz: 076b41dd9c74b242388e94b74c9f836d21c55cb8
3
+ metadata.gz: 295fbba3cf717f20c88cb9eb553f8be75db7ea84
4
+ data.tar.gz: f7d2de63cdd2ff5b114773d14985a9b01edd9551
5
5
  SHA512:
6
- metadata.gz: 97f9ee06384633e16d3bf7becadc36eb3b7a7b49b45a5b2079ac1b1f9ca9f226252ff5d7ec7fa43d38a86060f97ac1bd8adff2f7dd16ee103ba6de60514d5830
7
- data.tar.gz: ea31726e063e47dd3a28ac588815dff424a475d6af96e94de063ce0188910512f335ca0543e9f1f77c35e2b051d81ea087b7aa8988106f812d6d0266b1fdbf1f
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(&@configuration)
41
+ @configuration.each { |config| self.instance_eval(&config) }
41
42
  end
42
43
 
43
44
  def to_s
data/ultra_config.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'ultra_config'
7
- spec.version = '0.6.1'
7
+ spec.version = '0.7.0'
8
8
  spec.authors = ['Gregory Kuruc']
9
9
  spec.email = ['gjk910327@gmail.com']
10
10
 
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.6.1
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-07 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler