configurability 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -0,0 +1,280 @@
1
+ 2011-10-13 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .hgtags:
4
+ Added tag v1.0.7 for changeset 4e605f137155
5
+ [0f391f680b61] [tip]
6
+
7
+ * .hgsigs:
8
+ Added signature for changeset 605036b92217
9
+ [4e605f137155] [v1.0.7]
10
+
11
+ * History.rdoc, lib/configurability.rb:
12
+ Update history and bump patch version.
13
+ [605036b92217] [github/master]
14
+
15
+ * lib/configurability.rb, lib/configurability/config.rb,
16
+ lib/configurability/deferredconfig.rb:
17
+ Cleaned up Yard debris.
18
+ [6f4aa8deae60]
19
+
20
+ * History.md, History.rdoc, Manifest.txt, README.md, README.rdoc,
21
+ Rakefile:
22
+ Converted Markdown to RDoc.
23
+ [4ee71cc44d22]
24
+
25
+ 2011-04-26 Michael Granger <ged@FaerieMUD.org>
26
+
27
+ * Rakefile:
28
+ Merged with c9b7b76e4792
29
+ [cae88e472706]
30
+
31
+ * Rakefile:
32
+ Cleaning up the Rakefile a bit
33
+ [c9b7b76e4792]
34
+
35
+ 2011-03-03 Michael Granger <ged@FaerieMUD.org>
36
+
37
+ * .hgtags:
38
+ Added tag v1.0.6 for changeset c2c677e0f5ca
39
+ [5b0587aa9b49]
40
+
41
+ * .hgsigs:
42
+ Added signature for changeset feb106dcbc29
43
+ [c2c677e0f5ca] [v1.0.6]
44
+
45
+ * History.md:
46
+ Updating the History.
47
+ [feb106dcbc29]
48
+
49
+ * lib/configurability.rb, lib/configurability/config.rb,
50
+ spec/configurability/config_spec.rb:
51
+ Fixing predicate methods for missing sections/values; bumping patch
52
+ version.
53
+ [631fd470522c]
54
+
55
+ 2011-02-08 Michael Granger <ged@FaerieMUD.org>
56
+
57
+ * lib/configurability/config.rb, spec/configurability/config_spec.rb:
58
+ Adding nil safeguard to Configurability::Config::Struct#member?
59
+ [8f0c899cce82]
60
+
61
+ * .hgignore, Rakefile, spec/lib/helpers.rb:
62
+ Adding coverage generation
63
+ [91c699ea9aa3]
64
+
65
+ * .hgtags:
66
+ Added tag v1.0.5 for changeset 34062406d690
67
+ [739461bf952c]
68
+
69
+ * .hgsigs:
70
+ Added signature for changeset 12fda25efd84
71
+ [34062406d690] [v1.0.5]
72
+
73
+ * History.md, lib/configurability.rb:
74
+ Bumped version and updated History.
75
+ [12fda25efd84]
76
+
77
+ * .hgsigs, .hgsubstate, .hgtags, README.md:
78
+ Merged with 37:f3c29856fbe0
79
+ [9c22d746add7]
80
+
81
+ * .hgtags:
82
+ Removed tag v1.0.4
83
+ [1ef1012b278c]
84
+
85
+ * .hgtags:
86
+ Added tag v1.0.4 for changeset 84718f122b7b
87
+ [99d382b750f6]
88
+
89
+ * .hgsigs:
90
+ Added signature for changeset eef299ea1d29
91
+ [84718f122b7b]
92
+
93
+ * lib/configurability.rb, lib/configurability/config.rb,
94
+ spec/configurability/config_spec.rb:
95
+ Fix for config files with nil keys (fixes #1)
96
+ [eef299ea1d29]
97
+
98
+ * .hgsub, .hgsubstate, .hgsubstate, History.md, LICENSE, Manifest.txt,
99
+ README.md, Rakefile, project.yml:
100
+ Converted to Hoe.
101
+ [fb024df77138]
102
+
103
+ 2010-11-29 Michael Granger <ged@FaerieMUD.org>
104
+
105
+ * .hgsub:
106
+ Modifying rake subrepo to the read-only URL
107
+ [f3c29856fbe0]
108
+
109
+ * .hgtags:
110
+ Added tag v1.0.4 for changeset 8553632dca62
111
+ [e89c09b5e32a]
112
+
113
+ * .hgsigs:
114
+ Added signature for changeset a8a6a67e2ede
115
+ [8553632dca62] [v1.0.4]
116
+
117
+ * .hgsubstate, lib/configurability.rb:
118
+ Bumping version to 1.0.4 for corrected release
119
+ [a8a6a67e2ede]
120
+
121
+ * README.md:
122
+ Adding Github mirror to the README
123
+ [bb8f2829eb37]
124
+
125
+ * .hgtags:
126
+ Added tag v1.0.3 for changeset 910ae8ac082f
127
+ [a2ae16f86c98]
128
+
129
+ * .hgsigs:
130
+ Added signature for changeset 49e98e6334dd
131
+ [910ae8ac082f] [v1.0.3]
132
+
133
+ * Merged with 24:7aec5228c2b0
134
+ [49e98e6334dd]
135
+
136
+ * .hgsubstate, lib/configurability.rb,
137
+ lib/configurability/deferredconfig.rb,
138
+ spec/configurability/deferredconfig_spec.rb,
139
+ spec/configurability_spec.rb, spec/lib/helpers.rb:
140
+ Propagate the installed config to objects that add Configurability
141
+ after the config is loaded.
142
+ [ec3f030074dc]
143
+
144
+ 2010-10-29 Michael Granger <ged@FaerieMUD.org>
145
+
146
+ * .hgtags:
147
+ Added tag 1.0.2 for changeset ba2c849fde0d
148
+ [7aec5228c2b0]
149
+
150
+ * .hgsigs:
151
+ Added signature for changeset 8718e7f4ea1f
152
+ [ba2c849fde0d] [1.0.2]
153
+
154
+ 2010-11-29 Michael Granger <ged@FaerieMUD.org>
155
+
156
+ * Rakefile, project.yml:
157
+ Updated build system
158
+ [58cbefcef526]
159
+
160
+ 2010-10-29 Michael Granger <ged@FaerieMUD.org>
161
+
162
+ * .hgsubstate, spec/configurability/config_spec.rb,
163
+ spec/configurability_spec.rb:
164
+ Fixes for specs under 1.9.2.
165
+ [8718e7f4ea1f]
166
+
167
+ * Merged with 17:e2bf2e43bccf
168
+ [17a6999c08b9]
169
+
170
+ 2010-10-25 Michael Granger <ged@FaerieMUD.org>
171
+
172
+ * lib/configurability/behavior.rb:
173
+ Fixed require for RSpec 2 in the shared behavior.
174
+ [e2bf2e43bccf]
175
+
176
+ * .hgsubstate, Rakefile, lib/configurability.rb,
177
+ lib/configurability/behavior.rb, project.yml,
178
+ spec/configurability/config_spec.rb, spec/configurability_spec.rb:
179
+ Converted tests to RSpec 2.
180
+ [5d18e28e387b]
181
+
182
+ 2010-08-08 Michael Granger <ged@FaerieMUD.org>
183
+
184
+ * .hgtags:
185
+ Added tag 1.0.1 for changeset e3605ccbe057
186
+ [4bff6d5f7b6e]
187
+
188
+ * .hgsigs:
189
+ Added signature for changeset 41bc1de0bf36
190
+ [e3605ccbe057] [1.0.1]
191
+
192
+ 2010-08-04 Michael Granger <ged@FaerieMUD.org>
193
+
194
+ * .hgignore, README.md, lib/configurability/config.rb,
195
+ spec/configurability/config_spec.rb:
196
+ More Configurability::Config work
197
+ * More docs
198
+ * Made #reload's behaviour match its documentation
199
+ [41bc1de0bf36]
200
+
201
+ * README.md, examples/config.yml, lib/configurability/config.rb,
202
+ spec/configurability/config_spec.rb:
203
+ More work on Configurability::Config
204
+ * More documentation
205
+ * Move hash-access in the Struct into explicit index operator methods
206
+ and change the lambdas to be implemented in terms of them for more-
207
+ consistent behavior, String/Symbol normalization, etc.
208
+ [44db952eb824]
209
+
210
+ * README.md, lib/configurability/config.rb,
211
+ spec/configurability/config_spec.rb:
212
+ Finishing up Configurability::Config.
213
+ * Started documentation
214
+ * Fleshed out the specs for better coverage, fixing some bugs
215
+ uncovered by same.
216
+ * Nicer inspect output
217
+ [2323bf260e7c]
218
+
219
+ * .hgsubstate, Rakefile:
220
+ Build system updates.
221
+ [9e0bab83afd5]
222
+
223
+ * lib/configurability/behavior.rb:
224
+ Add an rspec shared behavior for testing classes with
225
+ Configurability
226
+ [cba63cef2f7f]
227
+
228
+ 2010-07-16 Michael Granger <ged@FaerieMUD.org>
229
+
230
+ * lib/configurability/config.rb, spec/configurability/config_spec.rb:
231
+ Adding a Configurability::Config class for YAML config loading.
232
+ [4ffdde3f7a2f]
233
+
234
+ * .hgignore, .irbrc, README.md, Rakefile, project.yml:
235
+ Updating README, project metadata, adding .irbrc
236
+ [d225cef4269e]
237
+
238
+ * lib/configurability.rb:
239
+ Version bump; debugging log
240
+ [9da882b82786]
241
+
242
+ 2010-07-12 Michael Granger <ged@FaerieMUD.org>
243
+
244
+ * .hgtags:
245
+ Added tag 1.0.0 for changeset 74b5dd9a89c9
246
+ [ecf5d4565338]
247
+
248
+ * .hgsigs:
249
+ Added signature for changeset e0fef8dabba4
250
+ [74b5dd9a89c9] [1.0.0]
251
+
252
+ * README.md, lib/configurability.rb:
253
+ README formatting, YARD tag fix.
254
+ [e0fef8dabba4]
255
+
256
+ * .hgignore, README, README.md, spec/configurability_spec.rb:
257
+ Documentation, added a test for classname normalization.
258
+ [4d7044641f87]
259
+
260
+ * README, lib/configurability.rb, spec/configurability_spec.rb:
261
+ Added some stuff to the README, made String config keys work.
262
+ [0b395dbf657f]
263
+
264
+ * examples/basicconfig.rb:
265
+ Adding an example.
266
+ [9531380cc3f2]
267
+
268
+ 2010-07-11 Michael Granger <ged@FaerieMUD.org>
269
+
270
+ * .hgsubstate, LICENSE, README, Rakefile, lib/configurability.rb,
271
+ lib/configurability/logformatter.rb, project.yml,
272
+ spec/configurability_spec.rb, spec/lib/helpers.rb:
273
+ Initial version.
274
+ [982ba9fe2e6e]
275
+
276
+ 2010-07-10 Michael Granger <ged@FaerieMUD.org>
277
+
278
+ * .hgsub, .hgsubstate:
279
+ Adding rake subrepo
280
+ [ac34a9d6c913]
@@ -1,4 +1,9 @@
1
- ## 1.0.6 [2011-03-03] Michael Granger <ged@FaerieMUD.org>
1
+ == v1.0.7 [2011-10-13] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - De-Yard and fix some other documentation/packaging issues.
4
+
5
+
6
+ == v1.0.6 [2011-03-03] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  Bugfixes:
4
9
 
@@ -6,19 +11,19 @@ Bugfixes:
6
11
  `true` as well.
7
12
 
8
13
 
9
- ## 1.0.5 [2011-02-08] Michael Granger <ged@FaerieMUD.org>
14
+ == v1.0.5 [2011-02-08] Michael Granger <ged@FaerieMUD.org>
10
15
 
11
16
  Bugfixes:
12
17
 
13
18
  * Now handles config files with nil keys correctly.
14
19
 
15
20
 
16
- ## 1.0.4 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
21
+ == v1.0.4 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
17
22
 
18
23
  Packaging fix.
19
24
 
20
25
 
21
- ## 1.0.3 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
26
+ == v1.0.3 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
22
27
 
23
28
  Enchancements:
24
29
 
@@ -26,14 +31,14 @@ Enchancements:
26
31
  config is loaded.
27
32
 
28
33
 
29
- ## 1.0.2 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
34
+ == v1.0.2 [2010-11-29] Michael Granger <ged@FaerieMUD.org>
30
35
 
31
36
  Bugfixes:
32
37
 
33
38
  * Fixes for specs under 1.9.2.
34
39
 
35
40
 
36
- ## 1.0.1 [2010-08-08] Michael Granger <ged@FaerieMUD.org>
41
+ == v1.0.1 [2010-08-08] Michael Granger <ged@FaerieMUD.org>
37
42
 
38
43
  Enhancements:
39
44
 
@@ -42,7 +47,7 @@ Enhancements:
42
47
  * Converted tests to RSpec 2.
43
48
 
44
49
 
45
- ## 1.0.0 [2010-07-12] Michael Granger <ged@FaerieMUD.org>
50
+ == v1.0.0 [2010-07-12] Michael Granger <ged@FaerieMUD.org>
46
51
 
47
52
  Initial release
48
53
 
@@ -0,0 +1,17 @@
1
+ ChangeLog
2
+ History.rdoc
3
+ LICENSE
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ examples/basicconfig.rb
8
+ examples/config.yml
9
+ lib/configurability.rb
10
+ lib/configurability/behavior.rb
11
+ lib/configurability/config.rb
12
+ lib/configurability/deferredconfig.rb
13
+ lib/configurability/logformatter.rb
14
+ spec/configurability/config_spec.rb
15
+ spec/configurability/deferredconfig_spec.rb
16
+ spec/configurability_spec.rb
17
+ spec/lib/helpers.rb
@@ -1,9 +1,9 @@
1
- # Configurability
1
+ = Configurability
2
2
 
3
3
  * http://bitbucket.org/ged/configurability
4
4
 
5
5
 
6
- ## Description
6
+ == Description
7
7
 
8
8
  Configurability is a mixin that allows you to add configurability to one or
9
9
  more objects or classes. You can assign them each a subsection of the
@@ -11,12 +11,12 @@ configuration, and then later, when the configuration is loaded, the
11
11
  configuration is split up and sent to the objects that will use it.
12
12
 
13
13
 
14
- ## Installation
14
+ == Installation
15
15
 
16
16
  gem install configurability
17
17
 
18
18
 
19
- ## Usage
19
+ == Usage
20
20
 
21
21
  To add configurability to a class, just require the library and extend
22
22
  the class:
@@ -64,13 +64,13 @@ to the appropriate section of the config object for each object that has
64
64
  been extended with Configurability.
65
65
 
66
66
 
67
- ## Customization
67
+ == Customization
68
68
 
69
69
  The default behavior above is just provided as a reasonable default; it is
70
70
  expected that you'll want to customize at least one or two things about
71
71
  how configuration is handled in your objects.
72
72
 
73
- ### Setting a Custom Config Key
73
+ === Setting a Custom Config Key
74
74
 
75
75
  The first thing you might want to do is change the config section that
76
76
  corresponds to your object. You can do that by declaring a different
@@ -91,7 +91,7 @@ as a Symbol:
91
91
  end
92
92
  end
93
93
 
94
- ### Changing How an Object Is Configured
94
+ === Changing How an Object Is Configured
95
95
 
96
96
  You can also change what happens when an object is configured by implementing
97
97
  a `#configure` method that takes the config section as an argument:
@@ -107,15 +107,17 @@ a `#configure` method that takes the config section as an argument:
107
107
  end
108
108
  end
109
109
 
110
- If you still want the `@config` variable to be set, just `super` from your implementation; don't if you don't want it to be set.
110
+ If you still want the `@config` variable to be set, just `super` from your
111
+ implementation; don't if you don't want it to be set.
111
112
 
112
113
 
113
- ## Configuration Objects
114
+ == Configuration Objects
114
115
 
115
116
  Configurability also includes `Configurability::Config`, a fairly simple
116
117
  configuration object class that can be used to load a YAML configuration file,
117
118
  and then present both a Hash-like and a Struct-like interface for reading
118
- configuration sections and values; it's meant to be used in tandem with Configurability, but it's also useful on its own.
119
+ configuration sections and values; it's meant to be used in tandem with
120
+ Configurability, but it's also useful on its own.
119
121
 
120
122
  Here's a quick example to demonstrate some of its features. Suppose you have a
121
123
  config file that looks like this:
@@ -199,11 +201,13 @@ loaded it:
199
201
  config.changed?
200
202
  # => true
201
203
 
202
- If it has changed (or even if it hasn't), you can reload it, which automatically re-installs it via the Configurability interface:
204
+ If it has changed (or even if it hasn't), you can reload it, which
205
+ automatically re-installs it via the Configurability interface:
203
206
 
204
207
  config.reload
205
208
 
206
- You can make modifications via the same Struct- or Hash-like interfaces and write the modified config back out to the same file:
209
+ You can make modifications via the same Struct- or Hash-like interfaces and
210
+ write the modified config back out to the same file:
207
211
 
208
212
  config.database.testing.adapter = 'mysql'
209
213
  config[:database]['testing'].database = 't_fixedassets'
@@ -225,11 +229,13 @@ or write it back to the file it was loaded from:
225
229
  config.write
226
230
 
227
231
 
228
- ## Development
232
+ == Development
229
233
 
230
- You can submit bug reports, suggestions, clone it with Mercurial, and read
231
- more about future plans at [the project page][projectpage]. If you prefer Git,
232
- there is also a [Github mirror][gitmirror].
234
+ You can submit bug reports, suggestions, clone it with Mercurial, and
235
+ read more about future plans at
236
+ {the project page}[http://bitbucket.org/ged/configurability]. If you
237
+ prefer Git, there is also a
238
+ {Github mirror}[https://github.com/ged/configurability].
233
239
 
234
240
  After checking out the source, run:
235
241
 
@@ -239,7 +245,7 @@ This task will install any missing dependencies, run the tests/specs,
239
245
  and generate the API documentation.
240
246
 
241
247
 
242
- ## License
248
+ == License
243
249
 
244
250
  Copyright (c) 2010, 2011 Michael Granger
245
251
  All rights reserved.
@@ -270,6 +276,3 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
270
276
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271
277
 
272
278
 
273
- [projectpage]:http://bitbucket.org/ged/configurability
274
- [gitmirror]:https://github.com/ged/configurability
275
-
data/Rakefile CHANGED
@@ -15,75 +15,24 @@ Hoe.plugins.delete :rubyforge
15
15
 
16
16
 
17
17
  hoespec = Hoe.spec 'configurability' do
18
- self.readme_file = 'README.md'
19
- self.history_file = 'History.md'
18
+ self.readme_file = 'README.rdoc'
19
+ self.history_file = 'History.rdoc'
20
+ self.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
20
21
 
21
22
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
22
23
 
23
- self.extra_dev_deps.push *{
24
- 'rspec' => '~> 2.4',
25
- 'simplecov' => '~> 0.3',
26
- }
24
+ self.dependency 'rspec', '~> 2.4', :developer
25
+ self.dependency 'simplecov', '~> 0.3', :developer
27
26
 
28
27
  self.spec_extras[:licenses] = ["BSD"]
29
- self.spec_extras[:post_install_message] = %{
30
-
31
- New!
32
-
33
- }.gsub( /^\t{2}/, '' )
34
-
35
- self.spec_extras[:signing_key] = '/Volumes/Keys/ged-private_gem_key.pem'
36
-
37
28
  self.require_ruby_version( '>= 1.8.7' )
38
29
 
39
30
  self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
40
- self.yard_opts = [ '--protected', '--verbose' ] if self.respond_to?( :yard_opts= )
41
-
42
31
  self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
43
32
  end
44
33
 
45
34
  ENV['VERSION'] ||= hoespec.spec.version.to_s
46
35
 
47
36
  # Ensure the specs pass before checking in
48
- task 'hg:precheckin' => :spec
49
-
50
- begin
51
- include Hoe::MercurialHelpers
52
-
53
- ### Task: prerelease
54
- desc "Append the package build number to package versions"
55
- task :pre do
56
- rev = get_numeric_rev()
57
- trace "Current rev is: %p" % [ rev ]
58
- hoespec.spec.version.version << "pre#{rev}"
59
- Rake::Task[:gem].clear
60
-
61
- Gem::PackageTask.new( hoespec.spec ) do |pkg|
62
- pkg.need_zip = true
63
- pkg.need_tar = true
64
- end
65
- end
66
-
67
- ### Make the ChangeLog update if the repo has changed since it was last built
68
- file '.hg/branch'
69
- file 'ChangeLog' => '.hg/branch' do |task|
70
- $stderr.puts "Updating the changelog..."
71
- content = make_changelog()
72
- File.open( task.name, 'w', 0644 ) do |fh|
73
- fh.print( content )
74
- end
75
- end
76
-
77
- # Rebuild the ChangeLog immediately before release
78
- task :prerelease => 'ChangeLog'
79
-
80
- rescue NameError => err
81
- task :no_hg_helpers do
82
- fail "Couldn't define the :pre task: %s: %s" % [ err.class.name, err.message ]
83
- end
84
-
85
- task :pre => :no_hg_helpers
86
- task 'ChangeLog' => :no_hg_helpers
87
-
88
- end
37
+ task 'hg:precheckin' => [ :check_history, :check_manifest, :spec ]
89
38
 
@@ -4,15 +4,17 @@ require 'yaml'
4
4
 
5
5
  # A configuration mixin for Ruby classes.
6
6
  #
7
- # @author Michael Granger <ged@FaerieMUD.org>
7
+ # == Author/s
8
+ #
9
+ # * Michael Granger <ged@FaerieMUD.org>
8
10
  #
9
11
  module Configurability
10
12
 
11
13
  # Library version constant
12
- VERSION = '1.0.6'
14
+ VERSION = '1.0.7'
13
15
 
14
16
  # Version-control revision constant
15
- REVISION = %q$Revision: 631fd470522c $
17
+ REVISION = %q$Revision: 605036b92217 $
16
18
 
17
19
  require 'configurability/logformatter'
18
20
  require 'configurability/deferredconfig'
@@ -36,22 +38,20 @@ module Configurability
36
38
 
37
39
  class << self
38
40
 
39
- # @return [Array] the Array of objects that have had Configurability
40
- # added to them
41
+ # the Array of objects that have had Configurability added to them
41
42
  attr_accessor :configurable_objects
42
43
 
43
- # @return [Object] the loaded configuration (after ::configure_objects
44
- # has been called at least once)
44
+ # the loaded configuration (after ::configure_objects has been called at least once)
45
45
  attr_accessor :loaded_config
46
46
 
47
- # @return [Logger::Formatter] the log formatter that will be used when the logging
48
- # subsystem is reset
47
+ # the log formatter that will be used when the logging subsystem is
48
+ # reset
49
49
  attr_accessor :default_log_formatter
50
50
 
51
- # @return [Logger] the logger that will be used when the logging subsystem is reset
51
+ # the logger that will be used when the logging subsystem is reset
52
52
  attr_accessor :default_logger
53
53
 
54
- # @return [Logger] the logger that's currently in effect
54
+ # the logger that's currently in effect
55
55
  attr_accessor :logger
56
56
  alias_method :log, :logger
57
57
  alias_method :log=, :logger=
@@ -119,7 +119,6 @@ module Configurability
119
119
 
120
120
 
121
121
  ### Reset the global logger object to the default
122
- ### @return [void]
123
122
  def self::reset_logger
124
123
  self.logger = self.default_logger
125
124
  self.logger.level = Logger::WARN
@@ -155,9 +154,7 @@ module Configurability
155
154
  ### used to configure the object.
156
155
  attr_writer :config_key
157
156
 
158
- ### Get (and optionally set) the +config_key+.
159
- ### @param [Symbol] sym the config key
160
- ### @return [Symbol] the config key
157
+ ### Get (and optionally set) the +config_key+ (a Symbol).
161
158
  def config_key( sym=nil )
162
159
  @config_key = sym unless sym.nil?
163
160
  @config_key ||= Configurability.make_key_from_object( self )
@@ -166,14 +163,12 @@ module Configurability
166
163
 
167
164
 
168
165
  ### Set the config key of the object.
169
- ### @param [Symbol] sym the config key
170
166
  def config_key=( sym )
171
167
  @config_key = sym
172
168
  end
173
169
 
174
170
 
175
171
  ### Default configuration method.
176
- ### @param [Object] configuration section object
177
172
  def configure( config )
178
173
  @config = config
179
174
  end
@@ -10,26 +10,28 @@ require 'configurability'
10
10
 
11
11
  # A configuration object class for systems with Configurability
12
12
  #
13
- # @author Michael Granger <ged@FaerieMUD.org>
14
- # @author Mahlon E. Smith <mahlon@martini.nu>
13
+ # == Author/s
14
+ #
15
+ # * Michael Granger <ged@FaerieMUD.org>
16
+ # * Mahlon E. Smith <mahlon@martini.nu>
15
17
  #
16
18
  # This class also delegates some of its methods to the underlying struct:
17
19
  #
18
- # @see Configurability::Config::Struct#to_hash
20
+ # [Configurability::Config::Struct#to_hash]
19
21
  # #to_hash (delegated to its internal Struct)
20
- # @see Configurability::Config::Struct#member?
22
+ # [Configurability::Config::Struct#member?]
21
23
  # #member? (delegated to its internal Struct)
22
- # @see Configurability::Config::Struct#members
24
+ # [Configurability::Config::Struct#members]
23
25
  # #members (delegated to its internal Struct)
24
- # @see Configurability::Config::Struct#merge
26
+ # [Configurability::Config::Struct#merge]
25
27
  # #merge (delegated to its internal Struct)
26
- # @see Configurability::Config::Struct#merge!
28
+ # [Configurability::Config::Struct#merge!]
27
29
  # #merge! (delegated to its internal Struct)
28
- # @see Configurability::Config::Struct#each
30
+ # [Configurability::Config::Struct#each]
29
31
  # #each (delegated to its internal Struct)
30
- # @see Configurability::Config::Struct#[]
32
+ # [Configurability::Config::Struct#[]]
31
33
  # #[] (delegated to its internal Struct)
32
- # @see Configurability::Config::Struct#[]=
34
+ # [Configurability::Config::Struct#[]=]
33
35
  # #[]= (delegated to its internal Struct)
34
36
  #
35
37
  class Configurability::Config
@@ -41,11 +43,6 @@ class Configurability::Config
41
43
  #############################################################
42
44
 
43
45
  ### Read and return a Configurability::Config object from the file at the given +path+.
44
- ### @param [String] path the path to the config file
45
- ### @param [Hash] defaults a Hash of default config values which will be
46
- ### used if the config at +path+ doesn't override
47
- ### them.
48
- ### @param block passed through as the block argument to {#initialize}.
49
46
  def self::load( path, defaults=nil, &block )
50
47
  path = Pathname( path ).expand_path
51
48
  source = path.read
@@ -55,9 +52,6 @@ class Configurability::Config
55
52
 
56
53
 
57
54
  ### Recursive hash-merge function. Used as the block argument to a Hash#merge.
58
- ### @param [Symbol] key the key that's in conflict
59
- ### @param [Object] oldval the value in the original Hash
60
- ### @param [Object] newval the value in the Hash being merged
61
55
  def self::merge_complex_hashes( key, oldval, newval )
62
56
  return oldval.merge( newval, &method(:merge_complex_hashes) ) if
63
57
  oldval.is_a?( Hash ) && newval.is_a?( Hash )
@@ -72,14 +66,9 @@ class Configurability::Config
72
66
 
73
67
  ### Create a new Configurability::Config object. If the optional +source+ argument
74
68
  ### is specified, parse the config from it.
75
- ###
76
- ### @param [String] source the YAML source of the configuration
77
- ### @param [String, Pathname] path the path to the config file (if loaded from a file)
78
- ### @param [Hash] defaults a Hash containing default values which the loaded values
79
- ### will be merged into.
80
- ### @yield The block will be evaluated in the context of the config object after
81
- ### the config is loaded, unless it accepts an argument, in which case the config
82
- ### object is passed as the argument.
69
+ ### If one is given, the block will be evaluated in the context of the config object after
70
+ ### the config is loaded, unless it accepts an argument, in which case the config
71
+ ### object is passed as the argument.
83
72
  def initialize( source=nil, path=nil, defaults=nil, &block )
84
73
 
85
74
  # Shift the hash parameter if it shows up as the path
@@ -124,13 +113,13 @@ class Configurability::Config
124
113
  def_delegators :@struct, :to_hash, :to_h, :member?, :members, :merge,
125
114
  :merge!, :each, :[], :[]=
126
115
 
127
- # @return [Configurability::Config::Struct] The underlying config data structure
116
+ # The underlying config data structure
128
117
  attr_reader :struct
129
118
 
130
- # @return [Time] The time the configuration was loaded
119
+ # The time the configuration was loaded
131
120
  attr_accessor :time_created
132
121
 
133
- # @return [Pathname] the path to the config file, if loaded from a file
122
+ # the path to the config file, if loaded from a file
134
123
  attr_accessor :path
135
124
 
136
125
 
@@ -205,7 +194,6 @@ class Configurability::Config
205
194
 
206
195
  ### Reload the configuration from the original source if it has
207
196
  ### changed. Returns +true+ if it was reloaded and +false+ otherwise.
208
- ###
209
197
  def reload
210
198
  raise "can't reload from an in-memory source" unless self.path
211
199
 
@@ -241,8 +229,6 @@ class Configurability::Config
241
229
 
242
230
 
243
231
  ### Read in the specified +filename+ and return a config struct.
244
- ### @param [String] source the YAML source to be converted
245
- ### @return [Configurability::Config::Struct] the converted config struct
246
232
  def make_configstruct_from_source( source, defaults=nil )
247
233
  defaults ||= {}
248
234
  mergefunc = Configurability::Config.method( :merge_complex_hashes )
@@ -353,7 +339,6 @@ class Configurability::Config
353
339
 
354
340
 
355
341
  ### Create a new ConfigStruct using the values from the given +hash+ if specified.
356
- ### @param [Hash] hash a hash of config values
357
342
  def initialize( hash=nil )
358
343
  hash ||= {}
359
344
  @hash = hash.dup
@@ -373,11 +358,8 @@ class Configurability::Config
373
358
  alias_method :each_section, :each
374
359
 
375
360
 
376
- ### Return the value associated with the specified +key+.
377
- ### @param [Symbol, String] key the key of the value to return
378
- ### @return [Object] the value associated with +key+, or another
379
- ### Configurability::Config::ConfigStruct if +key+
380
- ### is a section name.
361
+ # Return the value associated with the specified +key+, or another
362
+ # Configurability::Config::ConfigStruct if +key+ is a section name.
381
363
  def []( key )
382
364
  key = key.untaint.to_sym if key.respond_to?( :to_sym )
383
365
 
@@ -393,8 +375,6 @@ class Configurability::Config
393
375
 
394
376
 
395
377
  ### Set the value associated with the specified +key+ to +value+.
396
- ### @param [Symbol, String] key the key of the value to set
397
- ### @param [Object] value the value to set
398
378
  def []=( key, value )
399
379
  key = key.untaint.to_sym
400
380
  self.mark_dirty if @hash[ key ] != value
@@ -535,24 +515,18 @@ class Configurability::Config
535
515
 
536
516
 
537
517
  ### Create a reader method for the specified +key+ and return it.
538
- ### @param [Symbol] key the config key to create the reader method body for
539
- ### @return [Proc] the body of the new method
540
518
  def create_member_reader( key )
541
519
  return lambda { self[key] }
542
520
  end
543
521
 
544
522
 
545
523
  ### Create a predicate method for the specified +key+ and return it.
546
- ### @param [Symbol] key the config key to create the predicate method body for
547
- ### @return [Proc] the body of the new method
548
524
  def create_member_predicate( key )
549
525
  return lambda { self.member?( key ) && self[key] ? true : false }
550
526
  end
551
527
 
552
528
 
553
529
  ### Create a writer method for the specified +key+ and return it.
554
- ### @param [Symbol] key the config key to create the writer method body for
555
- ### @return [Proc] the body of the new method
556
530
  def create_member_writer( key )
557
531
  return lambda {|val| self[key] = val }
558
532
  end
@@ -3,8 +3,8 @@
3
3
  require 'configurability'
4
4
 
5
5
 
6
- ### Mixin that can be applied to classes to cause them to configure themselves
7
- ### as soon as they are able to.
6
+ # Mixin that can be applied to classes to cause them to configure themselves
7
+ # as soon as they are able to.
8
8
  module Configurability::DeferredConfig
9
9
 
10
10
  ### Extension hook: log when the mixin is used.
metadata CHANGED
@@ -1,138 +1,132 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: configurability
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.7
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 6
10
- version: 1.0.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Michael Granger
14
9
  autorequire:
15
10
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
11
+ cert_chain:
12
+ - ! '-----BEGIN CERTIFICATE-----
13
+
19
14
  MIIDLDCCAhSgAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQwwCgYDVQQDDANnZWQx
15
+
20
16
  FzAVBgoJkiaJk/IsZAEZFgdfYWVyaWVfMRMwEQYKCZImiZPyLGQBGRYDb3JnMB4X
17
+
21
18
  DTEwMDkxNjE0NDg1MVoXDTExMDkxNjE0NDg1MVowPDEMMAoGA1UEAwwDZ2VkMRcw
19
+
22
20
  FQYKCZImiZPyLGQBGRYHX2FlcmllXzETMBEGCgmSJomT8ixkARkWA29yZzCCASIw
21
+
23
22
  DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALy//BFxC1f/cPSnwtJBWoFiFrir
23
+
24
24
  h7RicI+joq/ocVXQqI4TDWPyF/8tqkvt+rD99X9qs2YeR8CU/YiIpLWrQOYST70J
25
+
25
26
  vDn7Uvhb2muFVqq6+vobeTkILBEO6pionWDG8jSbo3qKm1RjKJDwg9p4wNKhPuu8
27
+
26
28
  KGue/BFb67KflqyApPmPeb3Vdd9clspzqeFqp7cUBMEpFS6LWxy4Gk+qvFFJBJLB
29
+
27
30
  BUHE/LZVJMVzfpC5Uq+QmY7B+FH/QqNndn3tOHgsPadLTNimuB1sCuL1a4z3Pepd
31
+
28
32
  TeLBEFmEao5Dk3K/Q8o8vlbIB/jBDTUx6Djbgxw77909x6gI9doU4LD5XMcCAwEA
33
+
29
34
  AaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJeoGkOr9l4B
35
+
30
36
  +saMkW/ZXT4UeSvVMA0GCSqGSIb3DQEBBQUAA4IBAQBG2KObvYI2eHyyBUJSJ3jN
37
+
31
38
  vEnU3d60znAXbrSd2qb3r1lY1EPDD3bcy0MggCfGdg3Xu54z21oqyIdk8uGtWBPL
39
+
32
40
  HIa9EgfFGSUEgvcIvaYqiN4jTUtidfEFw+Ltjs8AP9gWgSIYS6Gr38V0WGFFNzIH
41
+
33
42
  aOD2wmu9oo/RffW4hS/8GuvfMzcw7CQ355wFR4KB/nyze+EsZ1Y5DerCAagMVuDQ
43
+
34
44
  U0BLmWDFzPGGWlPeQCrYHCr+AcJz+NRnaHCKLZdSKj/RHuTOt+gblRex8FAh8NeA
45
+
35
46
  cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
47
+
36
48
  -----END CERTIFICATE-----
37
49
 
38
- date: 2011-03-03 00:00:00 -08:00
39
- default_executable:
40
- dependencies:
41
- - !ruby/object:Gem::Dependency
50
+ '
51
+ date: 2011-10-13 00:00:00.000000000Z
52
+ dependencies:
53
+ - !ruby/object:Gem::Dependency
42
54
  name: hoe-mercurial
43
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
55
+ requirement: &2152906820 !ruby/object:Gem::Requirement
45
56
  none: false
46
- requirements:
57
+ requirements:
47
58
  - - ~>
48
- - !ruby/object:Gem::Version
49
- hash: 29
50
- segments:
51
- - 1
52
- - 2
53
- - 1
54
- version: 1.2.1
59
+ - !ruby/object:Gem::Version
60
+ version: 1.3.1
55
61
  type: :development
56
- version_requirements: *id001
57
- - !ruby/object:Gem::Dependency
58
- name: hoe-yard
59
62
  prerelease: false
60
- requirement: &id002 !ruby/object:Gem::Requirement
63
+ version_requirements: *2152906820
64
+ - !ruby/object:Gem::Dependency
65
+ name: hoe-highline
66
+ requirement: &2152905680 !ruby/object:Gem::Requirement
61
67
  none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- hash: 31
66
- segments:
67
- - 0
68
- - 1
69
- - 2
70
- version: 0.1.2
68
+ requirements:
69
+ - - ~>
70
+ - !ruby/object:Gem::Version
71
+ version: 0.0.1
71
72
  type: :development
72
- version_requirements: *id002
73
- - !ruby/object:Gem::Dependency
74
- name: rspec
75
73
  prerelease: false
76
- requirement: &id003 !ruby/object:Gem::Requirement
74
+ version_requirements: *2152905680
75
+ - !ruby/object:Gem::Dependency
76
+ name: rspec
77
+ requirement: &2152905040 !ruby/object:Gem::Requirement
77
78
  none: false
78
- requirements:
79
+ requirements:
79
80
  - - ~>
80
- - !ruby/object:Gem::Version
81
- hash: 11
82
- segments:
83
- - 2
84
- - 4
85
- version: "2.4"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.4'
86
83
  type: :development
87
- version_requirements: *id003
88
- - !ruby/object:Gem::Dependency
89
- name: simplecov
90
84
  prerelease: false
91
- requirement: &id004 !ruby/object:Gem::Requirement
85
+ version_requirements: *2152905040
86
+ - !ruby/object:Gem::Dependency
87
+ name: simplecov
88
+ requirement: &2152904600 !ruby/object:Gem::Requirement
92
89
  none: false
93
- requirements:
90
+ requirements:
94
91
  - - ~>
95
- - !ruby/object:Gem::Version
96
- hash: 13
97
- segments:
98
- - 0
99
- - 3
100
- version: "0.3"
92
+ - !ruby/object:Gem::Version
93
+ version: '0.3'
101
94
  type: :development
102
- version_requirements: *id004
103
- - !ruby/object:Gem::Dependency
104
- name: hoe
105
95
  prerelease: false
106
- requirement: &id005 !ruby/object:Gem::Requirement
96
+ version_requirements: *2152904600
97
+ - !ruby/object:Gem::Dependency
98
+ name: hoe
99
+ requirement: &2152904160 !ruby/object:Gem::Requirement
107
100
  none: false
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- hash: 43
112
- segments:
113
- - 2
114
- - 9
115
- - 0
116
- version: 2.9.0
101
+ requirements:
102
+ - - ~>
103
+ - !ruby/object:Gem::Version
104
+ version: '2.12'
117
105
  type: :development
118
- version_requirements: *id005
119
- description: |-
120
- Configurability is a mixin that allows you to add configurability to one or
106
+ prerelease: false
107
+ version_requirements: *2152904160
108
+ description: ! 'Configurability is a mixin that allows you to add configurability
109
+ to one or
110
+
121
111
  more objects or classes. You can assign them each a subsection of the
112
+
122
113
  configuration, and then later, when the configuration is loaded, the
123
- configuration is split up and sent to the objects that will use it.
124
- email:
114
+
115
+ configuration is split up and sent to the objects that will use it.'
116
+ email:
125
117
  - ged@FaerieMUD.org
126
118
  executables: []
127
-
128
119
  extensions: []
129
-
130
- extra_rdoc_files:
131
- - History.md
132
- files:
133
- - History.md
120
+ extra_rdoc_files:
121
+ - Manifest.txt
122
+ - History.rdoc
123
+ - README.rdoc
124
+ files:
125
+ - ChangeLog
126
+ - History.rdoc
134
127
  - LICENSE
135
- - README.md
128
+ - Manifest.txt
129
+ - README.rdoc
136
130
  - Rakefile
137
131
  - examples/basicconfig.rb
138
132
  - examples/config.yml
@@ -146,46 +140,32 @@ files:
146
140
  - spec/configurability_spec.rb
147
141
  - spec/lib/helpers.rb
148
142
  - .gemtest
149
- has_rdoc: true
150
143
  homepage: http://bitbucket.org/ged/configurability
151
- licenses:
144
+ licenses:
152
145
  - BSD
153
- post_install_message: "\n\n\
154
- New!\n\n\
155
- \t"
156
- rdoc_options:
157
- - --protected
158
- - --verbose
159
- - --title
160
- - Configurability Documentation
161
- require_paths:
146
+ post_install_message:
147
+ rdoc_options:
148
+ - --main
149
+ - README.rdoc
150
+ require_paths:
162
151
  - lib
163
- required_ruby_version: !ruby/object:Gem::Requirement
152
+ required_ruby_version: !ruby/object:Gem::Requirement
164
153
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- hash: 57
169
- segments:
170
- - 1
171
- - 8
172
- - 7
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
173
157
  version: 1.8.7
174
- required_rubygems_version: !ruby/object:Gem::Requirement
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
159
  none: false
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- hash: 3
180
- segments:
181
- - 0
182
- version: "0"
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
183
164
  requirements: []
184
-
185
165
  rubyforge_project: configurability
186
- rubygems_version: 1.6.0
166
+ rubygems_version: 1.8.10
187
167
  signing_key:
188
168
  specification_version: 3
189
- summary: Configurability is a mixin that allows you to add configurability to one or more objects or classes
169
+ summary: Configurability is a mixin that allows you to add configurability to one
170
+ or more objects or classes
190
171
  test_files: []
191
-
metadata.gz.sig CHANGED
Binary file