configurability 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -1
- data/spec/configurability_spec.rb +15 -3
- 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: 7c45a9143a15707d91401576cb803aceedd10855
|
4
|
+
data.tar.gz: 73ccce66fcded9ec68e40913f17a9524cdb1c88b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2429a91eacfdac2d85086a7c27df4eef69df8e9829305cb305beb406c47e130028a0e0e6de015c032524e3a793e504857de5c64033fe129935db1c596e4a15bf
|
7
|
+
data.tar.gz: a167625e37fd5e66f1416d3c68751dc1ab7bfa2c7fdc0690dc102f5a86d7f291851d27491a51f154f146c98b1d9fe2cc5aafba4e7faaedeaa09edceaf0802c8a
|
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.2'
|
17
17
|
|
18
18
|
# Version-control revision constant
|
19
|
-
REVISION = %q$Revision:
|
19
|
+
REVISION = %q$Revision: d4831719cb5d $
|
20
20
|
|
21
21
|
require 'configurability/deferred_config'
|
22
22
|
|
@@ -55,7 +55,7 @@ class Configurability::SettingInstaller
|
|
55
55
|
def add_default( name, options )
|
56
56
|
default_value = options[ :default ]
|
57
57
|
|
58
|
-
self.target.
|
58
|
+
self.target.send( "#{name}=", default_value )
|
59
59
|
if self.target.respond_to?( :const_defined? )
|
60
60
|
defaults = if self.target.const_defined?( :CONFIG_DEFAULTS, false )
|
61
61
|
self.target.const_get( :CONFIG_DEFAULTS, false )
|
@@ -613,7 +613,7 @@ describe Configurability do
|
|
613
613
|
end
|
614
614
|
|
615
615
|
|
616
|
-
it "installs the current config after
|
616
|
+
it "installs the current config after it's done if it's already loaded" do
|
617
617
|
config = OpenStruct.new( testconfig: {
|
618
618
|
environment: 'production',
|
619
619
|
apikey: 'jofRtkw&QzCoukGwAWDMjyTkQzWnCXhhgEs'
|
@@ -633,11 +633,11 @@ describe Configurability do
|
|
633
633
|
|
634
634
|
it "can declare settings with a block to do writer pre-processing" do
|
635
635
|
mod.configurability( :testconfig ) do
|
636
|
-
setting :data_dir do |dir|
|
636
|
+
setting :data_dir, default: '/tmp/data' do |dir|
|
637
637
|
Pathname( dir )
|
638
638
|
end
|
639
639
|
setting :apikey do |key|
|
640
|
-
raise "Invalid API key!" unless key.to_s =~ /\A\p{Xdigit}{32}\z/
|
640
|
+
raise "Invalid API key!" unless key.nil? || key.to_s =~ /\A\p{Xdigit}{32}\z/
|
641
641
|
key
|
642
642
|
end
|
643
643
|
end
|
@@ -651,6 +651,17 @@ describe Configurability do
|
|
651
651
|
end
|
652
652
|
|
653
653
|
|
654
|
+
it "uses the setting block for setting up the initial defaults" do
|
655
|
+
mod.configurability( :testconfig ) do
|
656
|
+
setting :data_dir, default: 'this/that' do |dir|
|
657
|
+
Pathname( dir )
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
expect( mod.data_dir ).to be_a( Pathname )
|
662
|
+
end
|
663
|
+
|
664
|
+
|
654
665
|
it "supports inheritance of defaults" do
|
655
666
|
parent_class = Class.new
|
656
667
|
parent_class.extend( Configurability )
|
@@ -672,6 +683,7 @@ describe Configurability do
|
|
672
683
|
)
|
673
684
|
end
|
674
685
|
|
686
|
+
|
675
687
|
end
|
676
688
|
|
677
689
|
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.2
|
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-16 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: loggability
|
metadata.gz.sig
CHANGED
Binary file
|