configurability 2.1.2 → 2.2.0

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: 17a4c6df3cb0a6943ed03e5dbcd4947b1cade237
4
- data.tar.gz: fcb169f4effc4a6230ef6ce25d43687dcead2e1c
3
+ metadata.gz: e20c53d95f82bf536b091f4076ecb2500e86f50a
4
+ data.tar.gz: 88cd57ee350ff322fa6aab8681c8c1568348c4ed
5
5
  SHA512:
6
- metadata.gz: fb1529ea0da93d38299926bb04cf6b2d45fb7b2414147455d771e0ca11418d9107750aaaf33541c96ceec2a26930ed5ded8d77202e3a04dbd99db1aa8bff384c
7
- data.tar.gz: 1f3b8b3a8426134c7d8dcee6ef86909d3e8c09784cfcbbaf500527d08bf4f796fd317a9fc4ae405a8b642168b1d99c2a716377d6b6f129ea53b635caf36c0e76
6
+ metadata.gz: 7977fc61c2a3cd943e8cc762b5b94751b55cb267bd8be482001acea0736cf318fc2d9c3f12df1811741e597c1f63ebf6c299c6a88b338373657a94b38158dce8
7
+ data.tar.gz: 659341e2d540ed698d704537b60b28d213430b0ad962dec659b30f55e3a001b682ebb8afe919ebb99fa68306783bd89c8594bd941910481cf9ab0c376cd8a8ba
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == v2.2.0 [2014-05-19] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Add a .default_config method to objects with Configurability.
4
+
5
+
1
6
  == v2.1.2 [2014-01-20] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  Symbolify keys of defaults for Configurability::Config.new (fixes #3).
data/Rakefile CHANGED
@@ -6,6 +6,7 @@ rescue LoadError
6
6
  abort "This Rakefile requires 'hoe' (gem install hoe)"
7
7
  end
8
8
 
9
+ GEMSPEC = 'configurability.gemspec'
9
10
 
10
11
  Hoe.plugin :mercurial
11
12
  Hoe.plugin :signing
@@ -29,6 +30,7 @@ hoespec = Hoe.spec 'configurability' do |spec|
29
30
  spec.dependency 'hoe-deveiate', '~> 0.3', :developer
30
31
  spec.dependency 'simplecov', '~> 0.5', :developer
31
32
  spec.dependency 'hoe-bundler', '~> 1.2', :developer
33
+ spec.dependency 'rspec', '3.0.0.beta2', :developer
32
34
 
33
35
  spec.require_ruby_version( '>= 1.9.2' )
34
36
 
@@ -48,3 +50,18 @@ task :coverage do
48
50
  Rake::Task[:spec].invoke
49
51
  end
50
52
 
53
+
54
+ task :gemspec => GEMSPEC
55
+ file GEMSPEC => __FILE__
56
+ task GEMSPEC do |task|
57
+ spec = $hoespec.spec
58
+ spec.files.delete( '.gemtest' )
59
+ spec.version = "#{spec.version}.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
60
+ File.open( task.name, 'w' ) do |fh|
61
+ fh.write( spec.to_ruby )
62
+ end
63
+ end
64
+
65
+ CLOBBER.include( GEMSPEC.to_s )
66
+ task :default => :gemspec
67
+
data/bin/configurability CHANGED
File without changes
@@ -18,10 +18,10 @@ module Configurability
18
18
 
19
19
 
20
20
  # Library version constant
21
- VERSION = '2.1.2'
21
+ VERSION = '2.2.0'
22
22
 
23
23
  # Version-control revision constant
24
- REVISION = %q$Revision: 8ccc787daf98 $
24
+ REVISION = %q$Revision: 7ecaadfcf254 $
25
25
 
26
26
  require 'configurability/deferredconfig'
27
27
 
@@ -243,6 +243,15 @@ module Configurability
243
243
  end
244
244
  end
245
245
 
246
+
247
+ ### Return a Configurability::Config object that contains the configuration
248
+ ### defaults for the receiver.
249
+ def default_config
250
+ default_values = self.defaults or return Configurability::Config.new( {} )
251
+ return Configurability::Config::Struct.new( default_values )
252
+ end
253
+
254
+
246
255
  ### Inject Configurability support into Loggability to avoid circular dependency
247
256
  ### load issues.
248
257
  Loggability.extend( self )
@@ -244,11 +244,18 @@ class Configurability::Config
244
244
  def make_configstruct_from_source( source, defaults=nil )
245
245
  defaults ||= {}
246
246
  mergefunc = Configurability::Config.method( :merge_complex_hashes )
247
- hash = if defined?( SafeYAML ) then
247
+ hash = nil
248
+
249
+ if source.is_a?( Hash )
250
+ hash = source
251
+ else
252
+ hash = if defined?( SafeYAML ) then
248
253
  YAML.load( source, :safe => true )
249
254
  else
250
255
  YAML.load( source )
251
256
  end
257
+ end
258
+
252
259
  ihash = symbolify_keys( untaint_hash(hash) )
253
260
  idefaults = symbolify_keys( defaults )
254
261
  mergedhash = idefaults.merge( ihash, &mergefunc )
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.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -12,7 +12,7 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
14
14
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
15
- HhcNMTMwMjI3MTY0ODU4WhcNMTQwMjI3MTY0ODU4WjA+MQwwCgYDVQQDDANnZWQx
15
+ HhcNMTQwMzE5MDQzNTI2WhcNMTUwMzE5MDQzNTI2WjA+MQwwCgYDVQQDDANnZWQx
16
16
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
17
17
  ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDb92mkyYwuGBg1oRxt2tkH
18
18
  +Uo3LAsaL/APBfSLzy8o3+B3AUHKCjMUaVeBoZdWtMHB75X3VQlvXfZMyBxj59Vo
@@ -23,14 +23,14 @@ cert_chain:
23
23
  AgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSZ0hCV
24
24
  qoHr122fGKelqffzEQBhszAcBgNVHREEFTATgRFnZWRARmFlcmllTVVELm9yZzAc
25
25
  BgNVHRIEFTATgRFnZWRARmFlcmllTVVELm9yZzANBgkqhkiG9w0BAQUFAAOCAQEA
26
- Vlcfyq6GwyE8i0QuFPCeVOwJaneSvcwx316DApjy9/tt2YD2HomLbtpXtji5QXor
27
- ON6oln4tWBIB3Klbr3szq5oR3Rc1D02SaBTalxSndp4M6UkW9hRFu5jn98pDB4fq
28
- 5l8wMMU0Xdmqx1VYvysVAjVFVC/W4NNvlmg+2mEgSVZP5K6Tc9qDh3eMQInoYw6h
29
- t1YA6RsUJHp5vGQyhP1x34YpLAaly8icbns/8PqOf7Osn9ztmg8bOMJCeb32eQLj
30
- 6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
31
- /YSusaiDXHKU2O3Akc3htA==
26
+ TuL1Bzl6TBs1YEzEubFHb9XAPgehWzzUudjDKzTRd+uyZmxnomBqTCQjT5ucNRph
27
+ 3jZ6bhLNooLQxTjIuHodeGcEMHZdt4Yi7SyPmw5Nry12z6wrDp+5aGps3HsE5WsQ
28
+ Zq2EuyEOc96g31uoIvjNdieKs+1kE+K+dJDjtw+wTH2i63P7r6N/NfPPXpxsFquo
29
+ wcYRRrHdR7GhdJeT+V8Q8Bi5bglCUGdx+8scMgkkePc98k9osQHypbACmzO+Bqkv
30
+ c7ZKPJcWBv0sm81+FCZXNACn2f9jfF8OQinxVs0O052KbGuEQaaiGIYeuuwQE2q6
31
+ ggcrPfcYeTwWlfZPu2LrBg==
32
32
  -----END CERTIFICATE-----
33
- date: 2014-01-21 00:00:00.000000000 Z
33
+ date: 2014-05-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: loggability
@@ -52,56 +52,56 @@ dependencies:
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: 1.4.0
55
+ version: '1.4'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 1.4.0
62
+ version: '1.4'
63
63
  - !ruby/object:Gem::Dependency
64
- name: hoe-highline
64
+ name: hoe-deveiate
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.1.0
69
+ version: '0.5'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: 0.1.0
76
+ version: '0.5'
77
77
  - !ruby/object:Gem::Dependency
78
- name: rdoc
78
+ name: hoe-highline
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
- version: '4.0'
83
+ version: '0.2'
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ~>
89
89
  - !ruby/object:Gem::Version
90
- version: '4.0'
90
+ version: '0.2'
91
91
  - !ruby/object:Gem::Dependency
92
- name: hoe-deveiate
92
+ name: rdoc
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ~>
96
96
  - !ruby/object:Gem::Version
97
- version: '0.3'
97
+ version: '4.0'
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: '0.3'
104
+ version: '4.0'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: simplecov
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -130,20 +130,34 @@ dependencies:
130
130
  - - ~>
131
131
  - !ruby/object:Gem::Version
132
132
  version: '1.2'
133
+ - !ruby/object:Gem::Dependency
134
+ name: rspec
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '='
138
+ - !ruby/object:Gem::Version
139
+ version: 3.0.0.beta2
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '='
145
+ - !ruby/object:Gem::Version
146
+ version: 3.0.0.beta2
133
147
  - !ruby/object:Gem::Dependency
134
148
  name: hoe
135
149
  requirement: !ruby/object:Gem::Requirement
136
150
  requirements:
137
151
  - - ~>
138
152
  - !ruby/object:Gem::Version
139
- version: '3.7'
153
+ version: '3.12'
140
154
  type: :development
141
155
  prerelease: false
142
156
  version_requirements: !ruby/object:Gem::Requirement
143
157
  requirements:
144
158
  - - ~>
145
159
  - !ruby/object:Gem::Version
146
- version: '3.7'
160
+ version: '3.12'
147
161
  description: |-
148
162
  Configurability is a unified, unintrusive, assume-nothing configuration system
149
163
  for Ruby. It lets you keep the configuration for multiple objects in a single
@@ -199,8 +213,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
213
  - !ruby/object:Gem::Version
200
214
  version: '0'
201
215
  requirements: []
202
- rubyforge_project: configurability
203
- rubygems_version: 2.2.1
216
+ rubyforge_project:
217
+ rubygems_version: 2.2.2
204
218
  signing_key:
205
219
  specification_version: 4
206
220
  summary: Configurability is a unified, unintrusive, assume-nothing configuration system
metadata.gz.sig CHANGED
Binary file