rconfig 0.3.2 → 0.3.3
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.
- data/README.rdoc +103 -0
- data/lib/rconfig/config_hash.rb +2 -2
- metadata +43 -44
data/README.rdoc
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
|
2
|
+
= RConfig
|
3
|
+
|
4
|
+
The complete solution for Ruby Configuration Management. RConfig is a Ruby library that manages configuration within Ruby applications. It bridges the gap between yaml, xml, and key/value based properties files, by providing a centralized solution to handle application configuration from one location. It provides the simplicity of hash-based access, that Rubyists have come to know and love, supporting your configuration style of choice, while providing many new features, and an elegant API.
|
5
|
+
|
6
|
+
== Features
|
7
|
+
|
8
|
+
* Simple, easy to install and use.
|
9
|
+
* Supports yaml, xml, and properties files.
|
10
|
+
* Yaml and xml files support infinite level of configuration grouping.
|
11
|
+
* Properties files support git config-like configuration grouping.
|
12
|
+
* Intuitive dot-notation 'key chaining' argument access.
|
13
|
+
* Simple well-known hash/array based argument access.
|
14
|
+
* Implements multilevel caching to reduce disk access.
|
15
|
+
* Short-hand access to 'global' application configuration, and shell environment.
|
16
|
+
* Overlays multiple configuration files to support environment and host-specific configuration.
|
17
|
+
* Onload callbacks for single, multiple, or any config file.
|
18
|
+
|
19
|
+
== Example
|
20
|
+
|
21
|
+
shell/console =>
|
22
|
+
export LANG=en
|
23
|
+
|
24
|
+
demo.yml =>
|
25
|
+
server:
|
26
|
+
address: host.domain.com
|
27
|
+
port: 81
|
28
|
+
...
|
29
|
+
|
30
|
+
application.properties =>
|
31
|
+
debug_level=verbose
|
32
|
+
...
|
33
|
+
|
34
|
+
demo.rb =>
|
35
|
+
require 'rconfig'
|
36
|
+
RConfig.config_paths = ['$HOME/config', '#{APP_ROOT}/config', '/demo/conf']
|
37
|
+
RConfig.demo[:server][:port] => 81
|
38
|
+
RConfig.demo.server.address => 'host.domain.com'
|
39
|
+
|
40
|
+
RConfig[:debug_level] => 'verbose'
|
41
|
+
RConfig[:lang] => 'en'
|
42
|
+
...
|
43
|
+
|
44
|
+
== Requirements
|
45
|
+
|
46
|
+
* Ruby (Developed on 1.8.7)
|
47
|
+
* RubyGems (Developed on 1.3.5)
|
48
|
+
* activesupport (2.2.2+)
|
49
|
+
|
50
|
+
== Install
|
51
|
+
|
52
|
+
sudo gem install rconfig
|
53
|
+
|
54
|
+
== ToDo
|
55
|
+
|
56
|
+
1. Finish JSpecs for existing code (Yeah, I know. You’re supposed to right the JSpecs first.)
|
57
|
+
2. Create re-factor goals based on Caliper metrics.
|
58
|
+
3. Prep for cleaner, stabler release.
|
59
|
+
|
60
|
+
|
61
|
+
== Feature Ideas
|
62
|
+
|
63
|
+
* Support for git-like config/properties files (You know, with the namespaced header blocks.).
|
64
|
+
* Support for Database-driven configuration.
|
65
|
+
* Removing dependency on ActiveSupport (Pull in needed code.).
|
66
|
+
* These are features I’m considering. E-mail me <rahmal@gmail.com> If you like to see a feature added or expedited.
|
67
|
+
|
68
|
+
|
69
|
+
== Known Issues
|
70
|
+
|
71
|
+
* None
|
72
|
+
|
73
|
+
== License
|
74
|
+
|
75
|
+
(The MIT License)
|
76
|
+
|
77
|
+
Copyright (c) 2009 Rahmal Conda <rahmal@gmail.com>
|
78
|
+
|
79
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
80
|
+
a copy of this software and associated documentation files (the
|
81
|
+
'Software'), to deal in the Software without restriction, including
|
82
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
83
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
84
|
+
permit persons to whom the Software is furnished to do so, subject to
|
85
|
+
the following conditions:
|
86
|
+
|
87
|
+
The above copyright notice and this permission notice shall be
|
88
|
+
included in all copies or substantial portions of the Software.
|
89
|
+
|
90
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
91
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
92
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
93
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
94
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
95
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
96
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
97
|
+
|
98
|
+
== Credits
|
99
|
+
|
100
|
+
Thanks to everyone I included here. RConfig would not exist without their contributions.
|
101
|
+
|
102
|
+
Mike Sandler, Kurt Stephens, CashNetUSA (CNU):
|
103
|
+
* Wrote the proprietary class RConfig was originally based on.
|
data/lib/rconfig/config_hash.rb
CHANGED
@@ -43,10 +43,10 @@ class ConfigHash < HashWithIndifferentAccess
|
|
43
43
|
# STDERR.puts "CHF#method_missing(#{method.inspect}, #{args.inspect}) on #{self.inspect}:#{self.class}" if method == 'dup'
|
44
44
|
value = self[method]
|
45
45
|
case args.size
|
46
|
-
when 0
|
46
|
+
when 0
|
47
47
|
# e.g.: RConfig.application.method
|
48
48
|
;
|
49
|
-
when 1
|
49
|
+
when 1
|
50
50
|
# e.g.: RConfig.application.method(one_arg)
|
51
51
|
value = value.send(args[0])
|
52
52
|
else
|
metadata
CHANGED
@@ -1,76 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rconfig
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Rahmal Conda
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-23 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: activesupport
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Version
|
16
|
+
requirement: &2152498960 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 2.2.2
|
24
|
-
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2152498960
|
25
25
|
description: The complete solution for Ruby Configuration Management
|
26
26
|
email: rahmal@gmail.com
|
27
27
|
executables: []
|
28
|
-
|
29
28
|
extensions: []
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
extra_rdoc_files:
|
30
|
+
- README.rdoc
|
31
|
+
files:
|
32
|
+
- lib/rconfig/config_hash.rb
|
33
|
+
- lib/rconfig/core_ext/hash.rb
|
34
|
+
- lib/rconfig/core_ext.rb
|
34
35
|
- lib/rconfig/exceptions.rb
|
35
36
|
- lib/rconfig/properties_file_parser.rb
|
36
|
-
- lib/rconfig/core_ext/hash.rb
|
37
|
-
- lib/rconfig/config_hash.rb
|
38
37
|
- lib/rconfig/rconfig.rb
|
39
|
-
- lib/rconfig/core_ext.rb
|
40
38
|
- lib/rconfig.rb
|
41
|
-
|
39
|
+
- README.rdoc
|
40
|
+
- test/rconfig_test.rb
|
42
41
|
homepage: http://www.rahmalconda.com
|
43
42
|
licenses: []
|
44
|
-
|
45
43
|
post_install_message:
|
46
|
-
rdoc_options:
|
44
|
+
rdoc_options:
|
47
45
|
- --line-numbers
|
48
46
|
- --inline-source
|
49
47
|
- --title
|
50
48
|
- RConfig
|
51
49
|
- --main
|
52
50
|
- README.rdoc
|
53
|
-
require_paths:
|
51
|
+
require_paths:
|
54
52
|
- lib
|
55
53
|
- tasks
|
56
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
68
66
|
requirements: []
|
69
|
-
|
70
67
|
rubyforge_project: rconda-rconfig
|
71
|
-
rubygems_version: 1.
|
68
|
+
rubygems_version: 1.8.6
|
72
69
|
signing_key:
|
73
70
|
specification_version: 3
|
74
|
-
summary: RConfig manages configuration within Ruby applications. It supports yaml,
|
75
|
-
|
71
|
+
summary: RConfig manages configuration within Ruby applications. It supports yaml,
|
72
|
+
xml, and properties files, with hash based and dot notation access, while providing
|
73
|
+
an elegant API.
|
74
|
+
test_files:
|
76
75
|
- test/rconfig_test.rb
|