rconfig 0.3.3 → 0.4.0

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.
Files changed (74) hide show
  1. data/.gitignore +17 -0
  2. data/.rspec +1 -0
  3. data/.rvmrc +1 -0
  4. data/ChangeLog +50 -0
  5. data/Credits +13 -0
  6. data/Gemfile +9 -0
  7. data/Gemfile.lock +30 -0
  8. data/LICENSE.txt +20 -0
  9. data/README.rdoc +0 -0
  10. data/Rakefile +11 -0
  11. data/demo/application.conf +3 -0
  12. data/demo/demo.conf +13 -0
  13. data/demo/demo.rb +14 -0
  14. data/demo/demo.xml +13 -0
  15. data/demo/demo.yml +12 -0
  16. data/doc/classes/ClassVariables.html +111 -0
  17. data/doc/classes/ConfigError.html +120 -0
  18. data/doc/classes/ConfigHash.html +354 -0
  19. data/doc/classes/Constants.html +226 -0
  20. data/doc/classes/Hash.html +269 -0
  21. data/doc/classes/InvalidConfigPathError.html +119 -0
  22. data/doc/classes/Object.html +220 -0
  23. data/doc/classes/PropertiesFileParser.html +282 -0
  24. data/doc/classes/RConfig.html +1745 -0
  25. data/doc/created.rid +1 -0
  26. data/doc/files/README_rdoc.html +271 -0
  27. data/doc/files/lib/rconfig/class_variables_rb.html +107 -0
  28. data/doc/files/lib/rconfig/config_hash_rb.html +114 -0
  29. data/doc/files/lib/rconfig/constants_rb.html +101 -0
  30. data/doc/files/lib/rconfig/core_ext/hash_rb.html +114 -0
  31. data/doc/files/lib/rconfig/core_ext/object_rb.html +101 -0
  32. data/doc/files/lib/rconfig/core_ext_rb.html +114 -0
  33. data/doc/files/lib/rconfig/exceptions_rb.html +110 -0
  34. data/doc/files/lib/rconfig/properties_file_parser_rb.html +146 -0
  35. data/doc/files/lib/rconfig/rconfig_rb.html +186 -0
  36. data/doc/files/lib/rconfig_rb.html +117 -0
  37. data/doc/fr_class_index.html +35 -0
  38. data/doc/fr_file_index.html +37 -0
  39. data/doc/fr_method_index.html +75 -0
  40. data/doc/index.html +24 -0
  41. data/doc/rdoc-style.css +208 -0
  42. data/lib/generators/rconfig/install_generator.rb +13 -0
  43. data/lib/generators/rconfig/templates/rconfig.rb +82 -0
  44. data/lib/rconfig.rb +98 -32
  45. data/lib/rconfig/callbacks.rb +46 -0
  46. data/lib/rconfig/cascade.rb +56 -0
  47. data/lib/rconfig/config.rb +78 -0
  48. data/lib/rconfig/constants.rb +58 -0
  49. data/lib/rconfig/core_ext/array.rb +3 -0
  50. data/lib/rconfig/core_ext/hash.rb +56 -57
  51. data/lib/rconfig/core_ext/nil.rb +5 -0
  52. data/lib/rconfig/core_ext/string.rb +3 -0
  53. data/lib/rconfig/core_methods.rb +276 -0
  54. data/lib/rconfig/exceptions.rb +21 -8
  55. data/lib/rconfig/load_paths.rb +55 -0
  56. data/lib/rconfig/logger.rb +86 -0
  57. data/lib/rconfig/properties_file.rb +138 -0
  58. data/lib/rconfig/reload.rb +75 -0
  59. data/lib/rconfig/settings.rb +93 -0
  60. data/lib/rconfig/utils.rb +175 -0
  61. data/lib/tasks/gem.rake +14 -0
  62. data/lib/tasks/rdoc.rake +11 -0
  63. data/lib/tasks/spec.rake +25 -0
  64. data/rconfig.gemspec +33 -0
  65. data/spec/core_ext/object_spec.rb +44 -0
  66. data/spec/rconfig_spec.rb +7 -0
  67. data/spec/spec.opts +4 -0
  68. data/spec/spec_helper.rb +16 -0
  69. metadata +128 -32
  70. data/lib/rconfig/config_hash.rb +0 -105
  71. data/lib/rconfig/core_ext.rb +0 -6
  72. data/lib/rconfig/properties_file_parser.rb +0 -80
  73. data/lib/rconfig/rconfig.rb +0 -871
  74. data/test/rconfig_test.rb +0 -381
@@ -0,0 +1,354 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: ConfigHash</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">ConfigHash</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/rconfig/config_hash_rb.html">
59
+ lib/rconfig/config_hash.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ HashWithIndifferentAccess
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ Copyright (c) 2009 Rahmal Conda &lt;rahmal@gmail.com&gt;
84
+ </p>
85
+ <p>
86
+ <a href="ConfigHash.html">ConfigHash</a> is a special class, derived from
87
+ HashWithIndifferentAccess. It was specifically created for handling config
88
+ data or creating mock objects from yaml files. It provides a dotted
89
+ notation for accessing embedded hash values, similar to the way one might
90
+ traverse a object tree.
91
+ </p>
92
+
93
+ </div>
94
+
95
+
96
+ </div>
97
+
98
+ <div id="method-list">
99
+ <h3 class="section-bar">Methods</h3>
100
+
101
+ <div class="name-list">
102
+ <a href="#M000006">[]</a>&nbsp;&nbsp;
103
+ <a href="#M000009">convert_value</a>&nbsp;&nbsp;
104
+ <a href="#M000007">default</a>&nbsp;&nbsp;
105
+ <a href="#M000004">dup</a>&nbsp;&nbsp;
106
+ <a href="#M000005">method_missing</a>&nbsp;&nbsp;
107
+ <a href="#M000008">update</a>&nbsp;&nbsp;
108
+ </div>
109
+ </div>
110
+
111
+ </div>
112
+
113
+
114
+ <!-- if includes -->
115
+
116
+ <div id="section">
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ <!-- if method_list -->
126
+ <div id="methods">
127
+ <h3 class="section-bar">Public Instance methods</h3>
128
+
129
+ <div id="method-M000006" class="method-detail">
130
+ <a name="M000006"></a>
131
+
132
+ <div class="method-heading">
133
+ <a href="#M000006" class="method-signature">
134
+ <span class="method-name">[]</span><span class="method-args">(key)</span>
135
+ </a>
136
+ </div>
137
+
138
+ <div class="method-description">
139
+ <p>
140
+ Why the &amp;*#^@*^&amp;$ isn&#8216;t HashWithIndifferentAccess actually
141
+ doing this?
142
+ </p>
143
+ <p><a class="source-toggle" href="#"
144
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
145
+ <div class="method-source-code" id="M000006-source">
146
+ <pre>
147
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 62</span>
148
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
149
+ <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Symbol</span>)
150
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">key</span>)
151
+ <span class="ruby-keyword kw">end</span>
152
+ </pre>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+ <div id="method-M000009" class="method-detail">
158
+ <a name="M000009"></a>
159
+
160
+ <div class="method-heading">
161
+ <a href="#M000009" class="method-signature">
162
+ <span class="method-name">convert_value</span><span class="method-args">(value)</span>
163
+ </a>
164
+ </div>
165
+
166
+ <div class="method-description">
167
+ <p>
168
+ Override WithIndifferentAccess#convert_value return instances of this class
169
+ for <a href="Hash.html">Hash</a> values.
170
+ </p>
171
+ <p><a class="source-toggle" href="#"
172
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
173
+ <div class="method-source-code" id="M000009-source">
174
+ <pre>
175
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 100</span>
176
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_value</span>(<span class="ruby-identifier">value</span>)
177
+ <span class="ruby-comment cmt"># STDERR.puts &quot;convert_value(#{value.inspect}:#{value.class})&quot;</span>
178
+ <span class="ruby-identifier">value</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hash</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>).<span class="ruby-identifier">freeze</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span>
179
+ <span class="ruby-keyword kw">end</span>
180
+ </pre>
181
+ </div>
182
+ </div>
183
+ </div>
184
+
185
+ <div id="method-M000007" class="method-detail">
186
+ <a name="M000007"></a>
187
+
188
+ <div class="method-heading">
189
+ <a href="#M000007" class="method-signature">
190
+ <span class="method-name">default</span><span class="method-args">(key = @@no_key)</span>
191
+ </a>
192
+ </div>
193
+
194
+ <div class="method-description">
195
+ <p><a class="source-toggle" href="#"
196
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
197
+ <div class="method-source-code" id="M000007-source">
198
+ <pre>
199
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 74</span>
200
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default</span>(<span class="ruby-identifier">key</span> = <span class="ruby-ivar">@@no_key</span>)
201
+ <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
202
+ <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@@no_key</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'default'</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">default_Hash</span>(<span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@@no_key</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">key</span>)
203
+ <span class="ruby-keyword kw">end</span>
204
+ </pre>
205
+ </div>
206
+ </div>
207
+ </div>
208
+
209
+ <div id="method-M000004" class="method-detail">
210
+ <a name="M000004"></a>
211
+
212
+ <div class="method-heading">
213
+ <a href="#M000004" class="method-signature">
214
+ <span class="method-name">dup</span><span class="method-args">()</span>
215
+ </a>
216
+ </div>
217
+
218
+ <div class="method-description">
219
+ <p>
220
+ HashWithIndifferentAccess#dup always returns HashWithIndifferentAccess!
221
+ </p>
222
+ <p><a class="source-toggle" href="#"
223
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
224
+ <div class="method-source-code" id="M000004-source">
225
+ <pre>
226
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 12</span>
227
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dup</span>
228
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
229
+ <span class="ruby-keyword kw">end</span>
230
+ </pre>
231
+ </div>
232
+ </div>
233
+ </div>
234
+
235
+ <div id="method-M000005" class="method-detail">
236
+ <a name="M000005"></a>
237
+
238
+ <div class="method-heading">
239
+ <a href="#M000005" class="method-signature">
240
+ <span class="method-name">method_missing</span><span class="method-args">(method, *args)</span>
241
+ </a>
242
+ </div>
243
+
244
+ <div class="method-description">
245
+ <p>
246
+ Dotted notation can be used with arguments (useful for creating mock
247
+ objects) in the YAML file the method name is a key, argument(s) form a
248
+ nested key, so that the correct value is retrieved and returned.
249
+ </p>
250
+ <p>
251
+ For example loading to variable foo a yaml file that looks like: customer:
252
+ </p>
253
+ <pre>
254
+ id: 12345678
255
+ verified:
256
+ phone: verified
257
+ :address: info_not_available
258
+ ? [name, employer]
259
+ : not_verified
260
+ </pre>
261
+ <p>
262
+ Allows the following calls: foo.customer.id =&gt; 12345678
263
+ foo.customer.verified.phone =&gt; verified
264
+ foo.customer.verified(&quot;phone&quot;) =&gt; verified
265
+ foo.customer.verified(:address) =&gt; info_not_available
266
+ foo.customer.verified(&quot;name&quot;, &quot;employer&quot;) =&gt;
267
+ not_verified
268
+ </p>
269
+ <p>
270
+ Note that :address is specified as a symbol, where phone is just a string.
271
+ Depending on what kind of parameter the method being mocked out is going to
272
+ be called with, define in the YAML file either a string or a symbol. This
273
+ also works inside the composite array keys.
274
+ </p>
275
+ <p><a class="source-toggle" href="#"
276
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
277
+ <div class="method-source-code" id="M000005-source">
278
+ <pre>
279
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 41</span>
280
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
281
+ <span class="ruby-identifier">method</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>
282
+ <span class="ruby-comment cmt"># STDERR.puts &quot;CHF#method_missing(#{method.inspect}, #{args.inspect}) on #{self.inspect}:#{self.class}&quot; if method == 'dup'</span>
283
+ <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">method</span>]
284
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span>
285
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
286
+ <span class="ruby-comment cmt"># e.g.: RConfig.application.method</span>
287
+ ;
288
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
289
+ <span class="ruby-comment cmt"># e.g.: RConfig.application.method(one_arg)</span>
290
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>])
291
+ <span class="ruby-keyword kw">else</span>
292
+ <span class="ruby-comment cmt"># e.g.: RConfig.application.method(arg_one, args_two, ...)</span>
293
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">value</span>[<span class="ruby-identifier">args</span>]
294
+ <span class="ruby-keyword kw">end</span>
295
+ <span class="ruby-comment cmt"># value = convert_value(value)</span>
296
+ <span class="ruby-identifier">value</span>
297
+ <span class="ruby-keyword kw">end</span>
298
+ </pre>
299
+ </div>
300
+ </div>
301
+ </div>
302
+
303
+ <div id="method-M000008" class="method-detail">
304
+ <a name="M000008"></a>
305
+
306
+ <div class="method-heading">
307
+ <a href="#M000008" class="method-signature">
308
+ <span class="method-name">update</span><span class="method-args">(hash)</span>
309
+ </a>
310
+ </div>
311
+
312
+ <div class="method-description">
313
+ <p>
314
+ HashWithIndifferentAccess#update is broken! Hash#update returns self, BUT,
315
+ HashWithIndifferentAccess#update does not!
316
+ </p>
317
+ <pre>
318
+ { :a =&gt; 1 }.update({ :b =&gt; 2, :c =&gt; 3 })
319
+ =&gt; { :a =&gt; 1, :b =&gt; 2, :c =&gt; 3 }
320
+
321
+ HashWithIndifferentAccess.new({ :a =&gt; 1 }).update({ :b =&gt; 2, :c =&gt; 3 })
322
+ =&gt; { :b =&gt; 2, :c =&gt; 3 } # WTF?
323
+ </pre>
324
+ <p>
325
+ Subclasses should <b>never</b> override methods and break their
326
+ protocols!!!!
327
+ </p>
328
+ <p><a class="source-toggle" href="#"
329
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
330
+ <div class="method-source-code" id="M000008-source">
331
+ <pre>
332
+ <span class="ruby-comment cmt"># File lib/rconfig/config_hash.rb, line 92</span>
333
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">hash</span>)
334
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
335
+ <span class="ruby-keyword kw">self</span>
336
+ <span class="ruby-keyword kw">end</span>
337
+ </pre>
338
+ </div>
339
+ </div>
340
+ </div>
341
+
342
+
343
+ </div>
344
+
345
+
346
+ </div>
347
+
348
+
349
+ <div id="validator-badges">
350
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
351
+ </div>
352
+
353
+ </body>
354
+ </html>
@@ -0,0 +1,226 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: Constants</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">Constants</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/rconfig/constants_rb.html">
59
+ lib/rconfig/constants.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+
80
+ </div>
81
+
82
+
83
+ <!-- if includes -->
84
+
85
+ <div id="section">
86
+
87
+
88
+ <div id="constants-list">
89
+ <h3 class="section-bar">Constants</h3>
90
+
91
+ <div class="name-list">
92
+ <table summary="Constants">
93
+ <tr class="top-aligned-row context-row">
94
+ <td class="context-item-name">CONFIG_ROOT</td>
95
+ <td>=</td>
96
+ <td class="context-item-value">RAILS_ROOT + &quot;/config&quot; if defined?(RAILS_ROOT) &amp;&amp; defined?(CONFIG_ROOT)</td>
97
+ <td width="3em">&nbsp;</td>
98
+ <td class="context-item-desc">
99
+ Sets CONFIG_ROOT to RAILS_ROOT/config unless it has already been defined
100
+ (i.e. in rails env, or calling ruby app).
101
+
102
+ </td>
103
+ </tr>
104
+ <tr class="top-aligned-row context-row">
105
+ <td class="context-item-name">ENV_TIER</td>
106
+ <td>=</td>
107
+ <td class="context-item-value">(defined?(RAILS_ENV) ? RAILS_ENV : (ENV['TIER'] || 'production')) unless defined? ENV_TIER</td>
108
+ <td width="3em">&nbsp;</td>
109
+ <td class="context-item-desc">
110
+ ENV TIER i.e. (development, integration, staging, or production) Defaults
111
+ to RAILS_ENV if running in Rails, otherwise, it checks if
112
+ ENV[&#8216;TIER&#8217;] is present. If not, it assumes production.
113
+
114
+ </td>
115
+ </tr>
116
+ <tr class="top-aligned-row context-row">
117
+ <td class="context-item-name">YML_FILE_TYPES</td>
118
+ <td>=</td>
119
+ <td class="context-item-value">[:yml, :yaml] unless defined? YML_FILE_TYPES</td>
120
+ <td width="3em">&nbsp;</td>
121
+ <td class="context-item-desc">
122
+ yml, yaml =&gt; yaml files, parsable by YAML library
123
+
124
+ </td>
125
+ </tr>
126
+ <tr class="top-aligned-row context-row">
127
+ <td class="context-item-name">XML_FILE_TYPES</td>
128
+ <td>=</td>
129
+ <td class="context-item-value">[:xml] unless defined? XML_FILE_TYPES</td>
130
+ <td width="3em">&nbsp;</td>
131
+ <td class="context-item-desc">
132
+ xml =&gt; self-explanatory
133
+
134
+ </td>
135
+ </tr>
136
+ <tr class="top-aligned-row context-row">
137
+ <td class="context-item-name">CNF_FILE_TYPES</td>
138
+ <td>=</td>
139
+ <td class="context-item-value">[:cnf, :conf, :config, :properties] unless defined? CNF_FILE_TYPES</td>
140
+ <td width="3em">&nbsp;</td>
141
+ <td class="context-item-desc">
142
+ conf, properties =&gt; &lt;key=value&gt; based config files
143
+
144
+ </td>
145
+ </tr>
146
+ <tr class="top-aligned-row context-row">
147
+ <td class="context-item-name">CONFIG_FILE_TYPES</td>
148
+ <td>=</td>
149
+ <td class="context-item-value">YML_FILE_TYPES + XML_FILE_TYPES + CNF_FILE_TYPES unless defined? CONFIG_FILE_TYPES</td>
150
+ <td width="3em">&nbsp;</td>
151
+ <td class="context-item-desc">
152
+ The type of file used for config. Valid choices include (yml, yaml, xml,
153
+ conf, config, properties)
154
+
155
+ </td>
156
+ </tr>
157
+ <tr class="top-aligned-row context-row">
158
+ <td class="context-item-name">HOSTNAME</td>
159
+ <td>=</td>
160
+ <td class="context-item-value">ENV['CONFIG_HOSTNAME'] || Socket.gethostname unless defined? HOSTNAME</td>
161
+ <td width="3em">&nbsp;</td>
162
+ <td class="context-item-desc">
163
+ Use CONFIG_HOSTNAME environment variable to test host-based configurations.
164
+
165
+ </td>
166
+ </tr>
167
+ <tr class="top-aligned-row context-row">
168
+ <td class="context-item-name">HOSTNAME_SHORT</td>
169
+ <td>=</td>
170
+ <td class="context-item-value">HOSTNAME.sub(/\..*$/, '').freeze unless defined? HOSTNAME_SHORT</td>
171
+ <td width="3em">&nbsp;</td>
172
+ <td class="context-item-desc">
173
+ Short Hostname: removes all chars from HOSTNAME, after first &quot;.&quot;
174
+ Used to specify machine-specific config files.
175
+
176
+ </td>
177
+ </tr>
178
+ <tr class="top-aligned-row context-row">
179
+ <td class="context-item-name">SUFFIXES</td>
180
+ <td>=</td>
181
+ <td class="context-item-value">[nil, :local, :config, :local_config, ENV_TIER, [ENV_TIER, :local], HOSTNAME_SHORT, [HOSTNAME_SHORT, :config_local], HOSTNAME, [HOSTNAME, :config_local]</td>
182
+ <td width="3em">&nbsp;</td>
183
+ <td class="context-item-desc">
184
+ This is an array of filename suffixes facilitates overriding configuration
185
+ (i.e. &#8216;services_local&#8217;, &#8216;services_development&#8217;).
186
+ These files get loaded in order of the array the last file loaded gets
187
+ splatted on top of everything there. Ex. database_whiskey.yml overrides
188
+ database_integration.yml
189
+
190
+ <pre>
191
+ overrides database.yml
192
+ </pre>
193
+ </td>
194
+ </tr>
195
+ <tr class="top-aligned-row context-row">
196
+ <td class="context-item-name">EMPTY_ARRAY</td>
197
+ <td>=</td>
198
+ <td class="context-item-value">[].freeze unless defined? EMPTY_ARRAY</td>
199
+ <td width="3em">&nbsp;</td>
200
+ <td class="context-item-desc">
201
+ Used in place of undefined but expected arrays, to prevent creating a bunch
202
+ of unecesary arrays in memory. See ConfigCore.fire_on_load
203
+
204
+ </td>
205
+ </tr>
206
+ </table>
207
+ </div>
208
+ </div>
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <!-- if method_list -->
216
+
217
+
218
+ </div>
219
+
220
+
221
+ <div id="validator-badges">
222
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
223
+ </div>
224
+
225
+ </body>
226
+ </html>