ballast 1.5.0 → 1.5.1

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: bd59bbb0c6206ad0a3389ea19f5832b069080841
4
- data.tar.gz: b162883d21ad6f5661d7e1ba324766e78eb87432
3
+ metadata.gz: dc5799f1e29dc591080f335e942871ad0941546d
4
+ data.tar.gz: 1fa78408a9ab5e5de07394b508803bf21c3b98cf
5
5
  SHA512:
6
- metadata.gz: cd120366facef08cd59d4b9e0e667a7ae0859d27d47bbe56780f0bcfdd3d7787506c370fc966235f9042b6c6053a450ed01c1f531cbd209134cff3fef4f6871b
7
- data.tar.gz: 08469e4cbdda11b1c528ce5c4bda41c3056a0aaa2af1c9985318f2c691ca756a9a491b6f42f1a9339fadcfb6cae2407e039a4427f8de9cc286e8231d9deeee84
6
+ metadata.gz: 736d23b13df218cba6cb2b93b88018d7e73b8c29c203c62e556a03efec18f6176a9eef07efd2994244a01d64f9a5f68c7f6af499ea7191b1952347b78071529d
7
+ data.tar.gz: dbc51a1733cfcffbf0586e7f7f21ddb6e0488b52a4419c0a2a9ecab5571db78d8cc14f287c47a3cbbbf78e8cc3c908d518ac70414931cbf585a29fbc0e6db555
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.5.1 / 2014-01-04
2
+
3
+ * Fixed is_json? detection.
4
+
1
5
  ### 1.5.0 / 2014-01-04
2
6
 
3
7
  * Added is_json? to Concerns::Common.
@@ -424,7 +424,7 @@
424
424
  <pre class="code"><span class="info file"># File 'lib/ballast/concerns/ajax.rb', line 16</span>
425
425
 
426
426
  <span class='kw'>def</span> <span class='id identifier rubyid_is_ajax?'>is_ajax?</span>
427
- <span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:xhr?</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_xhr?'>xhr?</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:xhr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_boolean'>to_boolean</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
427
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:xhr?</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_xhr?'>xhr?</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:xhr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_boolean'>to_boolean</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
428
428
  <span class='kw'>end</span></pre>
429
429
  </td>
430
430
  </tr>
@@ -797,7 +797,7 @@
797
797
  </div>
798
798
 
799
799
  <div id="footer">
800
- Generated on Sat Jan 4 10:24:04 2014 by
800
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
803
803
  </div>
@@ -790,7 +790,7 @@ and <code>%:Z</code> for the zone name considering also DST.</p>
790
790
  <pre class="code"><span class="info file"># File 'lib/ballast/concerns/common.rb', line 13</span>
791
791
 
792
792
  <span class='kw'>def</span> <span class='id identifier rubyid_is_json?'>is_json?</span>
793
- <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^json</span><span class='regexp_end'>/</span></span> <span class='op'>||</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:json</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_boolean'>to_boolean</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
793
+ <span class='lparen'>(</span><span class='lbracket'>[</span><span class='symbol'>:json</span><span class='comma'>,</span> <span class='symbol'>:jsonp</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:json</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_boolean'>to_boolean</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
794
794
  <span class='kw'>end</span></pre>
795
795
  </td>
796
796
  </tr>
@@ -967,7 +967,7 @@ and <code>%:Z</code> for the zone name considering also DST.</p>
967
967
  </div>
968
968
 
969
969
  <div id="footer">
970
- Generated on Sat Jan 4 10:24:04 2014 by
970
+ Generated on Sat Jan 4 10:31:57 2014 by
971
971
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
972
972
  0.8.7.3 (ruby-2.1.0).
973
973
  </div>
@@ -291,7 +291,7 @@
291
291
  </div>
292
292
 
293
293
  <div id="footer">
294
- Generated on Sat Jan 4 10:24:04 2014 by
294
+ Generated on Sat Jan 4 10:31:57 2014 by
295
295
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
296
296
  0.8.7.3 (ruby-2.1.0).
297
297
  </div>
@@ -638,7 +638,7 @@
638
638
  </div>
639
639
 
640
640
  <div id="footer">
641
- Generated on Sat Jan 4 10:24:04 2014 by
641
+ Generated on Sat Jan 4 10:31:57 2014 by
642
642
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
643
643
  0.8.7.3 (ruby-2.1.0).
644
644
  </div>
@@ -118,7 +118,7 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Sat Jan 4 10:24:04 2014 by
121
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
124
124
  </div>
@@ -273,7 +273,7 @@ Subfolders are not supported.</p>
273
273
  </div>
274
274
 
275
275
  <div id="footer">
276
- Generated on Sat Jan 4 10:24:04 2014 by
276
+ Generated on Sat Jan 4 10:31:58 2014 by
277
277
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
278
278
  0.8.7.3 (ruby-2.1.0).
279
279
  </div>
@@ -408,7 +408,7 @@
408
408
  </div>
409
409
 
410
410
  <div id="footer">
411
- Generated on Sat Jan 4 10:24:04 2014 by
411
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
414
414
  </div>
@@ -317,7 +317,7 @@
317
317
  </div>
318
318
 
319
319
  <div id="footer">
320
- Generated on Sat Jan 4 10:24:04 2014 by
320
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
323
323
  </div>
@@ -148,7 +148,7 @@
148
148
  </div>
149
149
 
150
150
  <div id="footer">
151
- Generated on Sat Jan 4 10:24:04 2014 by
151
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
154
154
  </div>
@@ -148,7 +148,7 @@
148
148
  </div>
149
149
 
150
150
  <div id="footer">
151
- Generated on Sat Jan 4 10:24:04 2014 by
151
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
154
154
  </div>
@@ -148,7 +148,7 @@
148
148
  </div>
149
149
 
150
150
  <div id="footer">
151
- Generated on Sat Jan 4 10:24:04 2014 by
151
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
154
154
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sat Jan 4 10:24:04 2014 by
119
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
122
122
  </div>
@@ -345,7 +345,7 @@
345
345
  </div>
346
346
 
347
347
  <div id="footer">
348
- Generated on Sat Jan 4 10:24:05 2014 by
348
+ Generated on Sat Jan 4 10:31:58 2014 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.1.0).
351
351
  </div>
@@ -116,7 +116,7 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sat Jan 4 10:24:04 2014 by
119
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
122
122
  </div>
@@ -1295,7 +1295,7 @@ as owner will be created.</p>
1295
1295
  </div>
1296
1296
 
1297
1297
  <div id="footer">
1298
- Generated on Sat Jan 4 10:24:04 2014 by
1298
+ Generated on Sat Jan 4 10:31:58 2014 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.1.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 Sat Jan 4 10:24:05 2014 by
579
+ Generated on Sat Jan 4 10:31:58 2014 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.1.0).
582
582
  </div>
@@ -908,7 +908,7 @@
908
908
  </div>
909
909
 
910
910
  <div id="footer">
911
- Generated on Sat Jan 4 10:24:05 2014 by
911
+ Generated on Sat Jan 4 10:31:58 2014 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.1.0).
914
914
  </div>
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>0</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>1</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 Sat Jan 4 10:24:04 2014 by
183
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
186
186
  </div>
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 Sat Jan 4 10:24:04 2014 by
124
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
127
127
  </div>
data/doc/_index.html CHANGED
@@ -310,7 +310,7 @@
310
310
  </div>
311
311
 
312
312
  <div id="footer">
313
- Generated on Sat Jan 4 10:24:04 2014 by
313
+ Generated on Sat Jan 4 10:31:57 2014 by
314
314
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
315
315
  0.8.7.3 (ruby-2.1.0).
316
316
  </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 Sat Jan 4 10:24:04 2014 by
109
+ Generated on Sat Jan 4 10:31:57 2014 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.1.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 Sat Jan 4 10:24:04 2014 by
109
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
112
112
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sat Jan 4 10:24:04 2014 by
106
+ Generated on Sat Jan 4 10:31:57 2014 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.1.0).
109
109
  </div>
@@ -14,7 +14,7 @@ module Ballast
14
14
  #
15
15
  # @return [Boolean] `true` if the request is AJAX, `false` otherwise.
16
16
  def is_ajax?
17
- (request.respond_to?(:xhr?) && request.xhr?) || params[:xhr].to_boolean ? true : false
17
+ ((request.respond_to?(:xhr?) && request.xhr?) || params[:xhr].to_boolean) ? true : false
18
18
  end
19
19
 
20
20
  # Prepares an AJAX response.
@@ -11,7 +11,7 @@ module Ballast
11
11
  #
12
12
  # @return [Boolean] `true` if the request is JSON, `false` otherwise.
13
13
  def is_json?
14
- request.format.to_s =~ /^json/ || params[:json].to_boolean ? true : false
14
+ ([:json, :jsonp].include?(request.format.to_sym) || params[:json].to_boolean) ? true : false
15
15
  end
16
16
 
17
17
  # Checks if the user is sending any data.
@@ -16,7 +16,7 @@ module Ballast
16
16
  MINOR = 5
17
17
 
18
18
  # The patch version.
19
- PATCH = 0
19
+ PATCH = 1
20
20
 
21
21
  # The current version of ballast.
22
22
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shogun