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.
- data/README +61 -34
- data/doc/classes/Configatron.html +241 -0
- data/doc/classes/Configatron/ProtectedParameter.html +146 -0
- data/doc/classes/Configatron/Store.html +241 -121
- data/doc/classes/Kernel.html +13 -20
- data/doc/created.rid +1 -1
- data/doc/files/README.html +85 -43
- data/doc/files/lib/configatron/{configuration_rb.html → configatron_rb.html} +11 -4
- data/doc/files/lib/configatron/{helpers_rb.html → errors_rb.html} +4 -4
- data/doc/files/lib/configatron/kernel_rb.html +1 -1
- data/doc/files/lib/configatron/store_rb.html +1 -1
- data/doc/files/lib/configatron_rb.html +1 -2
- data/doc/fr_class_index.html +2 -4
- data/doc/fr_file_index.html +2 -3
- data/doc/fr_method_index.html +15 -21
- data/lib/configatron.rb +5 -44
- data/lib/configatron/configatron.rb +44 -0
- data/lib/configatron/errors.rb +7 -0
- data/lib/configatron/kernel.rb +3 -9
- data/lib/configatron/store.rb +148 -56
- data/spec/lib/configatron_spec.rb +293 -0
- data/spec/lib/futurama.yml +6 -0
- data/spec/spec_helper.rb +3 -2
- metadata +11 -18
- data/doc/classes/Configatron/Configuration.html +0 -402
- data/doc/classes/Configatron/Helpers.html +0 -174
- data/doc/classes/Configatron/YamlStore.html +0 -203
- data/doc/classes/Hash.html +0 -193
- data/doc/files/lib/configatron/yaml_store_rb.html +0 -101
- data/lib/configatron/configuration.rb +0 -112
- data/lib/configatron/helpers.rb +0 -27
- data/lib/configatron/yaml_store.rb +0 -33
- data/spec/unit/configuration_spec.rb +0 -299
- data/spec/unit/family_guy.yml +0 -2
- data/spec/unit/helpers_spec.rb +0 -115
- data/spec/unit/kernel_spec.rb +0 -48
- data/spec/unit/store_spec.rb +0 -91
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-17 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,25 +22,21 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README
|
24
24
|
files:
|
25
|
-
- lib/configatron/
|
26
|
-
- lib/configatron/
|
25
|
+
- lib/configatron/configatron.rb
|
26
|
+
- lib/configatron/errors.rb
|
27
27
|
- lib/configatron/kernel.rb
|
28
28
|
- lib/configatron/store.rb
|
29
|
-
- lib/configatron/yaml_store.rb
|
30
29
|
- lib/configatron.rb
|
31
30
|
- README
|
32
|
-
- doc/classes/Configatron/
|
33
|
-
- doc/classes/Configatron/Helpers.html
|
31
|
+
- doc/classes/Configatron/ProtectedParameter.html
|
34
32
|
- doc/classes/Configatron/Store.html
|
35
|
-
- doc/classes/Configatron
|
36
|
-
- doc/classes/Hash.html
|
33
|
+
- doc/classes/Configatron.html
|
37
34
|
- doc/classes/Kernel.html
|
38
35
|
- doc/created.rid
|
39
|
-
- doc/files/lib/configatron/
|
40
|
-
- doc/files/lib/configatron/
|
36
|
+
- doc/files/lib/configatron/configatron_rb.html
|
37
|
+
- doc/files/lib/configatron/errors_rb.html
|
41
38
|
- doc/files/lib/configatron/kernel_rb.html
|
42
39
|
- doc/files/lib/configatron/store_rb.html
|
43
|
-
- doc/files/lib/configatron/yaml_store_rb.html
|
44
40
|
- doc/files/lib/configatron_rb.html
|
45
41
|
- doc/files/README.html
|
46
42
|
- doc/fr_class_index.html
|
@@ -76,11 +72,8 @@ signing_key:
|
|
76
72
|
specification_version: 2
|
77
73
|
summary: A powerful Ruby configuration system.
|
78
74
|
test_files:
|
75
|
+
- spec/lib
|
76
|
+
- spec/lib/configatron_spec.rb
|
77
|
+
- spec/lib/futurama.yml
|
79
78
|
- spec/spec.opts
|
80
79
|
- spec/spec_helper.rb
|
81
|
-
- spec/unit
|
82
|
-
- spec/unit/configuration_spec.rb
|
83
|
-
- spec/unit/family_guy.yml
|
84
|
-
- spec/unit/helpers_spec.rb
|
85
|
-
- spec/unit/kernel_spec.rb
|
86
|
-
- spec/unit/store_spec.rb
|
@@ -1,402 +0,0 @@
|
|
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: Configatron::Configuration</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">Configatron::Configuration</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/configatron/configuration_rb.html">
|
59
|
-
lib/configatron/configuration.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
|
-
Object
|
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
|
-
The central class for managing the configurations.
|
84
|
-
</p>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<div id="method-list">
|
92
|
-
<h3 class="section-bar">Methods</h3>
|
93
|
-
|
94
|
-
<div class="name-list">
|
95
|
-
<a href="#M000013">configure</a>
|
96
|
-
<a href="#M000014">configure_from_hash</a>
|
97
|
-
<a href="#M000015">configure_from_yaml</a>
|
98
|
-
<a href="#M000016">reload</a>
|
99
|
-
<a href="#M000018">reset</a>
|
100
|
-
<a href="#M000017">reset!</a>
|
101
|
-
<a href="#M000019">revert</a>
|
102
|
-
<a href="#M000020">to_hash</a>
|
103
|
-
</div>
|
104
|
-
</div>
|
105
|
-
|
106
|
-
</div>
|
107
|
-
|
108
|
-
|
109
|
-
<!-- if includes -->
|
110
|
-
<div id="includes">
|
111
|
-
<h3 class="section-bar">Included Modules</h3>
|
112
|
-
|
113
|
-
<div id="includes-list">
|
114
|
-
<span class="include-name">Singleton</span>
|
115
|
-
<span class="include-name"><a href="Helpers.html">Configatron::Helpers</a></span>
|
116
|
-
</div>
|
117
|
-
</div>
|
118
|
-
|
119
|
-
<div id="section">
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<div id="attribute-list">
|
126
|
-
<h3 class="section-bar">Attributes</h3>
|
127
|
-
|
128
|
-
<div class="name-list">
|
129
|
-
<table>
|
130
|
-
<tr class="top-aligned-row context-row">
|
131
|
-
<td class="context-item-name">nil_for_missing</td>
|
132
|
-
<td class="context-item-value"> [RW] </td>
|
133
|
-
<td class="context-item-desc">
|
134
|
-
If nil_for_missing is set to true nil will be returned if the configuration
|
135
|
-
parameter doesn‘t exist. If set to false, default, then a
|
136
|
-
NoMethodError exception will be raised.
|
137
|
-
|
138
|
-
</td>
|
139
|
-
</tr>
|
140
|
-
</table>
|
141
|
-
</div>
|
142
|
-
</div>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<!-- if method_list -->
|
147
|
-
<div id="methods">
|
148
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
149
|
-
|
150
|
-
<div id="method-M000013" class="method-detail">
|
151
|
-
<a name="M000013"></a>
|
152
|
-
|
153
|
-
<div class="method-heading">
|
154
|
-
<a href="#M000013" class="method-signature">
|
155
|
-
<span class="method-name">configure</span><span class="method-args">() {|storage| ...}</span>
|
156
|
-
</a>
|
157
|
-
</div>
|
158
|
-
|
159
|
-
<div class="method-description">
|
160
|
-
<p>
|
161
|
-
Yields a new <a href="Store.html">Configatron::Store</a> class.
|
162
|
-
</p>
|
163
|
-
<p><a class="source-toggle" href="#"
|
164
|
-
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
165
|
-
<div class="method-source-code" id="M000013-source">
|
166
|
-
<pre>
|
167
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 18</span>
|
168
|
-
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>
|
169
|
-
19: <span class="ruby-identifier">storage</span> = <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">new</span>
|
170
|
-
20: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">storage</span>
|
171
|
-
21: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">empty?</span>
|
172
|
-
22: <span class="ruby-ivar">@_storage_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">storage</span>
|
173
|
-
23: <span class="ruby-identifier">load_methods</span>(<span class="ruby-identifier">storage</span>)
|
174
|
-
24: <span class="ruby-keyword kw">end</span>
|
175
|
-
25: <span class="ruby-keyword kw">end</span>
|
176
|
-
</pre>
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
<div id="method-M000014" class="method-detail">
|
182
|
-
<a name="M000014"></a>
|
183
|
-
|
184
|
-
<div class="method-heading">
|
185
|
-
<a href="#M000014" class="method-signature">
|
186
|
-
<span class="method-name">configure_from_hash</span><span class="method-args">(parameters)</span>
|
187
|
-
</a>
|
188
|
-
</div>
|
189
|
-
|
190
|
-
<div class="method-description">
|
191
|
-
<p>
|
192
|
-
Used to load configuration settings from a <a href="../Hash.html">Hash</a>.
|
193
|
-
</p>
|
194
|
-
<p><a class="source-toggle" href="#"
|
195
|
-
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
196
|
-
<div class="method-source-code" id="M000014-source">
|
197
|
-
<pre>
|
198
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 28</span>
|
199
|
-
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_from_hash</span>(<span class="ruby-identifier">parameters</span>)
|
200
|
-
29: <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">recursive_merge</span>(<span class="ruby-identifier">parameters</span>)
|
201
|
-
30: <span class="ruby-identifier">storage</span> = <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">parameters</span>)
|
202
|
-
31: <span class="ruby-ivar">@_storage_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">storage</span>
|
203
|
-
32: <span class="ruby-identifier">load_methods</span>(<span class="ruby-identifier">storage</span>)
|
204
|
-
33: <span class="ruby-keyword kw">end</span>
|
205
|
-
</pre>
|
206
|
-
</div>
|
207
|
-
</div>
|
208
|
-
</div>
|
209
|
-
|
210
|
-
<div id="method-M000015" class="method-detail">
|
211
|
-
<a name="M000015"></a>
|
212
|
-
|
213
|
-
<div class="method-heading">
|
214
|
-
<a href="#M000015" class="method-signature">
|
215
|
-
<span class="method-name">configure_from_yaml</span><span class="method-args">(path)</span>
|
216
|
-
</a>
|
217
|
-
</div>
|
218
|
-
|
219
|
-
<div class="method-description">
|
220
|
-
<p>
|
221
|
-
Used to load configuration settings from a YAML file.
|
222
|
-
</p>
|
223
|
-
<p><a class="source-toggle" href="#"
|
224
|
-
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
225
|
-
<div class="method-source-code" id="M000015-source">
|
226
|
-
<pre>
|
227
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 36</span>
|
228
|
-
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_from_yaml</span>(<span class="ruby-identifier">path</span>)
|
229
|
-
37: <span class="ruby-keyword kw">begin</span>
|
230
|
-
38: <span class="ruby-identifier">storage</span> = <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">YamlStore</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>)
|
231
|
-
39: <span class="ruby-ivar">@_storage_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">storage</span>
|
232
|
-
40: <span class="ruby-identifier">load_methods</span>(<span class="ruby-identifier">storage</span>)
|
233
|
-
41: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
234
|
-
42: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
|
235
|
-
43: <span class="ruby-comment cmt"># file doesn't exist.</span>
|
236
|
-
44: <span class="ruby-keyword kw">end</span>
|
237
|
-
45: <span class="ruby-keyword kw">end</span>
|
238
|
-
</pre>
|
239
|
-
</div>
|
240
|
-
</div>
|
241
|
-
</div>
|
242
|
-
|
243
|
-
<div id="method-M000016" class="method-detail">
|
244
|
-
<a name="M000016"></a>
|
245
|
-
|
246
|
-
<div class="method-heading">
|
247
|
-
<a href="#M000016" class="method-signature">
|
248
|
-
<span class="method-name">reload</span><span class="method-args">()</span>
|
249
|
-
</a>
|
250
|
-
</div>
|
251
|
-
|
252
|
-
<div class="method-description">
|
253
|
-
<p>
|
254
|
-
Replays the history of configurations.
|
255
|
-
</p>
|
256
|
-
<p><a class="source-toggle" href="#"
|
257
|
-
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
258
|
-
<div class="method-source-code" id="M000016-source">
|
259
|
-
<pre>
|
260
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 48</span>
|
261
|
-
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>
|
262
|
-
49: <span class="ruby-ivar">@_storage_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">storage</span><span class="ruby-operator">|</span>
|
263
|
-
50: <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">reload</span>
|
264
|
-
51: <span class="ruby-identifier">load_methods</span>(<span class="ruby-identifier">storage</span>)
|
265
|
-
52: <span class="ruby-keyword kw">end</span>
|
266
|
-
53: <span class="ruby-keyword kw">end</span>
|
267
|
-
</pre>
|
268
|
-
</div>
|
269
|
-
</div>
|
270
|
-
</div>
|
271
|
-
|
272
|
-
<div id="method-M000018" class="method-detail">
|
273
|
-
<a name="M000018"></a>
|
274
|
-
|
275
|
-
<div class="method-heading">
|
276
|
-
<a href="#M000018" class="method-signature">
|
277
|
-
<span class="method-name">reset</span><span class="method-args">()</span>
|
278
|
-
</a>
|
279
|
-
</div>
|
280
|
-
|
281
|
-
<div class="method-description">
|
282
|
-
<p>
|
283
|
-
All methods are undefined.
|
284
|
-
</p>
|
285
|
-
<p><a class="source-toggle" href="#"
|
286
|
-
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
287
|
-
<div class="method-source-code" id="M000018-source">
|
288
|
-
<pre>
|
289
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 65</span>
|
290
|
-
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
291
|
-
66: <span class="ruby-ivar">@_storage_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">storage</span><span class="ruby-operator">|</span>
|
292
|
-
67: <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
293
|
-
68: <span class="ruby-constant">Configatron</span><span class="ruby-operator">::</span><span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword kw">do</span>
|
294
|
-
69: <span class="ruby-keyword kw">begin</span>
|
295
|
-
70: <span class="ruby-identifier">undef_method</span>(<span class="ruby-identifier">k</span>)
|
296
|
-
71: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
297
|
-
72: <span class="ruby-keyword kw">end</span>
|
298
|
-
73: <span class="ruby-keyword kw">end</span>
|
299
|
-
74: <span class="ruby-keyword kw">end</span>
|
300
|
-
75: <span class="ruby-keyword kw">end</span>
|
301
|
-
76: <span class="ruby-keyword kw">end</span>
|
302
|
-
</pre>
|
303
|
-
</div>
|
304
|
-
</div>
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div id="method-M000017" class="method-detail">
|
308
|
-
<a name="M000017"></a>
|
309
|
-
|
310
|
-
<div class="method-heading">
|
311
|
-
<a href="#M000017" class="method-signature">
|
312
|
-
<span class="method-name">reset!</span><span class="method-args">()</span>
|
313
|
-
</a>
|
314
|
-
</div>
|
315
|
-
|
316
|
-
<div class="method-description">
|
317
|
-
<p>
|
318
|
-
Does a hard <a href="Configuration.html#M000018">reset</a> of the <a
|
319
|
-
href="Configuration.html">Configatron::Configuration</a> class. All methods
|
320
|
-
are undefined, the list of configuration parameters is emptied, and the
|
321
|
-
nil_for_missing method gets <a href="Configuration.html#M000018">reset</a>
|
322
|
-
to false.
|
323
|
-
</p>
|
324
|
-
<p><a class="source-toggle" href="#"
|
325
|
-
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
326
|
-
<div class="method-source-code" id="M000017-source">
|
327
|
-
<pre>
|
328
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 58</span>
|
329
|
-
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
|
330
|
-
59: <span class="ruby-identifier">reset</span>
|
331
|
-
60: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">nil_for_missing</span> = <span class="ruby-keyword kw">false</span>
|
332
|
-
61: <span class="ruby-ivar">@_storage_list</span> = []
|
333
|
-
62: <span class="ruby-keyword kw">end</span>
|
334
|
-
</pre>
|
335
|
-
</div>
|
336
|
-
</div>
|
337
|
-
</div>
|
338
|
-
|
339
|
-
<div id="method-M000019" class="method-detail">
|
340
|
-
<a name="M000019"></a>
|
341
|
-
|
342
|
-
<div class="method-heading">
|
343
|
-
<a href="#M000019" class="method-signature">
|
344
|
-
<span class="method-name">revert</span><span class="method-args">(step = 1)</span>
|
345
|
-
</a>
|
346
|
-
</div>
|
347
|
-
|
348
|
-
<div class="method-description">
|
349
|
-
<p>
|
350
|
-
Peels back n number of configuration parameters.
|
351
|
-
</p>
|
352
|
-
<p><a class="source-toggle" href="#"
|
353
|
-
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
354
|
-
<div class="method-source-code" id="M000019-source">
|
355
|
-
<pre>
|
356
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 79</span>
|
357
|
-
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">revert</span>(<span class="ruby-identifier">step</span> = <span class="ruby-value">1</span>)
|
358
|
-
80: <span class="ruby-identifier">reset</span>
|
359
|
-
81: <span class="ruby-identifier">step</span>.<span class="ruby-identifier">times</span> {<span class="ruby-ivar">@_storage_list</span>.<span class="ruby-identifier">pop</span>}
|
360
|
-
82: <span class="ruby-identifier">reload</span>
|
361
|
-
83: <span class="ruby-keyword kw">end</span>
|
362
|
-
</pre>
|
363
|
-
</div>
|
364
|
-
</div>
|
365
|
-
</div>
|
366
|
-
|
367
|
-
<div id="method-M000020" class="method-detail">
|
368
|
-
<a name="M000020"></a>
|
369
|
-
|
370
|
-
<div class="method-heading">
|
371
|
-
<a href="#M000020" class="method-signature">
|
372
|
-
<span class="method-name">to_hash</span><span class="method-args">()</span>
|
373
|
-
</a>
|
374
|
-
</div>
|
375
|
-
|
376
|
-
<div class="method-description">
|
377
|
-
<p><a class="source-toggle" href="#"
|
378
|
-
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
379
|
-
<div class="method-source-code" id="M000020-source">
|
380
|
-
<pre>
|
381
|
-
<span class="ruby-comment cmt"># File lib/configatron/configuration.rb, line 89</span>
|
382
|
-
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
|
383
|
-
90: <span class="ruby-ivar">@_storage_list</span>.<span class="ruby-identifier">inject</span>({}) { <span class="ruby-operator">|</span><span class="ruby-identifier">acc</span>, <span class="ruby-identifier">storage</span><span class="ruby-operator">|</span> <span class="ruby-identifier">acc</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">storage</span>.<span class="ruby-identifier">to_hash</span>) }
|
384
|
-
91: <span class="ruby-keyword kw">end</span>
|
385
|
-
</pre>
|
386
|
-
</div>
|
387
|
-
</div>
|
388
|
-
</div>
|
389
|
-
|
390
|
-
|
391
|
-
</div>
|
392
|
-
|
393
|
-
|
394
|
-
</div>
|
395
|
-
|
396
|
-
|
397
|
-
<div id="validator-badges">
|
398
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
399
|
-
</div>
|
400
|
-
|
401
|
-
</body>
|
402
|
-
</html>
|