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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90752416d3960380afc5cd5d0a3816080d308dc3
4
- data.tar.gz: a9e14654abd5fa74c46c6fb99261e05705ea8c59
3
+ metadata.gz: 3388a7a801511693256a1137f34b3825e377e485
4
+ data.tar.gz: cbe11293e58b2fbdc4d04297e3d188ce1001165c
5
5
  SHA512:
6
- metadata.gz: b68c31697bc02ae9c7d26bad19b04c7188e42b91c6c1195652d7a7f4da36bdc603af1d4cbaf7693c8c0675105c0020a7e885190d081dcf178bfcf6bd71e4c74f
7
- data.tar.gz: 4edd006dfd2b1c014f5d961d16a35b596ddf8afe744a4ac726825783ddb1255a35972f707a9837dc39272186f679e4114ad608fe9e2f0d7ecf0852e7e9898b0c
6
+ metadata.gz: a95df246c2fa28afefc163e7a1732b3cf7f2f96e448d00e0af0e48fa71b0a026b0399f889231fe6cff8ffc1c7f523495c5b4fd490ac07b910a3f0bbde3680641
7
+ data.tar.gz: f40b1b1dab152befbcb2c305f98971d0ed28489b443ff1ca768c2b6752ce9df5f9bb4ccd34e450c0009da20c094b9fad85618245fb4dd4c60abb613b2b2d7698
@@ -1,3 +1,7 @@
1
+ ### 1.2.0 / 2013-12-25
2
+
3
+ * Changed Javascript parameters output interface.
4
+
1
5
  ### 1.1.2 / 2013-12-25
2
6
 
3
7
  * Made Concerns::Common#format_short_amount second parameter optional.
@@ -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 14:50:04 2013 by
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>
@@ -118,7 +118,7 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Wed Dec 25 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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>(as_html = true, tag = :details, id = nil) </a>
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 48</span>
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>(as_html = true, tag = :details, id = nil)
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'>as_html</span>
506
+ <span class='name'>id</span>
507
507
 
508
508
 
509
- <span class='type'>(<tt>Boolean</tt>)</span>
509
+ <span class='type'>(<tt>String|NilClass|FalseClass</tt>)</span>
510
510
 
511
511
 
512
- <em class="default">(defaults to: <tt>true</tt>)</em>
512
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
513
513
 
514
514
 
515
515
  &mdash;
516
- <div class='inline'><p>Whether to return the parameters as HTML rather than hash.</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
- &mdash;
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 39</span>
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 rubyid_as_html'>as_html</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_tag'>tag</span> <span class='op'>=</span> <span class='symbol'>:details</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
589
- <span class='id identifier rubyid_as_html'>as_html</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'>&quot;</span><span class='tstring_content'>data-jid</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='op'>:</span> <span class='ivar'>@javascript_params</span>
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'>&quot;</span><span class='tstring_content'>data-jid</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</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 14:50:04 2013 by
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>
@@ -408,7 +408,7 @@
408
408
  </div>
409
409
 
410
410
  <div id="footer">
411
- Generated on Wed Dec 25 14:50:04 2013 by
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>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Wed Dec 25 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:04 2013 by
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 14:50:05 2013 by
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>
@@ -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 14:50:05 2013 by
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 14:50:05 2013 by
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 14:50:05 2013 by
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>
@@ -134,7 +134,7 @@
134
134
 
135
135
  </div>
136
136
  </dt>
137
- <dd><pre class="code"><span class='int'>1</span></pre></dd>
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'>2</span></pre></dd>
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 14:50:04 2013 by
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>
@@ -303,7 +303,7 @@
303
303
  </div>
304
304
 
305
305
  <div id="footer">
306
- Generated on Wed Dec 25 14:50:04 2013 by
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>
@@ -106,7 +106,7 @@
106
106
  </div></div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Wed Dec 25 14:50:04 2013 by
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>
@@ -106,7 +106,7 @@
106
106
  </div></div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Wed Dec 25 14:50:04 2013 by
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 14:50:04 2013 by
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 as_html [Boolean] Whether to return the parameters as HTML rather than hash.
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(as_html = true, tag = :details, id = nil)
40
- as_html ? content_tag(tag, @javascript_params.to_json.html_safe, "data-jid" => id): @javascript_params
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.
@@ -13,10 +13,10 @@ module Ballast
13
13
  MAJOR = 1
14
14
 
15
15
  # The minor version.
16
- MINOR = 1
16
+ MINOR = 2
17
17
 
18
18
  # The patch version.
19
- PATCH = 2
19
+ PATCH = 0
20
20
 
21
21
  # The current version of ballast.
22
22
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
@@ -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(true, :tag, "ID")).to eq("HTML")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ballast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shogun