ballast 1.9.3 → 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.
- checksums.yaml +4 -4
- data/.rubocop.yml +35 -0
- data/.travis-gemfile +4 -5
- data/.travis.yml +3 -2
- data/CHANGELOG.md +62 -6
- data/Gemfile +7 -8
- data/README.md +2 -2
- data/ballast.gemspec +9 -12
- data/doc/Ballast/AjaxResponse.html +1380 -0
- data/doc/Ballast/Concerns/AjaxHandling.html +662 -0
- data/doc/Ballast/Concerns/Common.html +81 -361
- data/doc/Ballast/Concerns/ErrorsHandling.html +18 -36
- data/doc/Ballast/Concerns/View.html +181 -157
- data/doc/Ballast/Concerns.html +6 -6
- data/doc/Ballast/Configuration.html +204 -31
- data/doc/Ballast/Emoji/Character.html +411 -0
- data/doc/Ballast/Emoji/Utils.html +794 -0
- data/doc/Ballast/Emoji.html +125 -0
- data/doc/Ballast/Errors/{BaseError.html → Base.html} +61 -34
- data/doc/Ballast/Errors/{PerformError.html → Failure.html} +21 -17
- data/doc/Ballast/Errors/InvalidDomain.html +11 -11
- data/doc/Ballast/Errors/{ValidationError.html → ValidationFailure.html} +24 -16
- data/doc/Ballast/Errors.html +5 -5
- data/doc/Ballast/Middlewares/DefaultHost.html +6 -6
- data/doc/Ballast/Middlewares.html +4 -4
- data/doc/Ballast/RequestDomainMatcher.html +28 -28
- data/doc/Ballast/Service/Response.html +1243 -0
- data/doc/Ballast/Service.html +1314 -0
- data/doc/Ballast/Version.html +7 -7
- data/doc/Ballast.html +15 -15
- data/doc/_index.html +59 -30
- data/doc/class_list.html +6 -2
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +6 -6
- data/doc/file_list.html +5 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +6 -6
- data/doc/js/full_list.js +4 -1
- data/doc/method_list.html +167 -79
- data/doc/top-level-namespace.html +41 -4
- data/lib/ballast/ajax_response.rb +76 -0
- data/lib/ballast/concerns/ajax_handling.rb +73 -0
- data/lib/ballast/concerns/common.rb +25 -47
- data/lib/ballast/concerns/errors_handling.rb +21 -30
- data/lib/ballast/concerns/view.rb +24 -22
- data/lib/ballast/configuration.rb +30 -10
- data/lib/ballast/emoji.rb +114 -0
- data/lib/ballast/errors.rb +16 -13
- data/lib/ballast/middlewares/default_host.rb +3 -3
- data/lib/ballast/request_domain_matcher.rb +7 -7
- data/lib/ballast/service.rb +147 -0
- data/lib/ballast/version.rb +3 -3
- data/lib/ballast.rb +22 -22
- data/spec/ballast/ajax_response_spec.rb +61 -0
- data/spec/ballast/concerns/ajax_handling_spec.rb +86 -0
- data/spec/ballast/concerns/common_spec.rb +17 -52
- data/spec/ballast/concerns/errors_handling_spec.rb +35 -29
- data/spec/ballast/concerns/view_spec.rb +21 -32
- data/spec/ballast/configuration_spec.rb +66 -16
- data/spec/ballast/emoji_spec.rb +103 -0
- data/spec/ballast/errors_spec.rb +5 -5
- data/spec/ballast/middlewares/default_host_spec.rb +3 -5
- data/spec/ballast/request_domain_matcher_spec.rb +4 -4
- data/spec/ballast/service_spec.rb +137 -0
- data/spec/spec_helper.rb +1 -13
- metadata +42 -80
- data/doc/Ballast/Concerns/Ajax.html +0 -945
- data/doc/Ballast/Context.html +0 -417
- data/doc/Ballast/Operation.html +0 -1304
- data/doc/Ballast/OperationsChain.html +0 -597
- data/lib/ballast/concerns/ajax.rb +0 -134
- data/lib/ballast/context.rb +0 -38
- data/lib/ballast/operation.rb +0 -136
- data/lib/ballast/operations_chain.rb +0 -45
- data/spec/ballast/concerns/ajax_spec.rb +0 -141
- data/spec/ballast/context_spec.rb +0 -23
- data/spec/ballast/operation_spec.rb +0 -177
- data/spec/ballast/operations_chain_spec.rb +0 -61
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ballast::Configuration
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../';
|
20
|
-
framesUrl = "../frames.html#!"
|
20
|
+
framesUrl = "../frames.html#!Ballast/Configuration.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -120,6 +120,61 @@
|
|
120
120
|
|
121
121
|
|
122
122
|
|
123
|
+
<h2>
|
124
|
+
Class Method Summary
|
125
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
126
|
+
</h2>
|
127
|
+
|
128
|
+
<ul class="summary">
|
129
|
+
|
130
|
+
<li class="public ">
|
131
|
+
<span class="summary_signature">
|
132
|
+
|
133
|
+
<a href="#default_environment-class_method" title="default_environment (class method)">+ (String) <strong>default_environment</strong> </a>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<span class="summary_desc"><div class='inline'><p>Returns the default environment.</p>
|
148
|
+
</div></span>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
|
152
|
+
|
153
|
+
<li class="public ">
|
154
|
+
<span class="summary_signature">
|
155
|
+
|
156
|
+
<a href="#default_root-class_method" title="default_root (class method)">+ (String) <strong>default_root</strong> </a>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</span>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<span class="summary_desc"><div class='inline'><p>Returns the default root directory to lookup a configuration.</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
</ul>
|
177
|
+
|
123
178
|
<h2>
|
124
179
|
Instance Method Summary
|
125
180
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
@@ -130,7 +185,7 @@
|
|
130
185
|
<li class="public ">
|
131
186
|
<span class="summary_signature">
|
132
187
|
|
133
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Configuration) <strong>initialize</strong>(sections
|
188
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Configuration) <strong>initialize</strong>(*sections, root: nil, environment: nil) </a>
|
134
189
|
|
135
190
|
|
136
191
|
|
@@ -162,7 +217,7 @@
|
|
162
217
|
<div class="method_details first">
|
163
218
|
<h3 class="signature first" id="initialize-instance_method">
|
164
219
|
|
165
|
-
- (<tt><span class='object_link'><a href="" title="Ballast::Configuration (class)">Configuration</a></span></tt>) <strong>initialize</strong>(sections
|
220
|
+
- (<tt><span class='object_link'><a href="" title="Ballast::Configuration (class)">Configuration</a></span></tt>) <strong>initialize</strong>(*sections, root: nil, environment: nil)
|
166
221
|
|
167
222
|
|
168
223
|
|
@@ -200,12 +255,12 @@ Subfolders are not supported.</p>
|
|
200
255
|
<span class='name'>root</span>
|
201
256
|
|
202
257
|
|
203
|
-
<span class='type'>(<tt>String</tt>)</span>
|
258
|
+
<span class='type'>(<tt>String|NilClass</tt>)</span>
|
204
259
|
|
205
260
|
|
206
261
|
|
207
262
|
—
|
208
|
-
<div class='inline'><p>The root folder where look for file
|
263
|
+
<div class='inline'><p>The root folder where look for file.</p>
|
209
264
|
</div>
|
210
265
|
|
211
266
|
</li>
|
@@ -215,12 +270,12 @@ Subfolders are not supported.</p>
|
|
215
270
|
<span class='name'>environment</span>
|
216
271
|
|
217
272
|
|
218
|
-
<span class='type'>(<tt>String</tt>)</span>
|
273
|
+
<span class='type'>(<tt>String|NilClass</tt>)</span>
|
219
274
|
|
220
275
|
|
221
276
|
|
222
277
|
—
|
223
|
-
<div class='inline'><p>The environment to load
|
278
|
+
<div class='inline'><p>The environment to load.</p>
|
224
279
|
</div>
|
225
280
|
|
226
281
|
</li>
|
@@ -234,50 +289,168 @@ Subfolders are not supported.</p>
|
|
234
289
|
<pre class="lines">
|
235
290
|
|
236
291
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
28</pre>
|
292
|
+
30
|
293
|
+
31
|
294
|
+
32
|
295
|
+
33
|
296
|
+
34
|
297
|
+
35
|
298
|
+
36
|
299
|
+
37
|
300
|
+
38
|
301
|
+
39
|
302
|
+
40
|
303
|
+
41</pre>
|
250
304
|
</td>
|
251
305
|
<td>
|
252
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/configuration.rb', line
|
306
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/configuration.rb', line 30</span>
|
253
307
|
|
254
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='
|
308
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_sections'>sections</span><span class='comma'>,</span> <span class='label'>root:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>environment:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
255
309
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
256
|
-
<span class='id identifier rubyid_root'>root</span> <span class='op'>||=</span> <span class='const'>
|
257
|
-
<span class='id identifier rubyid_environment'>environment</span> <span class='op'>||=</span> <span class='const'>
|
310
|
+
<span class='id identifier rubyid_root'>root</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Ballast</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_default_root'>default_root</span>
|
311
|
+
<span class='id identifier rubyid_environment'>environment</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>Ballast</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_default_environment'>default_environment</span>
|
258
312
|
|
259
313
|
<span class='id identifier rubyid_sections'>sections</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_section'>section</span><span class='op'>|</span>
|
260
|
-
<span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='
|
261
|
-
<span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_section'>section</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='
|
262
|
-
<span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_section'>section</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_section'>section</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_section'>section</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
314
|
+
<span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_load_section'>load_section</span><span class='lparen'>(</span><span class='id identifier rubyid_root'>root</span><span class='comma'>,</span> <span class='id identifier rubyid_section'>section</span><span class='rparen'>)</span>
|
315
|
+
<span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_section'>section</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_environment'>environment</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
263
316
|
<span class='kw'>end</span>
|
264
317
|
|
265
|
-
<span class='
|
318
|
+
<span class='id identifier rubyid_enable_dotted_access'>enable_dotted_access</span>
|
319
|
+
<span class='kw'>end</span></pre>
|
320
|
+
</td>
|
321
|
+
</tr>
|
322
|
+
</table>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
|
328
|
+
<div id="class_method_details" class="method_details_list">
|
329
|
+
<h2>Class Method Details</h2>
|
330
|
+
|
331
|
+
|
332
|
+
<div class="method_details first">
|
333
|
+
<h3 class="signature first" id="default_environment-class_method">
|
334
|
+
|
335
|
+
+ (<tt>String</tt>) <strong>default_environment</strong>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</h3><div class="docstring">
|
342
|
+
<div class="discussion">
|
343
|
+
<p>Returns the default environment. It will be the first non-nil of the following: Rails environment, the Rack environment or “production”.</p>
|
344
|
+
|
345
|
+
|
346
|
+
</div>
|
347
|
+
</div>
|
348
|
+
<div class="tags">
|
349
|
+
|
350
|
+
<p class="tag_title">Returns:</p>
|
351
|
+
<ul class="return">
|
352
|
+
|
353
|
+
<li>
|
354
|
+
|
355
|
+
|
356
|
+
<span class='type'>(<tt>String</tt>)</span>
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
—
|
361
|
+
<div class='inline'><p>The default environment.</p>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
</ul>
|
367
|
+
|
368
|
+
</div><table class="source_code">
|
369
|
+
<tr>
|
370
|
+
<td>
|
371
|
+
<pre class="lines">
|
372
|
+
|
373
|
+
|
374
|
+
20
|
375
|
+
21
|
376
|
+
22</pre>
|
377
|
+
</td>
|
378
|
+
<td>
|
379
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/configuration.rb', line 20</span>
|
380
|
+
|
381
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_environment'>default_environment</span>
|
382
|
+
<span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span> <span class='op'>:</span> <span class='const'>ENV</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>RACK_ENV</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>production</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
266
383
|
<span class='kw'>end</span></pre>
|
267
384
|
</td>
|
268
385
|
</tr>
|
269
386
|
</table>
|
270
387
|
</div>
|
388
|
+
|
389
|
+
<div class="method_details ">
|
390
|
+
<h3 class="signature " id="default_root-class_method">
|
391
|
+
|
392
|
+
+ (<tt>String</tt>) <strong>default_root</strong>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
</h3><div class="docstring">
|
399
|
+
<div class="discussion">
|
400
|
+
<p>Returns the default root directory to lookup a configuration. It will be the Rails root if set or the current folder.</p>
|
401
|
+
|
402
|
+
|
403
|
+
</div>
|
404
|
+
</div>
|
405
|
+
<div class="tags">
|
271
406
|
|
407
|
+
<p class="tag_title">Returns:</p>
|
408
|
+
<ul class="return">
|
409
|
+
|
410
|
+
<li>
|
411
|
+
|
412
|
+
|
413
|
+
<span class='type'>(<tt>String</tt>)</span>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
—
|
418
|
+
<div class='inline'><p>The default root directory to lookup a configuration.</p>
|
272
419
|
</div>
|
420
|
+
|
421
|
+
</li>
|
422
|
+
|
423
|
+
</ul>
|
424
|
+
|
425
|
+
</div><table class="source_code">
|
426
|
+
<tr>
|
427
|
+
<td>
|
428
|
+
<pre class="lines">
|
429
|
+
|
430
|
+
|
431
|
+
13
|
432
|
+
14
|
433
|
+
15</pre>
|
434
|
+
</td>
|
435
|
+
<td>
|
436
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/configuration.rb', line 13</span>
|
273
437
|
|
438
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_root'>default_root</span>
|
439
|
+
<span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>:</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span>
|
440
|
+
<span class='kw'>end</span></pre>
|
441
|
+
</td>
|
442
|
+
</tr>
|
443
|
+
</table>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
</div>
|
274
447
|
|
275
448
|
</div>
|
276
449
|
|
277
450
|
<div id="footer">
|
278
|
-
Generated on
|
451
|
+
Generated on Sun Nov 2 09:40:01 2014 by
|
279
452
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
280
|
-
0.8.7.
|
453
|
+
0.8.7.6 (ruby-2.1.3).
|
281
454
|
</div>
|
282
455
|
|
283
456
|
</body>
|