configurability 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.md +7 -0
- data/lib/configurability.rb +2 -2
- data/lib/configurability/setting_installer.rb +2 -2
- data/spec/configurability_spec.rb +22 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e32883ba03aa78f84c42fddecf239f302dfd459e
|
4
|
+
data.tar.gz: 4b23dd3fae36d67b931995c1676a506a8edc847f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ceaf6f368433e60377b72fe0d4aac4adbf12362a04938230fd981cd7114cddecc542fd8f2a2e65d9a8f62910e9bd35c941c7958cc0c983177b791a0c4d2c57b
|
7
|
+
data.tar.gz: ab7973670f49baa4528113fc96e0548ab5e4c40e2493d14c1ba1747653cf9855e678ddebe163524b50f64d894387d202815366bb98aa5dc38dbd77d79b913231
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
data/lib/configurability.rb
CHANGED
@@ -13,10 +13,10 @@ module Configurability
|
|
13
13
|
|
14
14
|
|
15
15
|
# Library version constant
|
16
|
-
VERSION = '3.1.
|
16
|
+
VERSION = '3.1.1'
|
17
17
|
|
18
18
|
# Version-control revision constant
|
19
|
-
REVISION = %q$Revision:
|
19
|
+
REVISION = %q$Revision: d6721e4b2dd5 $
|
20
20
|
|
21
21
|
require 'configurability/deferred_config'
|
22
22
|
|
@@ -57,8 +57,8 @@ class Configurability::SettingInstaller
|
|
57
57
|
|
58
58
|
self.target.instance_variable_set( "@#{name}", default_value )
|
59
59
|
if self.target.respond_to?( :const_defined? )
|
60
|
-
defaults = if self.target.const_defined?( :CONFIG_DEFAULTS )
|
61
|
-
self.target.const_get( :CONFIG_DEFAULTS )
|
60
|
+
defaults = if self.target.const_defined?( :CONFIG_DEFAULTS, false )
|
61
|
+
self.target.const_get( :CONFIG_DEFAULTS, false )
|
62
62
|
else
|
63
63
|
self.target.const_set( :CONFIG_DEFAULTS, {} )
|
64
64
|
end
|
@@ -650,6 +650,28 @@ describe Configurability do
|
|
650
650
|
}.to raise_error( /Invalid API key/i )
|
651
651
|
end
|
652
652
|
|
653
|
+
|
654
|
+
it "supports inheritance of defaults" do
|
655
|
+
parent_class = Class.new
|
656
|
+
parent_class.extend( Configurability )
|
657
|
+
parent_class.configurability( :testconfig ) do
|
658
|
+
setting :environment, default: :production
|
659
|
+
end
|
660
|
+
|
661
|
+
child_class = Class.new( parent_class )
|
662
|
+
child_class..extend( Configurability )
|
663
|
+
child_class.configurability( :testconfig ) do
|
664
|
+
setting :environment, default: :staging
|
665
|
+
setting :apikey, default: 'foom'
|
666
|
+
end
|
667
|
+
|
668
|
+
expect( parent_class.defaults ).to contain_exactly([ :environment, :production ])
|
669
|
+
expect( child_class.defaults ).to contain_exactly(
|
670
|
+
[:environment, :staging],
|
671
|
+
[:apikey, 'foom']
|
672
|
+
)
|
673
|
+
end
|
674
|
+
|
653
675
|
end
|
654
676
|
|
655
677
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configurability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
w8aNA5re5+Rt/Vvjxj5AcEnZnZiz5x959NaddQocX32Z1unHw44pzRNUur1GInfW
|
37
37
|
p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2017-01-
|
39
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: loggability
|
metadata.gz.sig
CHANGED
Binary file
|