configurability 3.4.1 → 4.0.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
  SHA256:
3
- metadata.gz: bffc85b1e06ae1afa837e3afe896d1f41bef255dd37e08e1fa68c239a54fba4f
4
- data.tar.gz: d0b186c667bcd6ac4dc424dcbd76800b39197d5aa9e0e81955f00381bb07f97d
3
+ metadata.gz: efc3714f0ce8a75574f4850ab886d79b52953333f93542a205bbc5b2a0e5c9c1
4
+ data.tar.gz: 9a27d42bd4d637c9866f9e2f764c307a9e9df0081aaf839c6441d50eaad1c6c8
5
5
  SHA512:
6
- metadata.gz: ffc199167905d9e0c8f753a4b47e0d9f07d2e007e6431cc888f07ef227051829a63319c1fb5ea62faacbb08853e494df12bc0f4e43de4d67404f040e07d96217
7
- data.tar.gz: 6468f8987950e9a4c03e2bd8f03ed556eaf5564cb3cb3f3ac9de9598ad8dcb806f8da16a9ba0d10602022ae5d62e69d245f4966797dcd13464d2b03db68211df
6
+ metadata.gz: ebf734283d52e1c93127fb3f2d24e1fb8a7a9bce01895384c5ac626d8fb7e43064492a2251a27d8f5dd9b06e2cde1aee643661a15e485b7004b6630b1e69bc4a
7
+ data.tar.gz: aa92af53f1d07a2260f7ddbf78927b622e4724af8593a2316353b5b2f3a9b705112f1dd465651eb8e0f0da5838469e33ad1faff3fb1f94f7ad8c885d4e85e6b9
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,19 @@
1
+ # Release History for configurability
2
+
3
+ ---
4
+
5
+
6
+ ## v4.0.0 [2020-01-08] Michael Granger <ged@faeriemud.org>
7
+
8
+ Breaking changes:
9
+
10
+ - Remove tainting, which is deprecated in 2.7 and beyond.
11
+
12
+ Enhancements:
13
+
14
+ - Enable SafeYAML if it's loaded
15
+
16
+
1
17
  ## v3.4.1 [2019-09-03] Michael Granger <ged@FaerieMUD.org>
2
18
 
3
19
  Bugfixes:
@@ -12,6 +28,8 @@ Documentation:
12
28
 
13
29
  ## v3.4.0 [2019-09-01] Michael Granger <ged@FaerieMUD.org>
14
30
 
31
+ (Yanked due to inaccurate minimum Ruby version)
32
+
15
33
  Bugfixes:
16
34
 
17
35
  - Remove old command that depended on Trollop
data/README.md CHANGED
@@ -435,9 +435,15 @@ This task will install any missing dependencies, run the tests/specs,
435
435
  and generate the API documentation.
436
436
 
437
437
 
438
+ ## Authors
439
+
440
+ - Michael Granger <ged@faeriemud.org>
441
+ - Mahlon E. Smith <mahlon@martini.nu>
442
+
443
+
438
444
  ## License
439
445
 
440
- Copyright (c) 2010-2019 Michael Granger and Mahlon E. Smith
446
+ Copyright (c) 2010-2020 Michael Granger and Mahlon E. Smith
441
447
  All rights reserved.
442
448
 
443
449
  Redistribution and use in source and binary forms, with or without
data/Rakefile CHANGED
@@ -1,89 +1,8 @@
1
- #!/usr/bin/env rake
1
+ #!/usr/bin/env ruby -S rake
2
2
 
3
- begin
4
- require 'hoe'
5
- rescue LoadError
6
- abort "This Rakefile requires 'hoe' (gem install hoe)"
7
- end
8
-
9
- GEMSPEC = 'configurability.gemspec'
10
-
11
- Hoe.plugin :mercurial
12
- Hoe.plugin :signing
13
- Hoe.plugin :deveiate
14
-
15
- Hoe.plugins.delete :rubyforge
16
-
17
- Encoding.default_internal = Encoding::UTF_8
18
-
19
- hoespec = Hoe.spec 'configurability' do |spec|
20
- spec.readme_file = 'README.md'
21
- spec.history_file = 'History.md'
22
- spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
23
- spec.license 'BSD-3-Clause'
24
- spec.urls = {
25
- home: 'https://configur.ability.guide/',
26
- code: 'https://hg.sr.ht/ged/Configurability',
27
- docs: 'https://deveiate.org/code/configurability',
28
- github: 'https://github.com/ged/configurability',
29
- }
3
+ require 'rake/deveiate'
30
4
 
31
- spec.developer 'Michael Granger', 'ged@FaerieMUD.org'
32
- spec.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
33
-
34
- spec.dependency 'loggability', '~> 0.14'
35
-
36
- spec.dependency 'hoe-deveiate', '~> 0.8', :developer
37
- spec.dependency 'simplecov', '~> 0.12', :developer
38
- spec.dependency 'rspec', '~> 3.8', :developer
39
-
40
- spec.require_ruby_version( '>= 2.5.0' )
41
-
42
- spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
43
- spec.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
5
+ Rake::DevEiate.setup( 'configurability' ) do |project|
6
+ project.publish_to = 'deveiate:/usr/local/www/public/code'
44
7
  end
45
8
 
46
- ENV['VERSION'] ||= hoespec.spec.version.to_s
47
-
48
- # Ensure the specs pass before checking in
49
- task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
50
-
51
-
52
- desc "Build a coverage report"
53
- task :coverage do
54
- ENV["COVERAGE"] = 'yes'
55
- Rake::Task[:spec].invoke
56
- end
57
-
58
-
59
- # Use the fivefish formatter for docs generated from development checkout
60
- if File.directory?( '.hg' )
61
- require 'rdoc/task'
62
-
63
- Rake::Task[ 'docs' ].clear
64
- RDoc::Task.new( 'docs' ) do |rdoc|
65
- rdoc.main = "README.md"
66
- rdoc.rdoc_files.include( "*.rdoc", "*.md", "ChangeLog", "lib/**/*.rb" )
67
- rdoc.generator = :fivefish
68
- rdoc.title = 'Configurability'
69
- rdoc.rdoc_dir = 'doc'
70
- end
71
- end
72
-
73
-
74
- task :gemspec => [ 'ChangeLog', GEMSPEC ]
75
- file GEMSPEC => __FILE__ do |task|
76
- spec = $hoespec.spec
77
- spec.files.delete( '.gemtest' )
78
- spec.files.delete( 'LICENSE' )
79
- spec.signing_key = nil
80
- spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
81
- spec.cert_chain = [ 'certs/ged.pem' ]
82
- File.open( task.name, 'w' ) do |fh|
83
- fh.write( spec.to_ruby )
84
- end
85
- end
86
- CLOBBER.include( GEMSPEC )
87
-
88
- task :default => :gemspec
89
-
@@ -14,7 +14,7 @@ module Configurability
14
14
 
15
15
 
16
16
  # Library version constant
17
- VERSION = '3.4.1'
17
+ VERSION = '4.0.0'
18
18
 
19
19
  # Version-control revision constant
20
20
  REVISION = %q$Revision$
@@ -301,8 +301,7 @@ module Configurability
301
301
  @config.each_pair do |key, value|
302
302
  Configurability.log.debug "Looking for %p config attribute" % [ key ]
303
303
  next unless self.respond_to?( "#{key}=" )
304
- Configurability.log.debug " setting %p to %p via attr_writer" %
305
- [ key, value ]
304
+ Configurability.log.debug " setting %p to %p" % [ key, value ]
306
305
  self.public_send( "#{key}=", value )
307
306
  end
308
307
  else
@@ -43,6 +43,10 @@ class Configurability::Config
43
43
  log_to :configurability
44
44
 
45
45
 
46
+ # Make safe loading the default if SafeYAML is loaded
47
+ SafeYAML::OPTIONS[:default_mode] = :safe if defined?( SafeYAML )
48
+
49
+
46
50
  #############################################################
47
51
  ### C L A S S M E T H O D S
48
52
  #############################################################
@@ -256,7 +260,7 @@ class Configurability::Config
256
260
  end
257
261
  end
258
262
 
259
- ihash = symbolify_keys( untaint_hash(hash) )
263
+ ihash = symbolify_keys( hash )
260
264
  idefaults = symbolify_keys( defaults )
261
265
  mergedhash = idefaults.merge( ihash, &mergefunc )
262
266
 
@@ -285,41 +289,9 @@ class Configurability::Config
285
289
 
286
290
 
287
291
  # A collection of data-structure-manipulation functions.
292
+ # :TODO: Replace with #transform_keys after 2.4's EOL
288
293
  module DataUtilities
289
294
 
290
- ### Return a copy of the specified +hash+ with all of its values
291
- ### untainted.
292
- def untaint_hash( hash )
293
- newhash = {}
294
- hash.each_key do |key|
295
- newhash[ key ] = untaint_value( hash[key] )
296
- end
297
- return newhash
298
- end
299
-
300
-
301
- ### Return an untainted copy of the specified +val+.
302
- def untaint_value( val )
303
- case val
304
- when Hash
305
- return untaint_hash( val )
306
-
307
- when Array
308
- return val.collect {|v| untaint_value(v) }
309
-
310
- when NilClass, TrueClass, FalseClass, Numeric, Symbol, Encoding
311
- return val
312
-
313
- else
314
- if val.respond_to?( :dup ) && val.respond_to?( :untaint )
315
- return val.dup.untaint
316
- else
317
- return val
318
- end
319
- end
320
- end
321
-
322
-
323
295
  ### Return a duplicate of the given +hash+ with its identifier-like keys
324
296
  ### transformed into symbols from whatever they were before.
325
297
  def symbolify_keys( hash )
@@ -400,7 +372,7 @@ class Configurability::Config
400
372
  # Return the value associated with the specified +key+, or another
401
373
  # Configurability::Config::ConfigStruct if +key+ is a section name.
402
374
  def []( key )
403
- key = key.untaint.to_sym if key.respond_to?( :to_sym )
375
+ key = key.to_sym if key.respond_to?( :to_sym )
404
376
 
405
377
  # Convert Hashes to Struct on the fly for subsections
406
378
  @hash[ key ] = self.class.new( @hash[key] ) if @hash[ key ].is_a?( Hash )
@@ -411,7 +383,7 @@ class Configurability::Config
411
383
 
412
384
  ### Set the value associated with the specified +key+ to +value+.
413
385
  def []=( key, value )
414
- key = key.untaint.to_sym
386
+ key = key.to_sym
415
387
  self.mark_dirty if @hash[ key ] != value
416
388
  @hash[ key ] = value
417
389
  end
@@ -119,13 +119,6 @@ describe Configurability::Config do
119
119
  end
120
120
 
121
121
 
122
- it "untaints values loaded from a config" do
123
- yaml = TEST_CONFIG.dup.taint
124
- config = described_class.new( yaml )
125
- expect( config.listsection.first ).to_not be_tainted
126
- expect( config.textsection ).to_not be_tainted
127
- end
128
-
129
122
 
130
123
  context "a config with nil keys" do
131
124
 
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.4.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -12,8 +12,8 @@ cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
14
  MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
15
- REM9RmFlcmllTVVEL0RDPW9yZzAeFw0xODExMjAxODI5NTlaFw0xOTExMjAxODI5
16
- N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1ho0Ya5q7yhygtBK9/NBFHw+nbJjcltfPDBXleRe8u73gnQo8AZIhStYSP
35
- v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
36
- JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
28
+ Lm9yZzANBgkqhkiG9w0BAQsFAAOCAYEAFqsr6o0SvQRgjQVmhbQvExRnCMCoW1yb
29
+ FJiN7A5RA2Iy2E61OG1Ul5nGmaDmx/PNB/6JIbIV3B9Uq8aTZx4uOjK7r8vMl1/t
30
+ ZfY7r6HejJfXlcO2m6JDMbpdyEVv916LncBkzZRz6vnnNCx+31f15FKddxujpAFd
31
+ qpn3JRQY+oj7ZkoccL/IUiDpxQWeS3oOoz9qr2kVTp8R50InZimt79FqCl/1m66W
32
+ kdOuf+wM3DDx7Rt4IVNHrhGlyfMr7xjKW1Q3gll+pMN1DT6Ajx/t3JDSEg7BnnEW
33
+ r7AciSO6J4ApUdqyG+coLFlGdtgFTgRHv7ihbQtDI7Z/LV7A4Spn1j2PK3j0Omri
34
+ kSl1hPVigRytfgdVGiLXzvkkrkgj9EknCaj5UHbac7XvVBrljXj9hsnnqTANaKsg
35
+ jBZSA+N+xUTgUWpXjjwsLZjzJkhWATJWq+krNXcqpwXo6HsjmdUxoFMt63RBb+sI
36
+ XrxOxp8o0uOkU7FdLSGsyqJ2LzsR4obN
37
37
  -----END CERTIFICATE-----
38
- date: 2019-09-03 00:00:00.000000000 Z
38
+ date: 2020-01-08 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: loggability
@@ -43,56 +43,28 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.14'
46
+ version: '0.15'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.14'
53
+ version: '0.15'
54
54
  - !ruby/object:Gem::Dependency
55
- name: hoe-mercurial
55
+ name: rake-deveiate
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '1.4'
60
+ version: '0.5'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.4'
68
- - !ruby/object:Gem::Dependency
69
- name: hoe-deveiate
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '0.10'
75
- type: :development
76
- prerelease: false
77
- version_requirements: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '0.10'
82
- - !ruby/object:Gem::Dependency
83
- name: hoe-highline
84
- requirement: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '0.2'
89
- type: :development
90
- prerelease: false
91
- version_requirements: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '0.2'
67
+ version: '0.5'
96
68
  - !ruby/object:Gem::Dependency
97
69
  name: simplecov
98
70
  requirement: !ruby/object:Gem::Requirement
@@ -113,48 +85,14 @@ dependencies:
113
85
  requirements:
114
86
  - - "~>"
115
87
  - !ruby/object:Gem::Version
116
- version: '3.8'
88
+ version: '3.9'
117
89
  type: :development
118
90
  prerelease: false
119
91
  version_requirements: !ruby/object:Gem::Requirement
120
92
  requirements:
121
93
  - - "~>"
122
94
  - !ruby/object:Gem::Version
123
- version: '3.8'
124
- - !ruby/object:Gem::Dependency
125
- name: rdoc
126
- requirement: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '4.0'
131
- - - "<"
132
- - !ruby/object:Gem::Version
133
- version: '7'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: '4.0'
141
- - - "<"
142
- - !ruby/object:Gem::Version
143
- version: '7'
144
- - !ruby/object:Gem::Dependency
145
- name: hoe
146
- requirement: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - "~>"
149
- - !ruby/object:Gem::Version
150
- version: '3.18'
151
- type: :development
152
- prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- requirements:
155
- - - "~>"
156
- - !ruby/object:Gem::Version
157
- version: '3.18'
95
+ version: '3.9'
158
96
  description: |-
159
97
  Configurability is a unified, non-intrusive, assume-nothing configuration system
160
98
  for Ruby. It lets you keep the configuration for multiple objects in a single
@@ -162,14 +100,11 @@ description: |-
162
100
  configuration when you're ready, sending it everywhere it needs to go with a
163
101
  single action.
164
102
  email:
165
- - ged@FaerieMUD.org
103
+ - ged@faeriemud.org
166
104
  - mahlon@martini.nu
167
105
  executables: []
168
106
  extensions: []
169
- extra_rdoc_files:
170
- - History.md
171
- - Manifest.txt
172
- - README.md
107
+ extra_rdoc_files: []
173
108
  files:
174
109
  - ChangeLog
175
110
  - History.md
@@ -194,25 +129,23 @@ licenses:
194
129
  - BSD-3-Clause
195
130
  metadata: {}
196
131
  post_install_message:
197
- rdoc_options:
198
- - "--main"
199
- - README.md
132
+ rdoc_options: []
200
133
  require_paths:
201
134
  - lib
202
135
  required_ruby_version: !ruby/object:Gem::Requirement
203
136
  requirements:
204
137
  - - ">="
205
138
  - !ruby/object:Gem::Version
206
- version: 2.5.0
139
+ version: '0'
207
140
  required_rubygems_version: !ruby/object:Gem::Requirement
208
141
  requirements:
209
142
  - - ">="
210
143
  - !ruby/object:Gem::Version
211
144
  version: '0'
212
145
  requirements: []
213
- rubygems_version: 3.0.3
146
+ rubygems_version: 3.1.2
214
147
  signing_key:
215
148
  specification_version: 4
216
149
  summary: Configurability is a unified, non-intrusive, assume-nothing configuration
217
- system for Ruby
150
+ system for Ruby.
218
151
  test_files: []
metadata.gz.sig CHANGED
Binary file