configurability 2.2.1 → 2.2.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/ChangeLog +125 -2
- data/History.rdoc +7 -0
- data/LICENSE +1 -1
- data/README.rdoc +1 -1
- data/Rakefile +23 -7
- data/lib/configurability.rb +6 -4
- data/lib/configurability/config.rb +1 -1
- data/spec/configurability/config_spec.rb +34 -28
- data/spec/configurability/deferredconfig_spec.rb +0 -3
- data/spec/configurability_spec.rb +0 -4
- metadata +57 -52
- 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: c6cb98ff4c6def598e9dd33586505e827ae30f31
|
|
4
|
+
data.tar.gz: 126a57d0241418ec5494fd85db4e60298ac0d464
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 139bb292f45dc1669b82ead0ee7e7bb681f0946b860a3c2a8e256194d54f9d336f70d64151b586ce24245d529c1d1a32dd02c0d2158b2d5e67e1ba500b0a8d49
|
|
7
|
+
data.tar.gz: 9f6399c063597133ebfdd00ffc6fdfb028bf9a09e39543b9125062f2bae8afd8fd86d3487bf0d8dba20ce06268d09e49af06af763d33a57545d59f8c3f6e0c88
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/ChangeLog
CHANGED
|
@@ -1,9 +1,132 @@
|
|
|
1
|
+
2016-03-30 Mahlon E. Smith <mahlon@martini.nu>
|
|
2
|
+
|
|
3
|
+
* lib/configurability.rb:
|
|
4
|
+
Make configuration source logging log at a consistent level.
|
|
5
|
+
[27dcc1cfb771] [tip]
|
|
6
|
+
|
|
7
|
+
2015-02-27 Michael Granger <ged@FaerieMUD.org>
|
|
8
|
+
|
|
9
|
+
* .rvmrc, .travis.yml, Gemfile, Rakefile, configurability.gemspec:
|
|
10
|
+
Set up for travis-ci
|
|
11
|
+
[98edc94ff5d3] [github/master]
|
|
12
|
+
|
|
13
|
+
2014-06-04 Michael Granger <ged@FaerieMUD.org>
|
|
14
|
+
|
|
15
|
+
* .hgtags:
|
|
16
|
+
Added tag v2.2.1 for changeset acc63bf3cabf
|
|
17
|
+
[68413308e101]
|
|
18
|
+
|
|
19
|
+
* .hgsigs:
|
|
20
|
+
Added signature for changeset ead70de30aea
|
|
21
|
+
[acc63bf3cabf] [v2.2.1]
|
|
22
|
+
|
|
23
|
+
* History.rdoc, lib/configurability.rb:
|
|
24
|
+
Bump the patch version and update History.
|
|
25
|
+
[ead70de30aea]
|
|
26
|
+
|
|
27
|
+
* spec/configurability_spec.rb:
|
|
28
|
+
Fix an ordering bug in the top-level specs
|
|
29
|
+
[626c60f58fa6]
|
|
30
|
+
|
|
31
|
+
* .rvm.gems, Rakefile, lib/configurability/behavior.rb,
|
|
32
|
+
spec/configurability_spec.rb, spec/helpers.rb:
|
|
33
|
+
Update to RSpec 3.0.0
|
|
34
|
+
[92b64128d071]
|
|
35
|
+
|
|
36
|
+
2014-05-19 Michael Granger <ged@FaerieMUD.org>
|
|
37
|
+
|
|
38
|
+
* .hgtags:
|
|
39
|
+
Added tag v2.2.0 for changeset faab12f4b26b
|
|
40
|
+
[08619a4e91a2]
|
|
41
|
+
|
|
42
|
+
* .hgsigs:
|
|
43
|
+
Added signature for changeset 7ecaadfcf254
|
|
44
|
+
[faab12f4b26b] [v2.2.0]
|
|
45
|
+
|
|
46
|
+
* History.rdoc, lib/configurability.rb:
|
|
47
|
+
Bump the minor version, update history.
|
|
48
|
+
[7ecaadfcf254]
|
|
49
|
+
|
|
50
|
+
* .pryrc, .rvm.gems, Rakefile, bin/configurability,
|
|
51
|
+
configurability.gemspec, lib/configurability.rb,
|
|
52
|
+
lib/configurability/config.rb:
|
|
53
|
+
Add a .default_config method to objects with Configurability.
|
|
54
|
+
[0a948e0bc4f8]
|
|
55
|
+
|
|
56
|
+
2014-01-20 Michael Granger <ged@FaerieMUD.org>
|
|
57
|
+
|
|
58
|
+
* .hgtags:
|
|
59
|
+
Added tag v2.1.2 for changeset 9d74b7350452
|
|
60
|
+
[a1c4725557f1]
|
|
61
|
+
|
|
62
|
+
* .hgsigs:
|
|
63
|
+
Added signature for changeset 8ccc787daf98
|
|
64
|
+
[9d74b7350452] [v2.1.2]
|
|
65
|
+
|
|
66
|
+
* History.rdoc, lib/configurability.rb:
|
|
67
|
+
Bump the patch version, update history
|
|
68
|
+
[8ccc787daf98]
|
|
69
|
+
|
|
70
|
+
* spec/configurability/config_spec.rb, spec/configurability_spec.rb:
|
|
71
|
+
Fix deprecated RSpec syntax.
|
|
72
|
+
[7ad723da49ad]
|
|
73
|
+
|
|
74
|
+
* lib/configurability/behavior.rb, lib/configurability/config.rb,
|
|
75
|
+
spec/configurability/config_spec.rb:
|
|
76
|
+
Symbolify keys of defaults for Configurability::Config.new (fixes
|
|
77
|
+
#3).
|
|
78
|
+
[ce20e349d337]
|
|
79
|
+
|
|
80
|
+
2013-11-20 Michael Granger <ged@FaerieMUD.org>
|
|
81
|
+
|
|
82
|
+
* .hgtags:
|
|
83
|
+
Added tag v2.1.1 for changeset 245cf6ed07d1
|
|
84
|
+
[75a393910a7b]
|
|
85
|
+
|
|
86
|
+
* .hgsigs:
|
|
87
|
+
Added signature for changeset 9d24e71e0018
|
|
88
|
+
[245cf6ed07d1] [v2.1.1]
|
|
89
|
+
|
|
90
|
+
* History.rdoc, lib/configurability.rb:
|
|
91
|
+
Bumping patch version, updating history.
|
|
92
|
+
[9d24e71e0018]
|
|
93
|
+
|
|
94
|
+
* .rvm.gems, lib/configurability/config.rb,
|
|
95
|
+
spec/configurability/config_spec.rb:
|
|
96
|
+
Fix untainting to not try to dup/untaint immediate objects.
|
|
97
|
+
|
|
98
|
+
Thanks to john@cozy.co for the bug report.
|
|
99
|
+
[4ba47b11f5ee]
|
|
100
|
+
|
|
101
|
+
2013-09-16 Michael Granger <ged@FaerieMUD.org>
|
|
102
|
+
|
|
103
|
+
* Gemfile, Rakefile:
|
|
104
|
+
Fix typo in hoe-deveiate dependency.
|
|
105
|
+
[e11c77922f80]
|
|
106
|
+
|
|
107
|
+
* .hgignore, .rvm.gems, Gemfile, Rakefile:
|
|
108
|
+
Add Gemfile, update dependencies.
|
|
109
|
+
[8c478c0deb9c]
|
|
110
|
+
|
|
1
111
|
2013-08-13 Michael Granger <ged@FaerieMUD.org>
|
|
2
112
|
|
|
113
|
+
* .hgtags:
|
|
114
|
+
Added tag v2.1.0 for changeset 4070014e656c
|
|
115
|
+
[79688df531ae]
|
|
116
|
+
|
|
117
|
+
* .hgsigs:
|
|
118
|
+
Added signature for changeset d27195f9c3df
|
|
119
|
+
[4070014e656c] [v2.1.0]
|
|
120
|
+
|
|
121
|
+
* History.rdoc, Manifest.txt, README.rdoc, Rakefile,
|
|
122
|
+
lib/configurability.rb, lib/configurability/config.rb:
|
|
123
|
+
Bump minor version; update deps, manifest, and history.
|
|
124
|
+
[d27195f9c3df]
|
|
125
|
+
|
|
3
126
|
* Rakefile, lib/configurability.rb,
|
|
4
127
|
spec/configurability/config_spec.rb, spec/configurability_spec.rb:
|
|
5
128
|
Fix behavior of inherited Configurability
|
|
6
|
-
[9a8961d68e99]
|
|
129
|
+
[9a8961d68e99]
|
|
7
130
|
|
|
8
131
|
* lib/configurability/behavior.rb,
|
|
9
132
|
spec/configurability/config_spec.rb,
|
|
@@ -35,7 +158,7 @@
|
|
|
35
158
|
|
|
36
159
|
* .hgtags:
|
|
37
160
|
Added tag v2.0.1 for changeset c25da00ba16e
|
|
38
|
-
[1aa2c0e1c744]
|
|
161
|
+
[1aa2c0e1c744]
|
|
39
162
|
|
|
40
163
|
* .hgsigs:
|
|
41
164
|
Added signature for changeset bbf0ba1d6deb
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
== v2.2.2 [2016-09-28] Michael Granger <ged@FaerieMUD.org>
|
|
2
|
+
|
|
3
|
+
- Fix the merge used by Configurability.gather_defaults
|
|
4
|
+
It should now correctly merge top-level sections together.
|
|
5
|
+
- Make configuration source logging log at a consistent level.
|
|
6
|
+
|
|
7
|
+
|
|
1
8
|
== v2.2.1 [2014-06-04] Michael Granger <ged@FaerieMUD.org>
|
|
2
9
|
|
|
3
10
|
Update shared behavior to work under RSpec 3.0.0.
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
|
@@ -11,7 +11,6 @@ GEMSPEC = 'configurability.gemspec'
|
|
|
11
11
|
Hoe.plugin :mercurial
|
|
12
12
|
Hoe.plugin :signing
|
|
13
13
|
Hoe.plugin :deveiate
|
|
14
|
-
Hoe.plugin :bundler
|
|
15
14
|
|
|
16
15
|
Hoe.plugins.delete :rubyforge
|
|
17
16
|
|
|
@@ -21,7 +20,7 @@ hoespec = Hoe.spec 'configurability' do |spec|
|
|
|
21
20
|
spec.readme_file = 'README.rdoc'
|
|
22
21
|
spec.history_file = 'History.rdoc'
|
|
23
22
|
spec.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
|
|
24
|
-
spec.license 'BSD'
|
|
23
|
+
spec.license 'BSD-3-Clause'
|
|
25
24
|
|
|
26
25
|
spec.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
|
27
26
|
|
|
@@ -41,7 +40,7 @@ end
|
|
|
41
40
|
ENV['VERSION'] ||= hoespec.spec.version.to_s
|
|
42
41
|
|
|
43
42
|
# Ensure the specs pass before checking in
|
|
44
|
-
task 'hg:precheckin' => [ :check_history, :check_manifest, :spec ]
|
|
43
|
+
task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
|
|
45
44
|
|
|
46
45
|
|
|
47
46
|
desc "Build a coverage report"
|
|
@@ -51,17 +50,34 @@ task :coverage do
|
|
|
51
50
|
end
|
|
52
51
|
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
# Use the fivefish formatter for docs generated from development checkout
|
|
54
|
+
if File.directory?( '.hg' )
|
|
55
|
+
require 'rdoc/task'
|
|
56
|
+
|
|
57
|
+
Rake::Task[ 'docs' ].clear
|
|
58
|
+
RDoc::Task.new( 'docs' ) do |rdoc|
|
|
59
|
+
rdoc.main = "README.md"
|
|
60
|
+
rdoc.rdoc_files.include( "*.rdoc", "*.md", "ChangeLog", "lib/**/*.rb" )
|
|
61
|
+
rdoc.generator = :fivefish
|
|
62
|
+
rdoc.title = 'Configurability'
|
|
63
|
+
rdoc.rdoc_dir = 'doc'
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
task :gemspec => [ 'ChangeLog', GEMSPEC ]
|
|
69
|
+
file GEMSPEC => __FILE__ do |task|
|
|
57
70
|
spec = $hoespec.spec
|
|
58
71
|
spec.files.delete( '.gemtest' )
|
|
72
|
+
spec.files.delete( 'LICENSE' )
|
|
73
|
+
spec.signing_key = nil
|
|
59
74
|
spec.version = "#{spec.version}.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
|
|
75
|
+
spec.cert_chain = [ 'certs/ged.pem' ]
|
|
60
76
|
File.open( task.name, 'w' ) do |fh|
|
|
61
77
|
fh.write( spec.to_ruby )
|
|
62
78
|
end
|
|
63
79
|
end
|
|
80
|
+
CLOBBER.include( GEMSPEC )
|
|
64
81
|
|
|
65
|
-
CLOBBER.include( GEMSPEC.to_s )
|
|
66
82
|
task :default => :gemspec
|
|
67
83
|
|
data/lib/configurability.rb
CHANGED
|
@@ -18,10 +18,10 @@ module Configurability
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
# Library version constant
|
|
21
|
-
VERSION = '2.2.
|
|
21
|
+
VERSION = '2.2.2'
|
|
22
22
|
|
|
23
23
|
# Version-control revision constant
|
|
24
|
-
REVISION = %q$Revision:
|
|
24
|
+
REVISION = %q$Revision: 806d1f512f55 $
|
|
25
25
|
|
|
26
26
|
require 'configurability/deferredconfig'
|
|
27
27
|
|
|
@@ -143,7 +143,7 @@ module Configurability
|
|
|
143
143
|
section = nil
|
|
144
144
|
end
|
|
145
145
|
else
|
|
146
|
-
self.log.
|
|
146
|
+
self.log.debug " no %p section in %p; configuring with nil" % [ section, config ]
|
|
147
147
|
section = nil
|
|
148
148
|
end
|
|
149
149
|
|
|
@@ -168,12 +168,14 @@ module Configurability
|
|
|
168
168
|
### #defaults. The hash for each object will be merged into the +collection+
|
|
169
169
|
### via #merge!.
|
|
170
170
|
def self::gather_defaults( collection={} )
|
|
171
|
+
mergefunc = Configurability::Config.method( :merge_complex_hashes )
|
|
172
|
+
|
|
171
173
|
self.configurable_objects.each do |obj|
|
|
172
174
|
next unless obj.respond_to?( :defaults )
|
|
173
175
|
if subhash = obj.defaults
|
|
174
176
|
section = obj.config_key.to_sym
|
|
175
177
|
Configurability.log.debug "Defaults for %p (%p): %p" % [ obj, section, subhash ]
|
|
176
|
-
collection.merge!( section => subhash )
|
|
178
|
+
collection.merge!( section => subhash, &mergefunc )
|
|
177
179
|
else
|
|
178
180
|
Configurability.log.warn "No defaults for %p; skipping" % [ obj ]
|
|
179
181
|
end
|
|
@@ -59,7 +59,7 @@ class Configurability::Config
|
|
|
59
59
|
### Recursive hash-merge function. Used as the block argument to a Hash#merge.
|
|
60
60
|
def self::merge_complex_hashes( key, oldval, newval )
|
|
61
61
|
return oldval.merge( newval, &method(:merge_complex_hashes) ) if
|
|
62
|
-
oldval.
|
|
62
|
+
oldval.respond_to?( :merge ) && newval.respond_to?( :merge )
|
|
63
63
|
return newval
|
|
64
64
|
end
|
|
65
65
|
|
|
@@ -38,29 +38,23 @@ describe Configurability::Config do
|
|
|
38
38
|
}.gsub(/^\t/, '')
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
before( :all ) do
|
|
42
|
-
setup_logging( :fatal )
|
|
43
|
-
end
|
|
44
41
|
|
|
45
42
|
after( :each ) do
|
|
46
43
|
Configurability.configurable_objects.clear
|
|
47
44
|
Configurability.reset
|
|
48
45
|
end
|
|
49
46
|
|
|
50
|
-
after( :all ) do
|
|
51
|
-
reset_logging()
|
|
52
|
-
end
|
|
53
47
|
|
|
54
48
|
it "can dump itself as YAML" do
|
|
55
|
-
expect(
|
|
49
|
+
expect( described_class.new.dump.strip ).to eq( "--- {}" )
|
|
56
50
|
end
|
|
57
51
|
|
|
58
52
|
it "returns nil as its change description" do
|
|
59
|
-
expect(
|
|
53
|
+
expect( described_class.new.changed_reason ).to be_nil()
|
|
60
54
|
end
|
|
61
55
|
|
|
62
56
|
it "autogenerates accessors for non-existant struct members" do
|
|
63
|
-
config =
|
|
57
|
+
config = described_class.new
|
|
64
58
|
config.plugins ||= {}
|
|
65
59
|
config.plugins.filestore ||= {}
|
|
66
60
|
config.plugins.filestore.maxsize = 1024
|
|
@@ -69,20 +63,20 @@ describe Configurability::Config do
|
|
|
69
63
|
end
|
|
70
64
|
|
|
71
65
|
it "merges values loaded from the config with any defaults given" do
|
|
72
|
-
config =
|
|
66
|
+
config = described_class.new( TEST_CONFIG, :defaultkey => "Oh yeah." )
|
|
73
67
|
|
|
74
68
|
expect( config.defaultkey ).to eq( "Oh yeah." )
|
|
75
69
|
end
|
|
76
70
|
|
|
77
71
|
it "symbolifies keys in defaults (issue #3)" do
|
|
78
|
-
config =
|
|
72
|
+
config = described_class.new( TEST_CONFIG, 'stringkey' => "String value." )
|
|
79
73
|
|
|
80
74
|
expect( config.stringkey ).to eq( "String value." )
|
|
81
75
|
end
|
|
82
76
|
|
|
83
77
|
it "yields itself if a block is given at creation" do
|
|
84
78
|
yielded_self = nil
|
|
85
|
-
config =
|
|
79
|
+
config = described_class.new { yielded_self = self }
|
|
86
80
|
|
|
87
81
|
expect( yielded_self ).to equal( config )
|
|
88
82
|
end
|
|
@@ -90,7 +84,7 @@ describe Configurability::Config do
|
|
|
90
84
|
it "passes itself as the block argument if a block of arity 1 is given at creation" do
|
|
91
85
|
arg_self = nil
|
|
92
86
|
yielded_self = nil
|
|
93
|
-
config =
|
|
87
|
+
config = described_class.new do |arg|
|
|
94
88
|
yielded_self = self
|
|
95
89
|
arg_self = arg
|
|
96
90
|
end
|
|
@@ -100,13 +94,13 @@ describe Configurability::Config do
|
|
|
100
94
|
end
|
|
101
95
|
|
|
102
96
|
it "supports both Symbols and Strings for Hash-like access" do
|
|
103
|
-
config =
|
|
97
|
+
config = described_class.new( TEST_CONFIG )
|
|
104
98
|
|
|
105
99
|
expect( config[:section]['subsection'][:subsubsection] ).to eq( 'value' )
|
|
106
100
|
end
|
|
107
101
|
|
|
108
102
|
it "autoloads predicates for its members" do
|
|
109
|
-
config =
|
|
103
|
+
config = described_class.new( TEST_CONFIG )
|
|
110
104
|
|
|
111
105
|
expect( config.mergekey? ).to be_truthy()
|
|
112
106
|
expect( config.mergemonkey? ).to be_falsey()
|
|
@@ -137,7 +131,7 @@ describe Configurability::Config do
|
|
|
137
131
|
- pattern2
|
|
138
132
|
}.gsub(/^\t{2}/, '')
|
|
139
133
|
|
|
140
|
-
let( :config ) {
|
|
134
|
+
let( :config ) { described_class.new(NIL_KEY_CONFIG) }
|
|
141
135
|
|
|
142
136
|
it "doesn't raise a NoMethodError when loading (issue #1)" do
|
|
143
137
|
val = config[:trap_on]['low disk space alert'][nil][:notepad][:patterns]
|
|
@@ -154,7 +148,7 @@ describe Configurability::Config do
|
|
|
154
148
|
|
|
155
149
|
context "created with in-memory YAML source" do
|
|
156
150
|
|
|
157
|
-
let( :config ) {
|
|
151
|
+
let( :config ) { described_class.new(TEST_CONFIG) }
|
|
158
152
|
|
|
159
153
|
it "responds to methods which are the same as struct members" do
|
|
160
154
|
expect( config ).to respond_to( :section )
|
|
@@ -224,7 +218,7 @@ describe Configurability::Config do
|
|
|
224
218
|
# saving if changed since loaded
|
|
225
219
|
context " whose internal values have been changed since loaded" do
|
|
226
220
|
let( :config ) do
|
|
227
|
-
config =
|
|
221
|
+
config = described_class.new( TEST_CONFIG )
|
|
228
222
|
config.section.subsection.anothersection = 11451
|
|
229
223
|
config
|
|
230
224
|
end
|
|
@@ -253,7 +247,7 @@ describe Configurability::Config do
|
|
|
253
247
|
@tmpfile.unlink
|
|
254
248
|
end
|
|
255
249
|
|
|
256
|
-
let( :config ) {
|
|
250
|
+
let( :config ) { described_class.load(@tmpfile.to_s) }
|
|
257
251
|
|
|
258
252
|
|
|
259
253
|
### Specifications
|
|
@@ -264,7 +258,7 @@ describe Configurability::Config do
|
|
|
264
258
|
it "writes itself back to the same file by default" do
|
|
265
259
|
config.port = 114411
|
|
266
260
|
config.write
|
|
267
|
-
otherconfig =
|
|
261
|
+
otherconfig = described_class.load( @tmpfile.to_s )
|
|
268
262
|
|
|
269
263
|
expect( otherconfig.port ).to eq( 114411 )
|
|
270
264
|
end
|
|
@@ -286,7 +280,7 @@ describe Configurability::Config do
|
|
|
286
280
|
|
|
287
281
|
it "yields itself if a block is given at load-time" do
|
|
288
282
|
yielded_self = nil
|
|
289
|
-
config =
|
|
283
|
+
config = described_class.load( @tmpfile.to_s ) do
|
|
290
284
|
yielded_self = self
|
|
291
285
|
end
|
|
292
286
|
expect( yielded_self ).to equal( config )
|
|
@@ -295,7 +289,7 @@ describe Configurability::Config do
|
|
|
295
289
|
it "passes itself as the block argument if a block of arity 1 is given at load-time" do
|
|
296
290
|
arg_self = nil
|
|
297
291
|
yielded_self = nil
|
|
298
|
-
config =
|
|
292
|
+
config = described_class.load( @tmpfile.to_s ) do |arg|
|
|
299
293
|
yielded_self = self
|
|
300
294
|
arg_self = arg
|
|
301
295
|
end
|
|
@@ -328,7 +322,7 @@ describe Configurability::Config do
|
|
|
328
322
|
before( :each ) do
|
|
329
323
|
old_date = Time.now - 3600
|
|
330
324
|
File.utime( old_date, old_date, @tmpfile.to_s )
|
|
331
|
-
@config =
|
|
325
|
+
@config = described_class.load( @tmpfile.to_s )
|
|
332
326
|
now = Time.now + 10
|
|
333
327
|
File.utime( now, now, @tmpfile.to_s )
|
|
334
328
|
end
|
|
@@ -350,7 +344,7 @@ describe Configurability::Config do
|
|
|
350
344
|
end
|
|
351
345
|
|
|
352
346
|
it "reapplies its defaults when reloading" do
|
|
353
|
-
@config =
|
|
347
|
+
@config = described_class.load( @tmpfile.to_s, :defaultskey => 8 )
|
|
354
348
|
@config.reload
|
|
355
349
|
|
|
356
350
|
expect( @config.defaultskey ).to eq( 8 )
|
|
@@ -360,15 +354,27 @@ describe Configurability::Config do
|
|
|
360
354
|
|
|
361
355
|
# merging
|
|
362
356
|
context " created by merging two other configs" do
|
|
363
|
-
let( :config1 ) { Configurability::Config.new }
|
|
364
|
-
let( :config2 ) { Configurability::Config.new(TEST_CONFIG) }
|
|
365
|
-
let( :merged ) { config1.merge(config2) }
|
|
366
357
|
|
|
367
358
|
|
|
368
359
|
### Specifications
|
|
369
|
-
it "
|
|
360
|
+
it "contains values from both" do
|
|
361
|
+
config1 = described_class.new
|
|
362
|
+
config2 = described_class.new( TEST_CONFIG )
|
|
363
|
+
merged = config1.merge(config2)
|
|
364
|
+
|
|
370
365
|
expect( merged.mergekey ).to eq( config2.mergekey )
|
|
371
366
|
end
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
it "recursively merges shared sub-sections" do
|
|
370
|
+
config1 = described_class.new( manager: {state_file: '/tmp/manager.state'} )
|
|
371
|
+
config2 = described_class.new( manager: {port: 1200} )
|
|
372
|
+
merged = config1.merge( config2 )
|
|
373
|
+
|
|
374
|
+
expect( merged.manager.state_file ).to eq( '/tmp/manager.state' )
|
|
375
|
+
expect( merged.manager.port ).to eq( 1200 )
|
|
376
|
+
end
|
|
377
|
+
|
|
372
378
|
end
|
|
373
379
|
|
|
374
380
|
end
|
|
@@ -16,9 +16,6 @@ require 'configurability/deferredconfig'
|
|
|
16
16
|
#####################################################################
|
|
17
17
|
describe Configurability::DeferredConfig do
|
|
18
18
|
|
|
19
|
-
before( :all ) do
|
|
20
|
-
setup_logging( :fatal )
|
|
21
|
-
end
|
|
22
19
|
|
|
23
20
|
after( :each ) do
|
|
24
21
|
Configurability.configurable_objects.clear
|
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: 2.2.
|
|
4
|
+
version: 2.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Granger
|
|
@@ -10,152 +10,157 @@ bindir: bin
|
|
|
10
10
|
cert_chain:
|
|
11
11
|
- |
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
|
13
|
-
|
|
13
|
+
MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQsFADA+MQwwCgYDVQQDDANnZWQx
|
|
14
14
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
|
15
|
-
|
|
15
|
+
HhcNMTYwODIwMTgxNzQyWhcNMTcwODIwMTgxNzQyWjA+MQwwCgYDVQQDDANnZWQx
|
|
16
16
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/JWGRHO+USzR97vXjkFgt
|
|
18
|
+
83qeNf2KHkcvrRTSnR64i6um/ziin0I0oX23H7VYrDJC9A/uoUa5nGRJS5Zw/+wW
|
|
19
|
+
ENcvWVZS4iUzi4dsYJGY6yEOsXh2CcF46+QevV8iE+UmbkU75V7Dy1JCaUOyizEt
|
|
20
|
+
TH5UHsOtUU7k9TYARt/TgYZKuaoAMZZd5qyVqhF1vV+7/Qzmp89NGflXf2xYP26a
|
|
21
|
+
4MAX2qqKX/FKXqmFO+AGsbwYTEds1mksBF3fGsFgsQWxftG8GfZQ9+Cyu2+l1eOw
|
|
22
|
+
cZ+lPcg834G9DrqW2zhqUoLr1MTly4pqxYGb7XoDhoR7dd1kFE2a067+DzWC/ADt
|
|
23
|
+
+QkcqWUm5oh1fN0eqr7NsZlVJDulFgdiiYPQiIN7UNsii4Wc9aZqBoGcYfBeQNPZ
|
|
24
|
+
soo/6za/bWajOKUmDhpqvaiRv9EDpVLzuj53uDoukMMwxCMfgb04+ckQ0t2G7wqc
|
|
25
|
+
/D+K9JW9DDs3Yjgv9k4h7YMhW5gftosd+NkNC/+Y2CkCAwEAAaN1MHMwCQYDVR0T
|
|
26
|
+
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFHKN/nkRusdqCJEuq3lgB3fJvyTg
|
|
27
|
+
MBwGA1UdEQQVMBOBEWdlZEBGYWVyaWVNVUQub3JnMBwGA1UdEgQVMBOBEWdlZEBG
|
|
28
|
+
YWVyaWVNVUQub3JnMA0GCSqGSIb3DQEBCwUAA4IBgQAPJzKiT0zBU7kpqe0aS2qb
|
|
29
|
+
FI0PJ4y5I8buU4IZGUD5NEt/N7pZNfOyBxkrZkXhS44Fp+xwBH5ebLbq/WY78Bqd
|
|
30
|
+
db0z6ZgW4LMYMpWFfbXsRbd9TU2f52L8oMAhxOvF7Of5qJMVWuFQ8FPagk2iHrdH
|
|
31
|
+
inYLQagqAF6goWTXgAJCdPd6SNeeSNqA6vlY7CV1Jh5kfNJJ6xu/CVij1GzCLu/5
|
|
32
|
+
DMOr26DBv+qLJRRC/2h34uX71q5QgeOyxvMg+7V3u/Q06DXyQ2VgeeqiwDFFpEH0
|
|
33
|
+
PFkdPO6ZqbTRcLfNH7mFgCBJjsfSjJrn0sPBlYyOXgCoByfZnZyrIMH/UY+lgQqS
|
|
34
|
+
6Von1VDsfQm0eJh5zYZD64ZF86phSR7mUX3mXItwH04HrZwkWpvgd871DZVR3i1n
|
|
35
|
+
w8aNA5re5+Rt/Vvjxj5AcEnZnZiz5x959NaddQocX32Z1unHw44pzRNUur1GInfW
|
|
36
|
+
p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
|
|
32
37
|
-----END CERTIFICATE-----
|
|
33
|
-
date:
|
|
38
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
|
34
39
|
dependencies:
|
|
35
40
|
- !ruby/object:Gem::Dependency
|
|
36
41
|
name: loggability
|
|
37
42
|
requirement: !ruby/object:Gem::Requirement
|
|
38
43
|
requirements:
|
|
39
|
-
- - ~>
|
|
44
|
+
- - "~>"
|
|
40
45
|
- !ruby/object:Gem::Version
|
|
41
46
|
version: '0.11'
|
|
42
47
|
type: :runtime
|
|
43
48
|
prerelease: false
|
|
44
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
45
50
|
requirements:
|
|
46
|
-
- - ~>
|
|
51
|
+
- - "~>"
|
|
47
52
|
- !ruby/object:Gem::Version
|
|
48
53
|
version: '0.11'
|
|
49
54
|
- !ruby/object:Gem::Dependency
|
|
50
55
|
name: hoe-mercurial
|
|
51
56
|
requirement: !ruby/object:Gem::Requirement
|
|
52
57
|
requirements:
|
|
53
|
-
- - ~>
|
|
58
|
+
- - "~>"
|
|
54
59
|
- !ruby/object:Gem::Version
|
|
55
60
|
version: '1.4'
|
|
56
61
|
type: :development
|
|
57
62
|
prerelease: false
|
|
58
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
64
|
requirements:
|
|
60
|
-
- - ~>
|
|
65
|
+
- - "~>"
|
|
61
66
|
- !ruby/object:Gem::Version
|
|
62
67
|
version: '1.4'
|
|
63
68
|
- !ruby/object:Gem::Dependency
|
|
64
|
-
name: hoe-
|
|
69
|
+
name: hoe-highline
|
|
65
70
|
requirement: !ruby/object:Gem::Requirement
|
|
66
71
|
requirements:
|
|
67
|
-
- - ~>
|
|
72
|
+
- - "~>"
|
|
68
73
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '0.
|
|
74
|
+
version: '0.2'
|
|
70
75
|
type: :development
|
|
71
76
|
prerelease: false
|
|
72
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
78
|
requirements:
|
|
74
|
-
- - ~>
|
|
79
|
+
- - "~>"
|
|
75
80
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '0.
|
|
81
|
+
version: '0.2'
|
|
77
82
|
- !ruby/object:Gem::Dependency
|
|
78
|
-
name:
|
|
83
|
+
name: rdoc
|
|
79
84
|
requirement: !ruby/object:Gem::Requirement
|
|
80
85
|
requirements:
|
|
81
|
-
- - ~>
|
|
86
|
+
- - "~>"
|
|
82
87
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: '0
|
|
88
|
+
version: '4.0'
|
|
84
89
|
type: :development
|
|
85
90
|
prerelease: false
|
|
86
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
87
92
|
requirements:
|
|
88
|
-
- - ~>
|
|
93
|
+
- - "~>"
|
|
89
94
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: '0
|
|
95
|
+
version: '4.0'
|
|
91
96
|
- !ruby/object:Gem::Dependency
|
|
92
|
-
name:
|
|
97
|
+
name: hoe-deveiate
|
|
93
98
|
requirement: !ruby/object:Gem::Requirement
|
|
94
99
|
requirements:
|
|
95
|
-
- - ~>
|
|
100
|
+
- - "~>"
|
|
96
101
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: '
|
|
102
|
+
version: '0.5'
|
|
98
103
|
type: :development
|
|
99
104
|
prerelease: false
|
|
100
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
101
106
|
requirements:
|
|
102
|
-
- - ~>
|
|
107
|
+
- - "~>"
|
|
103
108
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '
|
|
109
|
+
version: '0.5'
|
|
105
110
|
- !ruby/object:Gem::Dependency
|
|
106
111
|
name: simplecov
|
|
107
112
|
requirement: !ruby/object:Gem::Requirement
|
|
108
113
|
requirements:
|
|
109
|
-
- - ~>
|
|
114
|
+
- - "~>"
|
|
110
115
|
- !ruby/object:Gem::Version
|
|
111
116
|
version: '0.8'
|
|
112
117
|
type: :development
|
|
113
118
|
prerelease: false
|
|
114
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
115
120
|
requirements:
|
|
116
|
-
- - ~>
|
|
121
|
+
- - "~>"
|
|
117
122
|
- !ruby/object:Gem::Version
|
|
118
123
|
version: '0.8'
|
|
119
124
|
- !ruby/object:Gem::Dependency
|
|
120
125
|
name: hoe-bundler
|
|
121
126
|
requirement: !ruby/object:Gem::Requirement
|
|
122
127
|
requirements:
|
|
123
|
-
- - ~>
|
|
128
|
+
- - "~>"
|
|
124
129
|
- !ruby/object:Gem::Version
|
|
125
130
|
version: '1.2'
|
|
126
131
|
type: :development
|
|
127
132
|
prerelease: false
|
|
128
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
129
134
|
requirements:
|
|
130
|
-
- - ~>
|
|
135
|
+
- - "~>"
|
|
131
136
|
- !ruby/object:Gem::Version
|
|
132
137
|
version: '1.2'
|
|
133
138
|
- !ruby/object:Gem::Dependency
|
|
134
139
|
name: rspec
|
|
135
140
|
requirement: !ruby/object:Gem::Requirement
|
|
136
141
|
requirements:
|
|
137
|
-
- - ~>
|
|
142
|
+
- - "~>"
|
|
138
143
|
- !ruby/object:Gem::Version
|
|
139
144
|
version: '3.0'
|
|
140
145
|
type: :development
|
|
141
146
|
prerelease: false
|
|
142
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
143
148
|
requirements:
|
|
144
|
-
- - ~>
|
|
149
|
+
- - "~>"
|
|
145
150
|
- !ruby/object:Gem::Version
|
|
146
151
|
version: '3.0'
|
|
147
152
|
- !ruby/object:Gem::Dependency
|
|
148
153
|
name: hoe
|
|
149
154
|
requirement: !ruby/object:Gem::Requirement
|
|
150
155
|
requirements:
|
|
151
|
-
- - ~>
|
|
156
|
+
- - "~>"
|
|
152
157
|
- !ruby/object:Gem::Version
|
|
153
158
|
version: '3.12'
|
|
154
159
|
type: :development
|
|
155
160
|
prerelease: false
|
|
156
161
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
162
|
requirements:
|
|
158
|
-
- - ~>
|
|
163
|
+
- - "~>"
|
|
159
164
|
- !ruby/object:Gem::Version
|
|
160
165
|
version: '3.12'
|
|
161
166
|
description: |-
|
|
@@ -174,7 +179,7 @@ extra_rdoc_files:
|
|
|
174
179
|
- Manifest.txt
|
|
175
180
|
- README.rdoc
|
|
176
181
|
files:
|
|
177
|
-
- .gemtest
|
|
182
|
+
- ".gemtest"
|
|
178
183
|
- ChangeLog
|
|
179
184
|
- History.rdoc
|
|
180
185
|
- LICENSE
|
|
@@ -194,27 +199,27 @@ files:
|
|
|
194
199
|
- spec/helpers.rb
|
|
195
200
|
homepage: https://bitbucket.org/ged/configurability
|
|
196
201
|
licenses:
|
|
197
|
-
- BSD
|
|
202
|
+
- BSD-3-Clause
|
|
198
203
|
metadata: {}
|
|
199
204
|
post_install_message:
|
|
200
205
|
rdoc_options:
|
|
201
|
-
- --main
|
|
206
|
+
- "--main"
|
|
202
207
|
- README.rdoc
|
|
203
208
|
require_paths:
|
|
204
209
|
- lib
|
|
205
210
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
211
|
requirements:
|
|
207
|
-
- -
|
|
212
|
+
- - ">="
|
|
208
213
|
- !ruby/object:Gem::Version
|
|
209
214
|
version: 1.9.2
|
|
210
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
216
|
requirements:
|
|
212
|
-
- -
|
|
217
|
+
- - ">="
|
|
213
218
|
- !ruby/object:Gem::Version
|
|
214
219
|
version: '0'
|
|
215
220
|
requirements: []
|
|
216
221
|
rubyforge_project:
|
|
217
|
-
rubygems_version: 2.
|
|
222
|
+
rubygems_version: 2.6.6
|
|
218
223
|
signing_key:
|
|
219
224
|
specification_version: 4
|
|
220
225
|
summary: Configurability is a unified, unintrusive, assume-nothing configuration system
|
metadata.gz.sig
CHANGED
|
Binary file
|