configatron 1.2.2 → 2.0.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 (37) hide show
  1. data/README +61 -34
  2. data/doc/classes/Configatron.html +241 -0
  3. data/doc/classes/Configatron/ProtectedParameter.html +146 -0
  4. data/doc/classes/Configatron/Store.html +241 -121
  5. data/doc/classes/Kernel.html +13 -20
  6. data/doc/created.rid +1 -1
  7. data/doc/files/README.html +85 -43
  8. data/doc/files/lib/configatron/{configuration_rb.html → configatron_rb.html} +11 -4
  9. data/doc/files/lib/configatron/{helpers_rb.html → errors_rb.html} +4 -4
  10. data/doc/files/lib/configatron/kernel_rb.html +1 -1
  11. data/doc/files/lib/configatron/store_rb.html +1 -1
  12. data/doc/files/lib/configatron_rb.html +1 -2
  13. data/doc/fr_class_index.html +2 -4
  14. data/doc/fr_file_index.html +2 -3
  15. data/doc/fr_method_index.html +15 -21
  16. data/lib/configatron.rb +5 -44
  17. data/lib/configatron/configatron.rb +44 -0
  18. data/lib/configatron/errors.rb +7 -0
  19. data/lib/configatron/kernel.rb +3 -9
  20. data/lib/configatron/store.rb +148 -56
  21. data/spec/lib/configatron_spec.rb +293 -0
  22. data/spec/lib/futurama.yml +6 -0
  23. data/spec/spec_helper.rb +3 -2
  24. metadata +11 -18
  25. data/doc/classes/Configatron/Configuration.html +0 -402
  26. data/doc/classes/Configatron/Helpers.html +0 -174
  27. data/doc/classes/Configatron/YamlStore.html +0 -203
  28. data/doc/classes/Hash.html +0 -193
  29. data/doc/files/lib/configatron/yaml_store_rb.html +0 -101
  30. data/lib/configatron/configuration.rb +0 -112
  31. data/lib/configatron/helpers.rb +0 -27
  32. data/lib/configatron/yaml_store.rb +0 -33
  33. data/spec/unit/configuration_spec.rb +0 -299
  34. data/spec/unit/family_guy.yml +0 -2
  35. data/spec/unit/helpers_spec.rb +0 -115
  36. data/spec/unit/kernel_spec.rb +0 -48
  37. data/spec/unit/store_spec.rb +0 -91
@@ -80,7 +80,7 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000021">configatron</a>&nbsp;&nbsp;
83
+ <a href="#M000015">configatron</a>&nbsp;&nbsp;
84
84
  </div>
85
85
  </div>
86
86
 
@@ -102,35 +102,28 @@
102
102
  <div id="methods">
103
103
  <h3 class="section-bar">Public Instance methods</h3>
104
104
 
105
- <div id="method-M000021" class="method-detail">
106
- <a name="M000021"></a>
105
+ <div id="method-M000015" class="method-detail">
106
+ <a name="M000015"></a>
107
107
 
108
108
  <div class="method-heading">
109
- <a href="#M000021" class="method-signature">
110
- <span class="method-name">configatron</span><span class="method-args">(&amp;block)</span>
109
+ <a href="#M000015" class="method-signature">
110
+ <span class="method-name">configatron</span><span class="method-args">()</span>
111
111
  </a>
112
112
  </div>
113
113
 
114
114
  <div class="method-description">
115
115
  <p>
116
- If called without a block it will return the <a
117
- href="Configatron/Configuration.html">Configatron::Configuration</a>
118
- instance. If called with a block then it will call the
119
- Configatron::Configatron configure method and yield up a <a
120
- href="Configatron/Store.html">Configatron::Store</a> object.
116
+ Provides access to the <a href="Configatron.html">Configatron</a> storage
117
+ system.
121
118
  </p>
122
119
  <p><a class="source-toggle" href="#"
123
- onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
124
- <div class="method-source-code" id="M000021-source">
120
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
121
+ <div class="method-source-code" id="M000015-source">
125
122
  <pre>
126
- <span class="ruby-comment cmt"># File lib/configatron/kernel.rb, line 6</span>
127
- 6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configatron</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
128
- 7: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
129
- 8: <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
130
- 9: <span class="ruby-keyword kw">else</span>
131
- 10: <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance</span>
132
- 11: <span class="ruby-keyword kw">end</span>
133
- 12: <span class="ruby-keyword kw">end</span>
123
+ <span class="ruby-comment cmt"># File lib/configatron/kernel.rb, line 4</span>
124
+ 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configatron</span>
125
+ 5: <span class="ruby-constant">Configatron</span>.<span class="ruby-identifier">instance</span>
126
+ 6: <span class="ruby-keyword kw">end</span>
134
127
  </pre>
135
128
  </div>
136
129
  </div>
@@ -1 +1 @@
1
- Mon, 15 Sep 2008 11:06:30 -0400
1
+ Wed, 17 Sep 2008 15:25:17 -0400
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Sep 10 15:41:48 -0400 2008</td>
59
+ <td>Wed Sep 17 14:47:44 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -69,27 +69,25 @@
69
69
  <div id="contextContent">
70
70
 
71
71
  <div id="description">
72
- <h1>Configatron</h1>
72
+ <h1><a href="../classes/Configatron.html">Configatron</a></h1>
73
73
  <p>
74
- Configatron makes configuring your applications and scripts incredibly
75
- easy. No longer is a there a need to use constants or global variables. Now
76
- you can use a simple and painless system to configure your life. And,
77
- because it&#8216;s all Ruby, you can do any crazy thing you would like to!
74
+ <a href="../classes/Configatron.html">Configatron</a> makes configuring
75
+ your applications and scripts incredibly easy. No longer is a there a need
76
+ to use constants or global variables. Now you can use a simple and painless
77
+ system to configure your life. And, because it&#8216;s all Ruby, you can do
78
+ any crazy thing you would like to!
78
79
  </p>
79
80
  <h2>Examples</h2>
80
81
  <h3>Simple</h3>
81
82
  <pre>
82
- configatron do |config|
83
- config.email = &quot;mark@mackframework.com&quot;
84
- config.database_url = &quot;postgres://localhost/mack_framework_rocks&quot;
85
- # etc...
86
- end
83
+ configatron.email = 'me@example.com'
84
+ configatron.database_url = &quot;postgres://localhost/mack_framework_rocks&quot;
87
85
  </pre>
88
86
  <p>
89
87
  Now, anywhere in your code you can do the following:
90
88
  </p>
91
89
  <pre>
92
- configatron.email # =&gt; &quot;mark@mackframework.com&quot;
90
+ configatron.email # =&gt; &quot;me@example.com&quot;
93
91
  configatron.database_url # =&gt; &quot;postgres://localhost/mack_framework_rocks&quot;
94
92
  </pre>
95
93
  <p>
@@ -105,22 +103,20 @@ that is that is our production database url, not our development url. Fair
105
103
  enough, all you have to do is redeclare it:
106
104
  </p>
107
105
  <pre>
108
- configatron do |config|
109
- config.database_url = &quot;postgres://localhost/mack_framework_rocks_development&quot;
110
- end
106
+ configatron.database_url = &quot;postgres://localhost/mack_framework_rocks_development&quot;
111
107
  </pre>
112
108
  <p>
113
109
  becomes:
114
110
  </p>
115
111
  <pre>
116
- configatron.email # =&gt; &quot;mark@mackframework.com&quot;
112
+ configatron.email # =&gt; &quot;me@example.com&quot;
117
113
  configatron.database_url # =&gt; &quot;postgres://localhost/mack_framework_rocks_development&quot;
118
114
  </pre>
119
115
  <p>
120
116
  Notice how our other configuration parameters haven&#8216;t changed? Cool,
121
117
  eh?
122
118
  </p>
123
- <h3><a href="../classes/Hash.html">Hash</a>/YAML</h3>
119
+ <h3>Hash/YAML</h3>
124
120
  <p>
125
121
  You can configure configatron from a hash as well:
126
122
  </p>
@@ -145,26 +141,16 @@ file will be re-read in case changes have been made.
145
141
  <h3>Namespaces</h3>
146
142
  <p>
147
143
  The question that should be on your lips is what I need to have namespaced
148
- configuration parameters. It&#8216;s easy! Configatron allows you to create
144
+ configuration parameters. It&#8216;s easy! <a
145
+ href="../classes/Configatron.html">Configatron</a> allows you to create
149
146
  namespaces.
150
147
  </p>
151
148
  <pre>
152
- configatron do |config|
153
- config.website_url = &quot;http://www.mackframework.com&quot;
154
- config.namespace(:email) do |email|
155
- email.namespace(:pop) do |pop|
156
- pop.address = &quot;pop.example.com&quot;
157
- pop.port = &quot;110&quot;
158
- # etc ...
159
- end
160
- email.namespace(:smtp) do |smtp|
161
- smtp.address = &quot;smtp.example.com&quot;
162
- smtp.port = &quot;25&quot;
163
- # etc ...
164
- end
165
- end
166
- # etc...
167
- end
149
+ configatron.website_url = &quot;http://www.mackframework.com&quot;
150
+ configatron.email.pop.address = &quot;pop.example.com&quot;
151
+ configatron.email.pop.port = 110
152
+ configatron.email.smtp.address = &quot;smtp.example.com&quot;
153
+ configatron.email.smtp.port = 25
168
154
  </pre>
169
155
  <p>
170
156
  becomes:
@@ -175,24 +161,80 @@ becomes:
175
161
  configatron.website_url # =&gt; &quot;http://www.mackframework.com&quot;
176
162
  </pre>
177
163
  <p>
178
- Configatron allows you to nest namespaces to your hearts content! Just keep
179
- going, it&#8216;s that easy.
164
+ <a href="../classes/Configatron.html">Configatron</a> allows you to nest
165
+ namespaces to your hearts content! Just keep going, it&#8216;s that easy.
180
166
  </p>
181
167
  <p>
182
168
  Of course you can update a single parameter n levels deep as well:
183
169
  </p>
184
170
  <pre>
185
- configatron do |config|
186
- config.namespace(:email) do |email|
187
- email.namespace(:pop) do |pop|
188
- pop.address = &quot;pop2.example.com&quot;
189
- end
190
- end
191
- end
171
+ configatron.email.pop.address = &quot;pop2.example.com&quot;
192
172
 
193
173
  configatron.email.pop.address # =&gt; &quot;pop2.example.com&quot;
194
174
  configatron.email.smtp.address # =&gt; &quot;smtp.example.com&quot;
195
175
  </pre>
176
+ <h3>Misc.</h3>
177
+ <p>
178
+ Even if parameters haven&#8216;t been set, you can still call them, and
179
+ you&#8216;ll get nil back:
180
+ </p>
181
+ <pre>
182
+ configatron.i.dont.exist.nil? # =&gt; true
183
+ configatron.i.dont.exist # =&gt; nil
184
+ </pre>
185
+ <p>
186
+ You can set &#8216;default&#8217; values for parameters. If there is
187
+ already a setting, it won&#8216;t be replaced. This is useful if
188
+ you&#8216;ve already done your &#8216;configuration&#8217; and you call a
189
+ library, that needs to have parameters set. The library can set it&#8216;s
190
+ defaults, without worrying that it might have overridden your custom
191
+ settings.
192
+ </p>
193
+ <pre>
194
+ configatron.set_default(:name, 'Mark Bates')
195
+ configatron.name # =&gt; 'Mark Bates'
196
+ configatron.set_default(:name, 'Me')
197
+ configatron.name # =&gt; 'Mark Bates'
198
+ </pre>
199
+ <p>
200
+ Sometimes in testing, or other situations, you want to temporarily change
201
+ some settings. You can do this with the <tt>temp</tt> method:
202
+ </p>
203
+ <pre>
204
+ configatron.one = 1
205
+ configatron.letters.a = 'A'
206
+ configatron.letters.b = 'B'
207
+ configatron.temp do
208
+ configatron.letters.b = 'bb'
209
+ configatron.letters.c = 'c'
210
+ configatron.one # =&gt; 1
211
+ configatron.letters.a # =&gt; 'A'
212
+ configatron.letters.b # =&gt; 'bb'
213
+ configatron.letters.c # =&gt; 'c'
214
+ end
215
+ configatron.one # =&gt; 1
216
+ configatron.letters.a # =&gt; 'A'
217
+ configatron.letters.b # =&gt; 'B'
218
+ configatron.letters.c # =&gt; nil
219
+ </pre>
220
+ <p>
221
+ You can also pass in an optional Hash to the <tt>temp</tt>:
222
+ </p>
223
+ <pre>
224
+ configatron.one = 1
225
+ configatron.letters.a = 'A'
226
+ configatron.letters.b = 'B'
227
+ configatron.temp(:letters =&gt; {:b =&gt; 'bb', :c =&gt; 'c'}) do
228
+ configatron.one == 1
229
+ configatron.letters.a # =&gt; 'A'
230
+ configatron.letters.b # =&gt; 'bb'
231
+ configatron.letters.c # =&gt; 'c'
232
+ end
233
+ configatron.one == 1
234
+ configatron.letters.a # =&gt; 'A'
235
+ configatron.letters.b # =&gt; 'B'
236
+ configatron.letters.c # =&gt; nil
237
+ </pre>
196
238
  <p>
197
239
  Enjoy!
198
240
  </p>
@@ -5,7 +5,7 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>File: configuration.rb</title>
8
+ <title>File: configatron.rb</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
11
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
@@ -47,16 +47,16 @@
47
47
 
48
48
 
49
49
  <div id="fileHeader">
50
- <h1>configuration.rb</h1>
50
+ <h1>configatron.rb</h1>
51
51
  <table class="header-table">
52
52
  <tr class="top-aligned-row">
53
53
  <td><strong>Path:</strong></td>
54
- <td>lib/configatron/configuration.rb
54
+ <td>lib/configatron/configatron.rb
55
55
  </td>
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Sep 15 11:06:00 -0400 2008</td>
59
+ <td>Wed Sep 17 15:15:24 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -69,6 +69,13 @@
69
69
  <div id="contextContent">
70
70
 
71
71
 
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ singleton&nbsp;&nbsp;
77
+ </div>
78
+ </div>
72
79
 
73
80
  </div>
74
81
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>File: helpers.rb</title>
8
+ <title>File: errors.rb</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
11
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
@@ -47,16 +47,16 @@
47
47
 
48
48
 
49
49
  <div id="fileHeader">
50
- <h1>helpers.rb</h1>
50
+ <h1>errors.rb</h1>
51
51
  <table class="header-table">
52
52
  <tr class="top-aligned-row">
53
53
  <td><strong>Path:</strong></td>
54
- <td>lib/configatron/helpers.rb
54
+ <td>lib/configatron/errors.rb
55
55
  </td>
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Sep 05 16:22:37 -0400 2008</td>
59
+ <td>Wed Sep 17 15:16:26 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Sep 05 16:22:37 -0400 2008</td>
59
+ <td>Wed Sep 17 14:47:44 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Sep 15 10:59:23 -0400 2008</td>
59
+ <td>Wed Sep 17 15:16:26 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Sep 15 11:05:40 -0400 2008</td>
59
+ <td>Wed Sep 17 15:02:18 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -73,7 +73,6 @@
73
73
  <h3 class="section-bar">Required files</h3>
74
74
 
75
75
  <div class="name-list">
76
- singleton&nbsp;&nbsp;
77
76
  yaml&nbsp;&nbsp;
78
77
  </div>
79
78
  </div>
@@ -20,11 +20,9 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Classes</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Configatron/Configuration.html">Configatron::Configuration</a><br />
24
- <a href="classes/Configatron/Helpers.html">Configatron::Helpers</a><br />
23
+ <a href="classes/Configatron.html">Configatron</a><br />
24
+ <a href="classes/Configatron/ProtectedParameter.html">Configatron::ProtectedParameter</a><br />
25
25
  <a href="classes/Configatron/Store.html">Configatron::Store</a><br />
26
- <a href="classes/Configatron/YamlStore.html">Configatron::YamlStore</a><br />
27
- <a href="classes/Hash.html">Hash</a><br />
28
26
  <a href="classes/Kernel.html">Kernel</a><br />
29
27
  </div>
30
28
  </div>
@@ -22,11 +22,10 @@
22
22
  <div id="index-entries">
23
23
  <a href="files/README.html">README</a><br />
24
24
  <a href="files/lib/configatron_rb.html">lib/configatron.rb</a><br />
25
- <a href="files/lib/configatron/configuration_rb.html">lib/configatron/configuration.rb</a><br />
26
- <a href="files/lib/configatron/helpers_rb.html">lib/configatron/helpers.rb</a><br />
25
+ <a href="files/lib/configatron/configatron_rb.html">lib/configatron/configatron.rb</a><br />
26
+ <a href="files/lib/configatron/errors_rb.html">lib/configatron/errors.rb</a><br />
27
27
  <a href="files/lib/configatron/kernel_rb.html">lib/configatron/kernel.rb</a><br />
28
28
  <a href="files/lib/configatron/store_rb.html">lib/configatron/store.rb</a><br />
29
- <a href="files/lib/configatron/yaml_store_rb.html">lib/configatron/yaml_store.rb</a><br />
30
29
  </div>
31
30
  </div>
32
31
  </body>
@@ -20,27 +20,21 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Kernel.html#M000021">configatron (Kernel)</a><br />
24
- <a href="classes/Configatron/Configuration.html#M000013">configure (Configatron::Configuration)</a><br />
25
- <a href="classes/Configatron/Configuration.html#M000014">configure_from_hash (Configatron::Configuration)</a><br />
26
- <a href="classes/Configatron/Configuration.html#M000015">configure_from_yaml (Configatron::Configuration)</a><br />
27
- <a href="classes/Configatron/Helpers.html#M000003">exists? (Configatron::Helpers)</a><br />
28
- <a href="classes/Configatron/Store.html#M000007">exists? (Configatron::Store)</a><br />
29
- <a href="classes/Configatron/Store.html#M000006">method_missing (Configatron::Store)</a><br />
30
- <a href="classes/Configatron/Store.html#M000008">namespace (Configatron::Store)</a><br />
31
- <a href="classes/Configatron/Store.html#M000005">new (Configatron::Store)</a><br />
32
- <a href="classes/Configatron/YamlStore.html#M000011">new (Configatron::YamlStore)</a><br />
33
- <a href="classes/Hash.html#M000001">recursive_merge (Hash)</a><br />
34
- <a href="classes/Hash.html#M000002">recursive_merge! (Hash)</a><br />
35
- <a href="classes/Configatron/YamlStore.html#M000012">reload (Configatron::YamlStore)</a><br />
36
- <a href="classes/Configatron/Store.html#M000009">reload (Configatron::Store)</a><br />
37
- <a href="classes/Configatron/Configuration.html#M000016">reload (Configatron::Configuration)</a><br />
38
- <a href="classes/Configatron/Configuration.html#M000018">reset (Configatron::Configuration)</a><br />
39
- <a href="classes/Configatron/Configuration.html#M000017">reset! (Configatron::Configuration)</a><br />
40
- <a href="classes/Configatron/Helpers.html#M000004">retrieve (Configatron::Helpers)</a><br />
41
- <a href="classes/Configatron/Configuration.html#M000019">revert (Configatron::Configuration)</a><br />
42
- <a href="classes/Configatron/Configuration.html#M000020">to_hash (Configatron::Configuration)</a><br />
43
- <a href="classes/Configatron/Store.html#M000010">to_hash (Configatron::Store)</a><br />
23
+ <a href="classes/Kernel.html#M000015">configatron (Kernel)</a><br />
24
+ <a href="classes/Configatron/Store.html#M000006">configure_from_hash (Configatron::Store)</a><br />
25
+ <a href="classes/Configatron/Store.html#M000007">configure_from_yaml (Configatron::Store)</a><br />
26
+ <a href="classes/Configatron/Store.html#M000013">deep_clone (Configatron::Store)</a><br />
27
+ <a href="classes/Configatron/ProtectedParameter.html#M000014">intialize (Configatron::ProtectedParameter)</a><br />
28
+ <a href="classes/Configatron.html#M000001">method_missing (Configatron)</a><br />
29
+ <a href="classes/Configatron/Store.html#M000004">new (Configatron::Store)</a><br />
30
+ <a href="classes/Configatron/Store.html#M000008">nil? (Configatron::Store)</a><br />
31
+ <a href="classes/Configatron/Store.html#M000012">protect (Configatron::Store)</a><br />
32
+ <a href="classes/Configatron/Store.html#M000010">remove (Configatron::Store)</a><br />
33
+ <a href="classes/Configatron.html#M000002">reset! (Configatron)</a><br />
34
+ <a href="classes/Configatron/Store.html#M000009">retrieve (Configatron::Store)</a><br />
35
+ <a href="classes/Configatron/Store.html#M000011">set_default (Configatron::Store)</a><br />
36
+ <a href="classes/Configatron.html#M000003">temp (Configatron)</a><br />
37
+ <a href="classes/Configatron/Store.html#M000005">to_hash (Configatron::Store)</a><br />
44
38
  </div>
45
39
  </div>
46
40
  </body>
@@ -1,45 +1,6 @@
1
- require 'singleton'
1
+ base = File.join(File.dirname(__FILE__), 'configatron')
2
2
  require 'yaml'
3
-
4
- require File.join(File.dirname(__FILE__), 'configatron', 'helpers')
5
- require File.join(File.dirname(__FILE__), 'configatron', 'kernel')
6
- require File.join(File.dirname(__FILE__), 'configatron', 'configuration')
7
- require File.join(File.dirname(__FILE__), 'configatron', 'store')
8
- require File.join(File.dirname(__FILE__), 'configatron', 'yaml_store')
9
-
10
- module Configatron # :nodoc:
11
- end
12
-
13
- class Hash
14
-
15
- # Same as Hash#merge but recursively merges sub-hashes.
16
-
17
- def recursive_merge(other)
18
- hash = self.dup
19
- other.each do |key, value|
20
- myval = self[key]
21
- if value.is_a?(Hash) && myval.is_a?(Hash)
22
- hash[key] = myval.recursive_merge(value)
23
- else
24
- hash[key] = value
25
- end
26
- end
27
- hash
28
- end
29
-
30
- # Same as Hash#merge! but recursively merges sub-hashes.
31
-
32
- def recursive_merge!(other)
33
- other.each do |key, value|
34
- myval = self[key]
35
- if value.is_a?(Hash) && myval.is_a?(Hash)
36
- myval.recursive_merge!(value)
37
- else
38
- self[key] = value
39
- end
40
- end
41
- self
42
- end
43
-
44
- end
45
-
3
+ require File.join(base, 'kernel')
4
+ require File.join(base, 'configatron')
5
+ require File.join(base, 'store')
6
+ require File.join(base, 'errors')