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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6efec5eb6d1c3f7a287d1b2e3b7e46d61a7bf35c
4
- data.tar.gz: 4168132a01f061d48023c96b306bc5b63b075056
3
+ metadata.gz: e32883ba03aa78f84c42fddecf239f302dfd459e
4
+ data.tar.gz: 4b23dd3fae36d67b931995c1676a506a8edc847f
5
5
  SHA512:
6
- metadata.gz: f48627d04ffa108d008416c4ffe1b85fe41e98551e4fbadc9868d8cd5faa0dcaa954198287aa46cbaa03c1758ad196ffccf6e031f944a52a9c1c00670b1ad1ec
7
- data.tar.gz: ce7b26244d1de74547837558b55081a84f75604719f0abe7f7ac5fd506578c8ca19a5b584ab4413c24a4d79d421799fad78c4c647882a95d34129f748070e238
6
+ metadata.gz: 5ceaf6f368433e60377b72fe0d4aac4adbf12362a04938230fd981cd7114cddecc542fd8f2a2e65d9a8f62910e9bd35c941c7958cc0c983177b791a0c4d2c57b
7
+ data.tar.gz: ab7973670f49baa4528113fc96e0548ab5e4c40e2493d14c1ba1747653cf9855e678ddebe163524b50f64d894387d202815366bb98aa5dc38dbd77d79b913231
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v3.1.1 [2017-01-03] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Bugfix:
4
+
5
+ - Fix inheritance of defaults when declared using settings
6
+
7
+
1
8
  ## v3.1.0 [2017-01-03] Michael Granger <ged@FaerieMUD.org>
2
9
 
3
10
  Enhancement:
@@ -13,10 +13,10 @@ module Configurability
13
13
 
14
14
 
15
15
  # Library version constant
16
- VERSION = '3.1.0'
16
+ VERSION = '3.1.1'
17
17
 
18
18
  # Version-control revision constant
19
- REVISION = %q$Revision: 0d8d72ac797f $
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.0
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-03 00:00:00.000000000 Z
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