ballast 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/doc/Ballast.html +1 -1
- data/doc/Ballast/Concerns.html +1 -1
- data/doc/Ballast/Concerns/Ajax.html +1 -1
- data/doc/Ballast/Concerns/Common.html +1 -1
- data/doc/Ballast/Concerns/ErrorsHandling.html +1 -1
- data/doc/Ballast/Concerns/View.html +15 -32
- data/doc/Ballast/Context.html +1 -1
- data/doc/Ballast/Errors.html +1 -1
- data/doc/Ballast/Errors/BaseError.html +1 -1
- data/doc/Ballast/Errors/InvalidDomain.html +1 -1
- data/doc/Ballast/Errors/PerformError.html +1 -1
- data/doc/Ballast/Errors/ValidationError.html +1 -1
- data/doc/Ballast/Middlewares.html +1 -1
- data/doc/Ballast/Middlewares/DefaultHost.html +1 -1
- data/doc/Ballast/Operation.html +1 -1
- data/doc/Ballast/OperationsChain.html +1 -1
- data/doc/Ballast/RequestDomainMatcher.html +1 -1
- data/doc/Ballast/Version.html +3 -3
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/ballast/concerns/view.rb +3 -4
- data/lib/ballast/version.rb +2 -2
- data/spec/ballast/concerns/view_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3388a7a801511693256a1137f34b3825e377e485
|
4
|
+
data.tar.gz: cbe11293e58b2fbdc4d04297e3d188ce1001165c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95df246c2fa28afefc163e7a1732b3cf7f2f96e448d00e0af0e48fa71b0a026b0399f889231fe6cff8ffc1c7f523495c5b4fd490ac07b910a3f0bbde3680641
|
7
|
+
data.tar.gz: f40b1b1dab152befbcb2c305f98971d0ed28489b443ff1ca768c2b6752ce9df5f9bb4ccd34e450c0009da20c094b9fad85618245fb4dd4c60abb613b2b2d7698
|
data/CHANGELOG.md
CHANGED
data/doc/Ballast.html
CHANGED
@@ -121,7 +121,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on Wed Dec 25
|
124
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.8.7.3 (ruby-2.0.0).
|
127
127
|
</div>
|
data/doc/Ballast/Concerns.html
CHANGED
@@ -118,7 +118,7 @@
|
|
118
118
|
</div>
|
119
119
|
|
120
120
|
<div id="footer">
|
121
|
-
Generated on Wed Dec 25
|
121
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
122
122
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
123
123
|
0.8.7.3 (ruby-2.0.0).
|
124
124
|
</div>
|
@@ -797,7 +797,7 @@
|
|
797
797
|
</div>
|
798
798
|
|
799
799
|
<div id="footer">
|
800
|
-
Generated on Wed Dec 25
|
800
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
801
801
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
802
802
|
0.8.7.3 (ruby-2.0.0).
|
803
803
|
</div>
|
@@ -887,7 +887,7 @@ and <code>%:Z</code> for the zone name considering also DST.</p>
|
|
887
887
|
</div>
|
888
888
|
|
889
889
|
<div id="footer">
|
890
|
-
Generated on Wed Dec 25
|
890
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
891
891
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
892
892
|
0.8.7.3 (ruby-2.0.0).
|
893
893
|
</div>
|
@@ -274,7 +274,7 @@
|
|
274
274
|
</div>
|
275
275
|
|
276
276
|
<div id="footer">
|
277
|
-
Generated on Wed Dec 25
|
277
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
278
278
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
279
279
|
0.8.7.3 (ruby-2.0.0).
|
280
280
|
</div>
|
@@ -181,7 +181,7 @@
|
|
181
181
|
<li class="public ">
|
182
182
|
<span class="summary_signature">
|
183
183
|
|
184
|
-
<a href="#javascript_params-instance_method" title="#javascript_params (instance method)">- (String|Hash) <strong>javascript_params</strong>(
|
184
|
+
<a href="#javascript_params-instance_method" title="#javascript_params (instance method)">- (String|Hash) <strong>javascript_params</strong>(id = nil, tag = :details) </a>
|
185
185
|
|
186
186
|
|
187
187
|
|
@@ -309,6 +309,7 @@
|
|
309
309
|
<pre class="lines">
|
310
310
|
|
311
311
|
|
312
|
+
47
|
312
313
|
48
|
313
314
|
49
|
314
315
|
50
|
@@ -320,11 +321,10 @@
|
|
320
321
|
56
|
321
322
|
57
|
322
323
|
58
|
323
|
-
59
|
324
|
-
60</pre>
|
324
|
+
59</pre>
|
325
325
|
</td>
|
326
326
|
<td>
|
327
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line
|
327
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 47</span>
|
328
328
|
|
329
329
|
<span class='kw'>def</span> <span class='id identifier rubyid_add_javascript_params'>add_javascript_params</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_replace'>replace</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
330
330
|
<span class='ivar'>@javascript_params</span> <span class='op'>||=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
@@ -484,7 +484,7 @@
|
|
484
484
|
<div class="method_details ">
|
485
485
|
<h3 class="signature " id="javascript_params-instance_method">
|
486
486
|
|
487
|
-
- (<tt>String|Hash</tt>) <strong>javascript_params</strong>(
|
487
|
+
- (<tt>String|Hash</tt>) <strong>javascript_params</strong>(id = nil, tag = :details)
|
488
488
|
|
489
489
|
|
490
490
|
|
@@ -503,17 +503,17 @@
|
|
503
503
|
|
504
504
|
<li>
|
505
505
|
|
506
|
-
<span class='name'>
|
506
|
+
<span class='name'>id</span>
|
507
507
|
|
508
508
|
|
509
|
-
<span class='type'>(<tt>
|
509
|
+
<span class='type'>(<tt>String|NilClass|FalseClass</tt>)</span>
|
510
510
|
|
511
511
|
|
512
|
-
<em class="default">(defaults to: <tt>
|
512
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
513
513
|
|
514
514
|
|
515
515
|
—
|
516
|
-
<div class='inline'><p>
|
516
|
+
<div class='inline'><p>The id for the tag. If <code>nil</code> or <code>false</code>, the parameters will be returned as an hash.</p>
|
517
517
|
</div>
|
518
518
|
|
519
519
|
</li>
|
@@ -535,23 +535,6 @@
|
|
535
535
|
|
536
536
|
</li>
|
537
537
|
|
538
|
-
<li>
|
539
|
-
|
540
|
-
<span class='name'>id</span>
|
541
|
-
|
542
|
-
|
543
|
-
<span class='type'>(<tt>String</tt>)</span>
|
544
|
-
|
545
|
-
|
546
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
547
|
-
|
548
|
-
|
549
|
-
—
|
550
|
-
<div class='inline'><p>The id for the tag.</p>
|
551
|
-
</div>
|
552
|
-
|
553
|
-
</li>
|
554
|
-
|
555
538
|
</ul>
|
556
539
|
|
557
540
|
<p class="tag_title">Returns:</p>
|
@@ -578,15 +561,15 @@
|
|
578
561
|
<pre class="lines">
|
579
562
|
|
580
563
|
|
564
|
+
38
|
581
565
|
39
|
582
|
-
40
|
583
|
-
41</pre>
|
566
|
+
40</pre>
|
584
567
|
</td>
|
585
568
|
<td>
|
586
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line
|
569
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/concerns/view.rb', line 38</span>
|
587
570
|
|
588
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_javascript_params'>javascript_params</span><span class='lparen'>(</span><span class='id identifier
|
589
|
-
<span class='id identifier
|
571
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_javascript_params'>javascript_params</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_tag'>tag</span> <span class='op'>=</span> <span class='symbol'>:details</span><span class='rparen'>)</span>
|
572
|
+
<span class='id identifier rubyid_id'>id</span> <span class='op'>?</span> <span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='comma'>,</span> <span class='ivar'>@javascript_params</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='period'>.</span><span class='id identifier rubyid_html_safe'>html_safe</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>data-jid</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='op'>:</span> <span class='ivar'>@javascript_params</span>
|
590
573
|
<span class='kw'>end</span></pre>
|
591
574
|
</td>
|
592
575
|
</tr>
|
@@ -655,7 +638,7 @@
|
|
655
638
|
</div>
|
656
639
|
|
657
640
|
<div id="footer">
|
658
|
-
Generated on Wed Dec 25
|
641
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
659
642
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
660
643
|
0.8.7.3 (ruby-2.0.0).
|
661
644
|
</div>
|
data/doc/Ballast/Context.html
CHANGED
@@ -408,7 +408,7 @@
|
|
408
408
|
</div>
|
409
409
|
|
410
410
|
<div id="footer">
|
411
|
-
Generated on Wed Dec 25
|
411
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
412
412
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
413
413
|
0.8.7.3 (ruby-2.0.0).
|
414
414
|
</div>
|
data/doc/Ballast/Errors.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Wed Dec 25
|
119
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.3 (ruby-2.0.0).
|
122
122
|
</div>
|
@@ -317,7 +317,7 @@
|
|
317
317
|
</div>
|
318
318
|
|
319
319
|
<div id="footer">
|
320
|
-
Generated on Wed Dec 25
|
320
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
321
321
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
322
322
|
0.8.7.3 (ruby-2.0.0).
|
323
323
|
</div>
|
@@ -148,7 +148,7 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on Wed Dec 25
|
151
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
153
|
0.8.7.3 (ruby-2.0.0).
|
154
154
|
</div>
|
@@ -148,7 +148,7 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on Wed Dec 25
|
151
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
153
|
0.8.7.3 (ruby-2.0.0).
|
154
154
|
</div>
|
@@ -148,7 +148,7 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on Wed Dec 25
|
151
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
153
|
0.8.7.3 (ruby-2.0.0).
|
154
154
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Wed Dec 25
|
119
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.3 (ruby-2.0.0).
|
122
122
|
</div>
|
@@ -345,7 +345,7 @@
|
|
345
345
|
</div>
|
346
346
|
|
347
347
|
<div id="footer">
|
348
|
-
Generated on Wed Dec 25
|
348
|
+
Generated on Wed Dec 25 15:52:54 2013 by
|
349
349
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
350
350
|
0.8.7.3 (ruby-2.0.0).
|
351
351
|
</div>
|
data/doc/Ballast/Operation.html
CHANGED
@@ -1295,7 +1295,7 @@ as owner will be created.</p>
|
|
1295
1295
|
</div>
|
1296
1296
|
|
1297
1297
|
<div id="footer">
|
1298
|
-
Generated on Wed Dec 25
|
1298
|
+
Generated on Wed Dec 25 15:52:54 2013 by
|
1299
1299
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1300
1300
|
0.8.7.3 (ruby-2.0.0).
|
1301
1301
|
</div>
|
@@ -576,7 +576,7 @@ as owner will be created.</p>
|
|
576
576
|
</div>
|
577
577
|
|
578
578
|
<div id="footer">
|
579
|
-
Generated on Wed Dec 25
|
579
|
+
Generated on Wed Dec 25 15:52:54 2013 by
|
580
580
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
581
581
|
0.8.7.3 (ruby-2.0.0).
|
582
582
|
</div>
|
@@ -908,7 +908,7 @@
|
|
908
908
|
</div>
|
909
909
|
|
910
910
|
<div id="footer">
|
911
|
-
Generated on Wed Dec 25
|
911
|
+
Generated on Wed Dec 25 15:52:54 2013 by
|
912
912
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
913
913
|
0.8.7.3 (ruby-2.0.0).
|
914
914
|
</div>
|
data/doc/Ballast/Version.html
CHANGED
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
</div>
|
136
136
|
</dt>
|
137
|
-
<dd><pre class="code"><span class='int'>
|
137
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
138
138
|
|
139
139
|
<dt id="PATCH-constant" class="">PATCH =
|
140
140
|
<div class="docstring">
|
@@ -149,7 +149,7 @@
|
|
149
149
|
|
150
150
|
</div>
|
151
151
|
</dt>
|
152
|
-
<dd><pre class="code"><span class='int'>
|
152
|
+
<dd><pre class="code"><span class='int'>0</span></pre></dd>
|
153
153
|
|
154
154
|
<dt id="STRING-constant" class="">STRING =
|
155
155
|
<div class="docstring">
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</div>
|
181
181
|
|
182
182
|
<div id="footer">
|
183
|
-
Generated on Wed Dec 25
|
183
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.7.3 (ruby-2.0.0).
|
186
186
|
</div>
|
data/doc/_index.html
CHANGED
@@ -303,7 +303,7 @@
|
|
303
303
|
</div>
|
304
304
|
|
305
305
|
<div id="footer">
|
306
|
-
Generated on Wed Dec 25
|
306
|
+
Generated on Wed Dec 25 15:52:52 2013 by
|
307
307
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
308
308
|
0.8.7.3 (ruby-2.0.0).
|
309
309
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -106,7 +106,7 @@
|
|
106
106
|
</div></div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on Wed Dec 25
|
109
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
111
|
0.8.7.3 (ruby-2.0.0).
|
112
112
|
</div>
|
data/doc/index.html
CHANGED
@@ -106,7 +106,7 @@
|
|
106
106
|
</div></div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on Wed Dec 25
|
109
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
111
|
0.8.7.3 (ruby-2.0.0).
|
112
112
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Wed Dec 25
|
106
|
+
Generated on Wed Dec 25 15:52:53 2013 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.3 (ruby-2.0.0).
|
109
109
|
</div>
|
@@ -32,12 +32,11 @@ module Ballast
|
|
32
32
|
|
33
33
|
# Outputs the Javascript parameters.
|
34
34
|
#
|
35
|
-
# @param
|
35
|
+
# @param id [String|NilClass|FalseClass] The id for the tag. If `nil` or `false`, the parameters will be returned as an hash.
|
36
36
|
# @param tag [Symbol] The tag to use for HTML.
|
37
|
-
# @param id [String] The id for the tag.
|
38
37
|
# @return [String|Hash] Javascript parameters as HTML or the hash.
|
39
|
-
def javascript_params(
|
40
|
-
|
38
|
+
def javascript_params(id = nil, tag = :details)
|
39
|
+
id ? content_tag(tag, @javascript_params.to_json.html_safe, "data-jid" => id): @javascript_params
|
41
40
|
end
|
42
41
|
|
43
42
|
# Appends new Javascript parameters.
|
data/lib/ballast/version.rb
CHANGED
@@ -62,11 +62,12 @@ describe Ballast::Concerns::View do
|
|
62
62
|
|
63
63
|
it "should output Javascript as HTML" do
|
64
64
|
expect(subject).to receive(:content_tag).with(:tag, '{"a":"1","b":2}', {"data-jid" => "ID"}).and_return("HTML")
|
65
|
-
expect(subject.javascript_params(
|
65
|
+
expect(subject.javascript_params("ID", :tag)).to eq("HTML")
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should return Javascript as Hash" do
|
69
69
|
expect(subject.javascript_params(false)).to eq({a: "1", b: 2})
|
70
|
+
expect(subject.javascript_params(nil)).to eq({a: "1", b: 2})
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|