rconfig 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -0
- data/README.rdoc +40 -24
- data/lib/generators/rconfig/install_generator.rb +4 -3
- data/lib/rconfig.rb +2 -1
- data/lib/rconfig/core_methods.rb +1 -1
- metadata +11 -13
data/ChangeLog
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
0.4.1
|
2
|
+
=====
|
3
|
+
* Fixed error occuring in non-Rails apps (NameError/HashWithIndifferentAccess missing) - From vandries/rconfig (github)
|
4
|
+
* Fixed install generator
|
5
|
+
* Fixed application file shorthand (i.e. RConfig[key] == RConfig.application.key)
|
6
|
+
|
1
7
|
0.4.0
|
2
8
|
=====
|
3
9
|
* Broke RConfig core into separate modules to decrease core class size.
|
data/README.rdoc
CHANGED
@@ -13,8 +13,37 @@ The complete solution for Ruby Configuration Management. RConfig is a Ruby libra
|
|
13
13
|
* Simple well-known hash/array based argument access.
|
14
14
|
* Implements multilevel caching to reduce disk access.
|
15
15
|
* Short-hand access to 'global' application configuration, and shell environment.
|
16
|
-
*
|
17
|
-
*
|
16
|
+
* Cascades multiple configuration files to support environment and host-specific configuration.
|
17
|
+
* On-load callbacks for single, multiple, or any config file.
|
18
|
+
* Embedded ruby code with ERB templating.
|
19
|
+
* Support for referencing values in property files (Yaml also has built in support using node anchors).
|
20
|
+
|
21
|
+
|
22
|
+
== Getting Started
|
23
|
+
=== Rails Apps
|
24
|
+
RConfig is released as a Ruby Gem. The gem is to be installed within a Ruby on Rails 3 application. To install, simply add the following to your Gemfile:
|
25
|
+
|
26
|
+
# Gemfile
|
27
|
+
gem 'rconfig'
|
28
|
+
|
29
|
+
After updating your bundle, run the installer
|
30
|
+
|
31
|
+
$> rails generate rconfig:install
|
32
|
+
|
33
|
+
The installer creates an initializer used for configuring defaults used by RConfig
|
34
|
+
|
35
|
+
=== Non-Rails Apps
|
36
|
+
If you're not using RConfig in a Rails app, and you don't use Gemfile you can install RConfig with RubyGems
|
37
|
+
|
38
|
+
gem install rconfig
|
39
|
+
|
40
|
+
|
41
|
+
== Requirements
|
42
|
+
Starting with version 0.4.0, RConfig requires at least Ruby 1.9, and Rails 3. Previous versions can be used in Ruby 1.8 and Rails 2.2+. Non-rails projects need ActiveSupport (>= 3 for RConfig 0.4.0, and > 2.2 for RConfig 0.3).
|
43
|
+
|
44
|
+
* Ruby 1.9+
|
45
|
+
* ActiveSupport 3.0+
|
46
|
+
|
18
47
|
|
19
48
|
== Example
|
20
49
|
|
@@ -25,10 +54,13 @@ The complete solution for Ruby Configuration Management. RConfig is a Ruby libra
|
|
25
54
|
server:
|
26
55
|
address: host.domain.com
|
27
56
|
port: 81
|
57
|
+
host: <%= %x{host_name} %>
|
28
58
|
...
|
29
59
|
|
30
60
|
application.properties =>
|
31
61
|
debug_level=verbose
|
62
|
+
app_root=/home/rahmal/apps/rconfig
|
63
|
+
test_root=%{app_root}/tests
|
32
64
|
...
|
33
65
|
|
34
66
|
demo.rb =>
|
@@ -36,35 +68,19 @@ The complete solution for Ruby Configuration Management. RConfig is a Ruby libra
|
|
36
68
|
RConfig.config_paths = ['$HOME/config', '#{APP_ROOT}/config', '/demo/conf']
|
37
69
|
RConfig.demo[:server][:port] => 81
|
38
70
|
RConfig.demo.server.address => 'host.domain.com'
|
71
|
+
RConfig.demo.server.host => 'host.local'
|
72
|
+
|
73
|
+
RConfig.application.test_root => '/home/rahmal/apps/rconfig/tests'
|
39
74
|
|
40
75
|
RConfig[:debug_level] => 'verbose'
|
41
76
|
RConfig[:lang] => 'en'
|
42
77
|
...
|
43
78
|
|
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
79
|
|
63
|
-
|
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.
|
80
|
+
== Bugs and Feature Requests
|
67
81
|
|
82
|
+
* Bug Reports & Feature Requests: Please use to the [Issues page](https://github.com/rahmal/rconfig/issues)
|
83
|
+
* Want to Contribute? Send a Pull Request
|
68
84
|
|
69
85
|
== Known Issues
|
70
86
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module RConfig
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
|
-
|
5
|
-
source_root File.expand_path(
|
4
|
+
namespace 'rconfig:install'
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
desc 'Create RConfig settings initializer file'
|
6
7
|
|
7
8
|
def copy_initializer
|
8
|
-
template
|
9
|
+
template 'rconfig.rb', 'config/initializers/rconfig.rb'
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/rconfig.rb
CHANGED
@@ -59,12 +59,13 @@
|
|
59
59
|
# ...
|
60
60
|
#
|
61
61
|
require 'active_support'
|
62
|
+
require 'active_support/hash_with_indifferent_access'
|
62
63
|
require 'rconfig/core_ext/array'
|
63
64
|
require 'rconfig/core_ext/hash'
|
64
65
|
require 'rconfig/core_ext/nil'
|
65
66
|
|
66
67
|
module RConfig
|
67
|
-
VERSION = '0.4.
|
68
|
+
VERSION = '0.4.1'
|
68
69
|
|
69
70
|
autoload :Socket, 'socket'
|
70
71
|
autoload :YAML, 'yaml'
|
data/lib/rconfig/core_methods.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-20 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70294892823920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70294892823920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70294892823420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.3.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70294892823420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70294892822960 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70294892822960
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jeweler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70294892822440 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 1.6.4
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70294892822440
|
58
58
|
description: Configuration management library for Ruby applications.
|
59
59
|
email:
|
60
60
|
- rahmal@gmail.com
|
@@ -143,9 +143,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- - ! '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
|
-
segments:
|
147
|
-
- 0
|
148
|
-
hash: -4346478752822958469
|
149
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
147
|
none: false
|
151
148
|
requirements:
|
@@ -169,3 +166,4 @@ test_files:
|
|
169
166
|
- spec/rconfig_spec.rb
|
170
167
|
- spec/spec.opts
|
171
168
|
- spec/spec_helper.rb
|
169
|
+
has_rdoc:
|