public
Description: Rails configuration management plugin by Wonsys S.r.l.
Homepage:
Clone URL: git://github.com/wonsys/configuration_manager.git
100644 48 lines (31 sloc) 0.957 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ConfigurationManager
====================
 
Allows you to easily manage your app's configuration by using a YAML file to
store the configuration while accessing it from a class-like interface.
 
Inspiration taken from Peepcode's Rails Code Review:
http://peepcode.com/products/draft-rails-code-review-pdf
 
Install the plugin:
  script/plugin install http://wonsys.googlecode.com/svn/plugins/configuration_manager/
 
Bug tracker: http://wonsysos.16bugs.com/
 
Example
=======
 
File: config/configuration_manager.yml
 
everyone: &every_env
  key1: value1
  inner_hash:
    key2: value2
    
development: &non_production_env
  <<: *every_env
  key3: value3
  
test:
  <<: *non_production_env
 
production:
  <<: *every_env
  key4: value4
 
config/environment.rb
 
[SNIP]
MyConfig = ConfigurationManager.new_manager
 
Then use it like this:
 
MyConfig.key1 #=> value1
MyConfig.inner_hash.key2 #=> value2
 
 
Copyright (c) 2008 Wonsys S.r.l., released under the MIT license