configurability 2.1.0 → 2.1.1
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.rdoc +6 -0
- data/Rakefile +14 -13
- data/lib/configurability.rb +2 -2
- data/lib/configurability/config.rb +22 -15
- data/spec/configurability/config_spec.rb +14 -1
- metadata +22 -10
- 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: 06d07154d070a00edad0282c0dc59e0c5e66ef95
|
4
|
+
data.tar.gz: a4b60f5580fd34ca3d8d84adc19628381fb2c640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d72df2c94b3d9d35fa8ec2b7485ca54c7c99a0f24fc061c6bf21c8c1f6d16a4f6e66aa8a2c87c6b988bf8e55168e7c805453a5a8f696656fefadd332101d993a
|
7
|
+
data.tar.gz: 0e9900c3689b65a0e4d5c6e63e66a953bace0b1f2cc94735369cdc6406756c8def7c60fe803fd2cddace09298816a6c3a4443d2f13253b1825f8238ecbcb7ea3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== v2.1.1 [2013-11-20] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
- Fix untainting to not try to dup/untaint immediate objects.
|
4
|
+
Thanks to john@cozy.co for the bug report.
|
5
|
+
|
6
|
+
|
1
7
|
== v2.1.0 [2013-08-13] Michael Granger <ged@FaerieMUD.org>
|
2
8
|
|
3
9
|
- Fix behavior of inherited Configurability
|
data/Rakefile
CHANGED
@@ -10,29 +10,30 @@ end
|
|
10
10
|
Hoe.plugin :mercurial
|
11
11
|
Hoe.plugin :signing
|
12
12
|
Hoe.plugin :deveiate
|
13
|
+
Hoe.plugin :bundler
|
13
14
|
|
14
15
|
Hoe.plugins.delete :rubyforge
|
15
16
|
|
16
17
|
Encoding.default_internal = Encoding::UTF_8
|
17
18
|
|
18
|
-
hoespec = Hoe.spec 'configurability' do
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
hoespec = Hoe.spec 'configurability' do |spec|
|
20
|
+
spec.readme_file = 'README.rdoc'
|
21
|
+
spec.history_file = 'History.rdoc'
|
22
|
+
spec.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
|
23
|
+
spec.license 'BSD'
|
22
24
|
|
23
|
-
|
25
|
+
spec.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
24
26
|
|
25
|
-
|
27
|
+
spec.dependency 'loggability', '~> 0.4'
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
spec.dependency 'hoe-deveiate', '~> 0.3', :developer
|
30
|
+
spec.dependency 'simplecov', '~> 0.5', :developer
|
31
|
+
spec.dependency 'hoe-bundler', '~> 1.2', :developer
|
29
32
|
|
30
|
-
|
31
|
-
self.spec_extras[:rdoc_options] = ['-f', 'fivefish', '-t', 'Configurability Toolkit']
|
32
|
-
self.require_ruby_version( '>= 1.9.2' )
|
33
|
+
spec.require_ruby_version( '>= 1.9.2' )
|
33
34
|
|
34
|
-
|
35
|
-
|
35
|
+
spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
|
36
|
+
spec.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
|
36
37
|
end
|
37
38
|
|
38
39
|
ENV['VERSION'] ||= hoespec.spec.version.to_s
|
data/lib/configurability.rb
CHANGED
@@ -18,10 +18,10 @@ module Configurability
|
|
18
18
|
|
19
19
|
|
20
20
|
# Library version constant
|
21
|
-
VERSION = '2.1.
|
21
|
+
VERSION = '2.1.1'
|
22
22
|
|
23
23
|
# Version-control revision constant
|
24
|
-
REVISION = %q$Revision:
|
24
|
+
REVISION = %q$Revision: 9d24e71e0018 $
|
25
25
|
|
26
26
|
require 'configurability/deferredconfig'
|
27
27
|
|
@@ -250,7 +250,7 @@ class Configurability::Config
|
|
250
250
|
else
|
251
251
|
YAML.load( source )
|
252
252
|
end
|
253
|
-
ihash = symbolify_keys(
|
253
|
+
ihash = symbolify_keys( untaint_hash(hash) )
|
254
254
|
mergedhash = defaults.merge( ihash, &mergefunc )
|
255
255
|
|
256
256
|
return Configurability::Config::Struct.new( mergedhash )
|
@@ -283,27 +283,34 @@ class Configurability::Config
|
|
283
283
|
|
284
284
|
### Return a copy of the specified +hash+ with all of its values
|
285
285
|
### untainted.
|
286
|
-
def
|
286
|
+
def untaint_hash( hash )
|
287
287
|
newhash = {}
|
288
|
-
hash.
|
289
|
-
|
290
|
-
|
291
|
-
|
288
|
+
hash.each_key do |key|
|
289
|
+
newhash[ key ] = untaint_value( hash[key] )
|
290
|
+
end
|
291
|
+
return newhash
|
292
|
+
end
|
292
293
|
|
293
|
-
when Array
|
294
|
-
newval = val.collect {|v| v.dup.untaint}
|
295
|
-
newhash[ key ] = newval
|
296
294
|
|
297
|
-
|
298
|
-
|
295
|
+
### Return an untainted copy of the specified +val+.
|
296
|
+
def untaint_value( val )
|
297
|
+
case val
|
298
|
+
when Hash
|
299
|
+
return untaint_hash( val )
|
300
|
+
|
301
|
+
when Array
|
302
|
+
return val.collect {|v| untaint_value(v) }
|
303
|
+
|
304
|
+
when NilClass, TrueClass, FalseClass, Numeric, Symbol, Encoding
|
305
|
+
return val
|
299
306
|
|
307
|
+
else
|
308
|
+
if val.respond_to?( :dup ) && val.respond_to?( :untaint )
|
309
|
+
return val.dup.untaint
|
300
310
|
else
|
301
|
-
|
302
|
-
newval.untaint
|
303
|
-
newhash[ key ] = newval
|
311
|
+
return val
|
304
312
|
end
|
305
313
|
end
|
306
|
-
return newhash
|
307
314
|
end
|
308
315
|
|
309
316
|
|
@@ -25,6 +25,12 @@ describe Configurability::Config do
|
|
25
25
|
- values
|
26
26
|
- are
|
27
27
|
- neat
|
28
|
+
listofints:
|
29
|
+
- 1
|
30
|
+
- 2
|
31
|
+
- 3
|
32
|
+
- 5
|
33
|
+
- 7
|
28
34
|
mergekey: Yep.
|
29
35
|
textsection: |-
|
30
36
|
With some text as the value
|
@@ -104,6 +110,13 @@ describe Configurability::Config do
|
|
104
110
|
expect( config.section.monkeysubsection? ).to be_false()
|
105
111
|
end
|
106
112
|
|
113
|
+
it "untaints values loaded from a config" do
|
114
|
+
yaml = TEST_CONFIG.dup.taint
|
115
|
+
config = described_class.new( yaml )
|
116
|
+
expect( config.listsection.first ).to_not be_tainted
|
117
|
+
expect( config.textsection ).to_not be_tainted
|
118
|
+
end
|
119
|
+
|
107
120
|
|
108
121
|
context "a config with nil keys" do
|
109
122
|
|
@@ -187,7 +200,7 @@ describe Configurability::Config do
|
|
187
200
|
end
|
188
201
|
|
189
202
|
it "provides a human-readable description of itself when inspected" do
|
190
|
-
expect( config.inspect ).to match(
|
203
|
+
expect( config.inspect ).to match( /\d+ sections/i )
|
191
204
|
expect( config.inspect ).to match( /mergekey/ )
|
192
205
|
expect( config.inspect ).to match( /textsection/ )
|
193
206
|
expect( config.inspect ).to match( /from memory/i )
|
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.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
|
31
31
|
/YSusaiDXHKU2O3Akc3htA==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2013-
|
33
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: loggability
|
@@ -89,19 +89,19 @@ dependencies:
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '4.0'
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
92
|
+
name: hoe-deveiate
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '0.3'
|
98
98
|
type: :development
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ~>
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
104
|
+
version: '0.3'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: simplecov
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +116,20 @@ dependencies:
|
|
116
116
|
- - ~>
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0.5'
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: hoe-bundler
|
121
|
+
requirement: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1.2'
|
126
|
+
type: :development
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '1.2'
|
119
133
|
- !ruby/object:Gem::Dependency
|
120
134
|
name: hoe
|
121
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,10 +184,8 @@ licenses:
|
|
170
184
|
metadata: {}
|
171
185
|
post_install_message:
|
172
186
|
rdoc_options:
|
173
|
-
-
|
174
|
-
-
|
175
|
-
- -t
|
176
|
-
- Configurability Toolkit
|
187
|
+
- --main
|
188
|
+
- README.rdoc
|
177
189
|
require_paths:
|
178
190
|
- lib
|
179
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -188,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
200
|
version: '0'
|
189
201
|
requirements: []
|
190
202
|
rubyforge_project: configurability
|
191
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.1.10
|
192
204
|
signing_key:
|
193
205
|
specification_version: 4
|
194
206
|
summary: Configurability is a unified, unintrusive, assume-nothing configuration system
|
metadata.gz.sig
CHANGED
Binary file
|