ballast 2.0.0 → 2.0.1
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/CHANGELOG.md +5 -2
- data/doc/Ballast/AjaxResponse.html +1 -1
- data/doc/Ballast/Concerns/AjaxHandling.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 +1 -1
- data/doc/Ballast/Concerns.html +1 -1
- data/doc/Ballast/Configuration.html +1 -1
- data/doc/Ballast/Emoji/Character.html +1 -1
- data/doc/Ballast/Emoji/Utils.html +1 -1
- data/doc/Ballast/Emoji.html +1 -1
- data/doc/Ballast/Errors/Base.html +1 -1
- data/doc/Ballast/Errors/Failure.html +1 -1
- data/doc/Ballast/Errors/InvalidDomain.html +1 -1
- data/doc/Ballast/Errors/ValidationFailure.html +1 -1
- data/doc/Ballast/Errors.html +1 -1
- data/doc/Ballast/Middlewares/DefaultHost.html +1 -1
- data/doc/Ballast/Middlewares.html +1 -1
- data/doc/Ballast/RequestDomainMatcher.html +1 -1
- data/doc/Ballast/Service/Response.html +44 -17
- data/doc/Ballast/Service.html +24 -22
- data/doc/Ballast/Version.html +2 -2
- data/doc/Ballast.html +4 -4
- 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/service.rb +3 -2
- data/lib/ballast/version.rb +1 -1
- data/lib/ballast.rb +1 -0
- data/spec/ballast/emoji_spec.rb +7 -7
- data/spec/ballast/service_spec.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44cbb903c92544d7e56dd3c15038ac5ed48813dc
|
|
4
|
+
data.tar.gz: ba030ab2fafa22d6bc21d7651cd90cdb7f459152
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4215a544729e904c26230aaf9409fbb0c178fc38431b7767e7c1404bed47a25867710e71535b7ae09c179fdf8dca7021c8bc4d818381ee414ef0cebd6ddccdd4
|
|
7
|
+
data.tar.gz: 44b338272e0824c823ddfc8c8cb6c94ea44cfd5f1ab4ff2c07d914385d75b5c11ac586f746efd905af02215ad62091dc9371b6d41ee4ff01c3eaf8e4bcfe7959
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
### 2.0.1 / 2014-12-26
|
|
2
|
+
|
|
3
|
+
* Added `transport` parameter to `Ballast::Service#as_ajax_response`.
|
|
4
|
+
|
|
1
5
|
### 2.0.0 / 2014-11-02
|
|
2
6
|
|
|
3
7
|
#### General
|
|
@@ -6,7 +10,7 @@
|
|
|
6
10
|
* Added `Ballast::AjaxResponse`.
|
|
7
11
|
* Added `Ballast::Emoji`.
|
|
8
12
|
* Added `Ballast::Service`.
|
|
9
|
-
* Added `Ballast::
|
|
13
|
+
* Added `Ballast::Service::Response`.
|
|
10
14
|
* Removed `Ballast::Context`.
|
|
11
15
|
* Removed `Ballast::Operation`.
|
|
12
16
|
* Removed `Ballast::OperationsChain`.
|
|
@@ -129,4 +133,3 @@
|
|
|
129
133
|
### 1.0.0 / 2013-12-25
|
|
130
134
|
|
|
131
135
|
* Initial version.
|
|
132
|
-
|
|
@@ -1371,7 +1371,7 @@
|
|
|
1371
1371
|
</div>
|
|
1372
1372
|
|
|
1373
1373
|
<div id="footer">
|
|
1374
|
-
Generated on
|
|
1374
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
1375
1375
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1376
1376
|
0.8.7.6 (ruby-2.1.3).
|
|
1377
1377
|
</div>
|
|
@@ -653,7 +653,7 @@
|
|
|
653
653
|
</div>
|
|
654
654
|
|
|
655
655
|
<div id="footer">
|
|
656
|
-
Generated on
|
|
656
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
657
657
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
658
658
|
0.8.7.6 (ruby-2.1.3).
|
|
659
659
|
</div>
|
|
@@ -818,7 +818,7 @@ and <code>%:Z</code> for the zone name considering also DST.</p>
|
|
|
818
818
|
</div>
|
|
819
819
|
|
|
820
820
|
<div id="footer">
|
|
821
|
-
Generated on
|
|
821
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
822
822
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
823
823
|
0.8.7.6 (ruby-2.1.3).
|
|
824
824
|
</div>
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
</div>
|
|
274
274
|
|
|
275
275
|
<div id="footer">
|
|
276
|
-
Generated on
|
|
276
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
277
277
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
278
278
|
0.8.7.6 (ruby-2.1.3).
|
|
279
279
|
</div>
|
|
@@ -874,7 +874,7 @@
|
|
|
874
874
|
</div>
|
|
875
875
|
|
|
876
876
|
<div id="footer">
|
|
877
|
-
Generated on
|
|
877
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
878
878
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
879
879
|
0.8.7.6 (ruby-2.1.3).
|
|
880
880
|
</div>
|
data/doc/Ballast/Concerns.html
CHANGED
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<div id="footer">
|
|
121
|
-
Generated on
|
|
121
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
122
122
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
123
123
|
0.8.7.6 (ruby-2.1.3).
|
|
124
124
|
</div>
|
|
@@ -448,7 +448,7 @@ Subfolders are not supported.</p>
|
|
|
448
448
|
</div>
|
|
449
449
|
|
|
450
450
|
<div id="footer">
|
|
451
|
-
Generated on
|
|
451
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
452
452
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
453
453
|
0.8.7.6 (ruby-2.1.3).
|
|
454
454
|
</div>
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
</div>
|
|
403
403
|
|
|
404
404
|
<div id="footer">
|
|
405
|
-
Generated on
|
|
405
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
406
406
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
407
407
|
0.8.7.6 (ruby-2.1.3).
|
|
408
408
|
</div>
|
|
@@ -785,7 +785,7 @@
|
|
|
785
785
|
</div>
|
|
786
786
|
|
|
787
787
|
<div id="footer">
|
|
788
|
-
Generated on
|
|
788
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
789
789
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
790
790
|
0.8.7.6 (ruby-2.1.3).
|
|
791
791
|
</div>
|
data/doc/Ballast/Emoji.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.8.7.6 (ruby-2.1.3).
|
|
122
122
|
</div>
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
</div>
|
|
345
345
|
|
|
346
346
|
<div id="footer">
|
|
347
|
-
Generated on
|
|
347
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
348
348
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
349
349
|
0.8.7.6 (ruby-2.1.3).
|
|
350
350
|
</div>
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
</div>
|
|
153
153
|
|
|
154
154
|
<div id="footer">
|
|
155
|
-
Generated on
|
|
155
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
156
156
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
157
157
|
0.8.7.6 (ruby-2.1.3).
|
|
158
158
|
</div>
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
</div>
|
|
149
149
|
|
|
150
150
|
<div id="footer">
|
|
151
|
-
Generated on
|
|
151
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
153
153
|
0.8.7.6 (ruby-2.1.3).
|
|
154
154
|
</div>
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
</div>
|
|
157
157
|
|
|
158
158
|
<div id="footer">
|
|
159
|
-
Generated on
|
|
159
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
160
160
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
161
161
|
0.8.7.6 (ruby-2.1.3).
|
|
162
162
|
</div>
|
data/doc/Ballast/Errors.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.8.7.6 (ruby-2.1.3).
|
|
122
122
|
</div>
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
</div>
|
|
346
346
|
|
|
347
347
|
<div id="footer">
|
|
348
|
-
Generated on
|
|
348
|
+
Generated on Fri Dec 26 11:54:48 2014 by
|
|
349
349
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
350
350
|
0.8.7.6 (ruby-2.1.3).
|
|
351
351
|
</div>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.8.7.6 (ruby-2.1.3).
|
|
122
122
|
</div>
|
|
@@ -908,7 +908,7 @@
|
|
|
908
908
|
</div>
|
|
909
909
|
|
|
910
910
|
<div id="footer">
|
|
911
|
-
Generated on
|
|
911
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
912
912
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
913
913
|
0.8.7.6 (ruby-2.1.3).
|
|
914
914
|
</div>
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
<li class="public ">
|
|
217
217
|
<span class="summary_signature">
|
|
218
218
|
|
|
219
|
-
<a href="#as_ajax_response-instance_method" title="#as_ajax_response (instance method)">- (AjaxResponse) <strong>as_ajax_response</strong> </a>
|
|
219
|
+
<a href="#as_ajax_response-instance_method" title="#as_ajax_response (instance method)">- (AjaxResponse) <strong>as_ajax_response</strong>(transport = nil) </a>
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
|
|
@@ -560,7 +560,8 @@
|
|
|
560
560
|
74
|
|
561
561
|
75
|
|
562
562
|
76
|
|
563
|
-
77
|
|
563
|
+
77
|
|
564
|
+
78</pre>
|
|
564
565
|
</td>
|
|
565
566
|
<td>
|
|
566
567
|
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 20</span>
|
|
@@ -609,8 +610,9 @@
|
|
|
609
610
|
|
|
610
611
|
<span class='comment'># Converts this response to a AJAX response.
|
|
611
612
|
</span> <span class='comment'>#
|
|
613
|
+
</span> <span class='comment'># @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`.
|
|
612
614
|
</span> <span class='comment'># @return [AjaxResponse] The AJAX response, which will include only the first error.
|
|
613
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span>
|
|
615
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
614
616
|
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error_message'>error_message</span> <span class='op'>=</span>
|
|
615
617
|
<span class='kw'>if</span> <span class='id identifier rubyid_successful?'>successful?</span>
|
|
616
618
|
<span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rbracket'>]</span>
|
|
@@ -620,7 +622,7 @@
|
|
|
620
622
|
<span class='lbracket'>[</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rbracket'>]</span>
|
|
621
623
|
<span class='kw'>end</span>
|
|
622
624
|
|
|
623
|
-
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span>
|
|
625
|
+
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span> <span class='label'>transport:</span> <span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
|
|
624
626
|
<span class='kw'>end</span>
|
|
625
627
|
<span class='kw'>end</span></pre>
|
|
626
628
|
</td>
|
|
@@ -729,7 +731,8 @@
|
|
|
729
731
|
74
|
|
730
732
|
75
|
|
731
733
|
76
|
|
732
|
-
77
|
|
734
|
+
77
|
|
735
|
+
78</pre>
|
|
733
736
|
</td>
|
|
734
737
|
<td>
|
|
735
738
|
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 20</span>
|
|
@@ -778,8 +781,9 @@
|
|
|
778
781
|
|
|
779
782
|
<span class='comment'># Converts this response to a AJAX response.
|
|
780
783
|
</span> <span class='comment'>#
|
|
784
|
+
</span> <span class='comment'># @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`.
|
|
781
785
|
</span> <span class='comment'># @return [AjaxResponse] The AJAX response, which will include only the first error.
|
|
782
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span>
|
|
786
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
783
787
|
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error_message'>error_message</span> <span class='op'>=</span>
|
|
784
788
|
<span class='kw'>if</span> <span class='id identifier rubyid_successful?'>successful?</span>
|
|
785
789
|
<span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rbracket'>]</span>
|
|
@@ -789,7 +793,7 @@
|
|
|
789
793
|
<span class='lbracket'>[</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rbracket'>]</span>
|
|
790
794
|
<span class='kw'>end</span>
|
|
791
795
|
|
|
792
|
-
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span>
|
|
796
|
+
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span> <span class='label'>transport:</span> <span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
|
|
793
797
|
<span class='kw'>end</span>
|
|
794
798
|
<span class='kw'>end</span></pre>
|
|
795
799
|
</td>
|
|
@@ -898,7 +902,8 @@
|
|
|
898
902
|
74
|
|
899
903
|
75
|
|
900
904
|
76
|
|
901
|
-
77
|
|
905
|
+
77
|
|
906
|
+
78</pre>
|
|
902
907
|
</td>
|
|
903
908
|
<td>
|
|
904
909
|
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 20</span>
|
|
@@ -947,8 +952,9 @@
|
|
|
947
952
|
|
|
948
953
|
<span class='comment'># Converts this response to a AJAX response.
|
|
949
954
|
</span> <span class='comment'>#
|
|
955
|
+
</span> <span class='comment'># @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`.
|
|
950
956
|
</span> <span class='comment'># @return [AjaxResponse] The AJAX response, which will include only the first error.
|
|
951
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span>
|
|
957
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
952
958
|
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error_message'>error_message</span> <span class='op'>=</span>
|
|
953
959
|
<span class='kw'>if</span> <span class='id identifier rubyid_successful?'>successful?</span>
|
|
954
960
|
<span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rbracket'>]</span>
|
|
@@ -958,7 +964,7 @@
|
|
|
958
964
|
<span class='lbracket'>[</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rbracket'>]</span>
|
|
959
965
|
<span class='kw'>end</span>
|
|
960
966
|
|
|
961
|
-
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span>
|
|
967
|
+
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span> <span class='label'>transport:</span> <span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
|
|
962
968
|
<span class='kw'>end</span>
|
|
963
969
|
<span class='kw'>end</span></pre>
|
|
964
970
|
</td>
|
|
@@ -976,7 +982,7 @@
|
|
|
976
982
|
<div class="method_details first">
|
|
977
983
|
<h3 class="signature first" id="as_ajax_response-instance_method">
|
|
978
984
|
|
|
979
|
-
- (<tt><span class='object_link'><a href="../AjaxResponse.html" title="Ballast::AjaxResponse (class)">AjaxResponse</a></span></tt>) <strong>as_ajax_response</strong>
|
|
985
|
+
- (<tt><span class='object_link'><a href="../AjaxResponse.html" title="Ballast::AjaxResponse (class)">AjaxResponse</a></span></tt>) <strong>as_ajax_response</strong>(transport = nil)
|
|
980
986
|
|
|
981
987
|
|
|
982
988
|
|
|
@@ -990,7 +996,28 @@
|
|
|
990
996
|
</div>
|
|
991
997
|
</div>
|
|
992
998
|
<div class="tags">
|
|
999
|
+
<p class="tag_title">Parameters:</p>
|
|
1000
|
+
<ul class="param">
|
|
1001
|
+
|
|
1002
|
+
<li>
|
|
1003
|
+
|
|
1004
|
+
<span class='name'>transport</span>
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
<span class='type'>(<tt>Object|NilClass</tt>)</span>
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
—
|
|
1014
|
+
<div class='inline'><p>The transport to use for sending. Must respond to <code>render</code>, <code>params</code>, <code>request.format</code> and <code>performed?</code>.</p>
|
|
1015
|
+
</div>
|
|
1016
|
+
|
|
1017
|
+
</li>
|
|
993
1018
|
|
|
1019
|
+
</ul>
|
|
1020
|
+
|
|
994
1021
|
<p class="tag_title">Returns:</p>
|
|
995
1022
|
<ul class="return">
|
|
996
1023
|
|
|
@@ -1015,7 +1042,6 @@
|
|
|
1015
1042
|
<pre class="lines">
|
|
1016
1043
|
|
|
1017
1044
|
|
|
1018
|
-
65
|
|
1019
1045
|
66
|
|
1020
1046
|
67
|
|
1021
1047
|
68
|
|
@@ -1026,12 +1052,13 @@
|
|
|
1026
1052
|
73
|
|
1027
1053
|
74
|
|
1028
1054
|
75
|
|
1029
|
-
76
|
|
1055
|
+
76
|
|
1056
|
+
77</pre>
|
|
1030
1057
|
</td>
|
|
1031
1058
|
<td>
|
|
1032
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
1059
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 66</span>
|
|
1033
1060
|
|
|
1034
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span>
|
|
1061
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
1035
1062
|
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error_message'>error_message</span> <span class='op'>=</span>
|
|
1036
1063
|
<span class='kw'>if</span> <span class='id identifier rubyid_successful?'>successful?</span>
|
|
1037
1064
|
<span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rbracket'>]</span>
|
|
@@ -1041,7 +1068,7 @@
|
|
|
1041
1068
|
<span class='lbracket'>[</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rbracket'>]</span>
|
|
1042
1069
|
<span class='kw'>end</span>
|
|
1043
1070
|
|
|
1044
|
-
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span>
|
|
1071
|
+
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span> <span class='label'>transport:</span> <span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
|
|
1045
1072
|
<span class='kw'>end</span></pre>
|
|
1046
1073
|
</td>
|
|
1047
1074
|
</tr>
|
|
@@ -1234,7 +1261,7 @@
|
|
|
1234
1261
|
</div>
|
|
1235
1262
|
|
|
1236
1263
|
<div id="footer">
|
|
1237
|
-
Generated on
|
|
1264
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
1238
1265
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1239
1266
|
0.8.7.6 (ruby-2.1.3).
|
|
1240
1267
|
</div>
|
data/doc/Ballast/Service.html
CHANGED
|
@@ -368,12 +368,12 @@
|
|
|
368
368
|
<pre class="lines">
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
108
|
|
372
371
|
109
|
|
373
|
-
110
|
|
372
|
+
110
|
|
373
|
+
111</pre>
|
|
374
374
|
</td>
|
|
375
375
|
<td>
|
|
376
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
376
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 109</span>
|
|
377
377
|
|
|
378
378
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_owner'>owner</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
379
379
|
<span class='ivar'>@owner</span> <span class='op'>=</span> <span class='id identifier rubyid_owner'>owner</span>
|
|
@@ -567,7 +567,8 @@
|
|
|
567
567
|
143
|
|
568
568
|
144
|
|
569
569
|
145
|
|
570
|
-
146
|
|
570
|
+
146
|
|
571
|
+
147</pre>
|
|
571
572
|
</td>
|
|
572
573
|
<td>
|
|
573
574
|
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 11</span>
|
|
@@ -625,8 +626,9 @@
|
|
|
625
626
|
|
|
626
627
|
<span class='comment'># Converts this response to a AJAX response.
|
|
627
628
|
</span> <span class='comment'>#
|
|
629
|
+
</span> <span class='comment'># @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`.
|
|
628
630
|
</span> <span class='comment'># @return [AjaxResponse] The AJAX response, which will include only the first error.
|
|
629
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span>
|
|
631
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_as_ajax_response'>as_ajax_response</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
630
632
|
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error_message'>error_message</span> <span class='op'>=</span>
|
|
631
633
|
<span class='kw'>if</span> <span class='id identifier rubyid_successful?'>successful?</span>
|
|
632
634
|
<span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rbracket'>]</span>
|
|
@@ -636,7 +638,7 @@
|
|
|
636
638
|
<span class='lbracket'>[</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rbracket'>]</span>
|
|
637
639
|
<span class='kw'>end</span>
|
|
638
640
|
|
|
639
|
-
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='rparen'>)</span>
|
|
641
|
+
<span class='const'>AjaxResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span> <span class='label'>transport:</span> <span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
|
|
640
642
|
<span class='kw'>end</span>
|
|
641
643
|
<span class='kw'>end</span>
|
|
642
644
|
|
|
@@ -858,15 +860,15 @@
|
|
|
858
860
|
<pre class="lines">
|
|
859
861
|
|
|
860
862
|
|
|
861
|
-
90
|
|
862
863
|
91
|
|
863
864
|
92
|
|
864
865
|
93
|
|
865
866
|
94
|
|
866
|
-
95
|
|
867
|
+
95
|
|
868
|
+
96</pre>
|
|
867
869
|
</td>
|
|
868
870
|
<td>
|
|
869
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
871
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 91</span>
|
|
870
872
|
|
|
871
873
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_operation'>operation</span> <span class='op'>=</span> <span class='symbol'>:perform</span><span class='comma'>,</span> <span class='label'>owner:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>raise_errors:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
872
874
|
<span class='id identifier rubyid_fail!'>fail!</span><span class='lparen'>(</span><span class='label'>status:</span> <span class='int'>501</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unsupported operation </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_operation'>operation</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_operation'>operation</span><span class='rparen'>)</span>
|
|
@@ -951,12 +953,12 @@
|
|
|
951
953
|
<pre class="lines">
|
|
952
954
|
|
|
953
955
|
|
|
954
|
-
101
|
|
955
956
|
102
|
|
956
|
-
103
|
|
957
|
+
103
|
|
958
|
+
104</pre>
|
|
957
959
|
</td>
|
|
958
960
|
<td>
|
|
959
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
961
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 102</span>
|
|
960
962
|
|
|
961
963
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_fail!'>fail!</span><span class='lparen'>(</span><span class='id identifier rubyid_details'>details</span><span class='comma'>,</span> <span class='label'>on_validation:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
962
964
|
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='id identifier rubyid_on_validation'>on_validation</span> <span class='op'>?</span> <span class='const'>Errors</span><span class='op'>::</span><span class='const'>ValidationFailure</span> <span class='op'>:</span> <span class='const'>Errors</span><span class='op'>::</span><span class='const'>Failure</span><span class='comma'>,</span> <span class='id identifier rubyid_details'>details</span><span class='rparen'>)</span>
|
|
@@ -1042,12 +1044,12 @@
|
|
|
1042
1044
|
<pre class="lines">
|
|
1043
1045
|
|
|
1044
1046
|
|
|
1045
|
-
143
|
|
1046
1047
|
144
|
|
1047
|
-
145
|
|
1048
|
+
145
|
|
1049
|
+
146</pre>
|
|
1048
1050
|
</td>
|
|
1049
1051
|
<td>
|
|
1050
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
1052
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 144</span>
|
|
1051
1053
|
|
|
1052
1054
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_handle_failure'>handle_failure</span><span class='lparen'>(</span><span class='id identifier rubyid_failure'>failure</span><span class='comma'>,</span> <span class='id identifier rubyid_raise_errors'>raise_errors</span><span class='rparen'>)</span>
|
|
1053
1055
|
<span class='id identifier rubyid_raise_errors'>raise_errors</span> <span class='op'>?</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='id identifier rubyid_failure'>failure</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Response</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>false</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_failure'>failure</span><span class='period'>.</span><span class='id identifier rubyid_details'>details</span><span class='rparen'>)</span>
|
|
@@ -1201,17 +1203,17 @@
|
|
|
1201
1203
|
<pre class="lines">
|
|
1202
1204
|
|
|
1203
1205
|
|
|
1204
|
-
121
|
|
1205
1206
|
122
|
|
1206
1207
|
123
|
|
1207
1208
|
124
|
|
1208
1209
|
125
|
|
1209
1210
|
126
|
|
1210
1211
|
127
|
|
1211
|
-
128
|
|
1212
|
+
128
|
|
1213
|
+
129</pre>
|
|
1212
1214
|
</td>
|
|
1213
1215
|
<td>
|
|
1214
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
1216
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 122</span>
|
|
1215
1217
|
|
|
1216
1218
|
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_operation'>operation</span> <span class='op'>=</span> <span class='symbol'>:perform</span><span class='comma'>,</span> <span class='label'>owner:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>raise_errors:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1217
1219
|
<span class='comment'># PI: Ignore Roodi on this method
|
|
@@ -1285,12 +1287,12 @@
|
|
|
1285
1287
|
<pre class="lines">
|
|
1286
1288
|
|
|
1287
1289
|
|
|
1288
|
-
134
|
|
1289
1290
|
135
|
|
1290
|
-
136
|
|
1291
|
+
136
|
|
1292
|
+
137</pre>
|
|
1291
1293
|
</td>
|
|
1292
1294
|
<td>
|
|
1293
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
|
1295
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 135</span>
|
|
1294
1296
|
|
|
1295
1297
|
<span class='kw'>def</span> <span class='id identifier rubyid_fail!'>fail!</span><span class='lparen'>(</span><span class='id identifier rubyid_details'>details</span><span class='comma'>,</span> <span class='label'>on_validation:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
1296
1298
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_fail!'>fail!</span><span class='lparen'>(</span><span class='id identifier rubyid_details'>details</span><span class='comma'>,</span> <span class='label'>on_validation:</span> <span class='id identifier rubyid_on_validation'>on_validation</span><span class='rparen'>)</span>
|
|
@@ -1305,7 +1307,7 @@
|
|
|
1305
1307
|
</div>
|
|
1306
1308
|
|
|
1307
1309
|
<div id="footer">
|
|
1308
|
-
Generated on
|
|
1310
|
+
Generated on Fri Dec 26 11:54:47 2014 by
|
|
1309
1311
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1310
1312
|
0.8.7.6 (ruby-2.1.3).
|
|
1311
1313
|
</div>
|
data/doc/Ballast/Version.html
CHANGED
|
@@ -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'>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
|
|
183
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
185
185
|
0.8.7.6 (ruby-2.1.3).
|
|
186
186
|
</div>
|
data/doc/Ballast.html
CHANGED
|
@@ -217,7 +217,6 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
217
217
|
<pre class="lines">
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
37
|
|
221
220
|
38
|
|
222
221
|
39
|
|
223
222
|
40
|
|
@@ -228,10 +227,11 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
228
227
|
45
|
|
229
228
|
46
|
|
230
229
|
47
|
|
231
|
-
48
|
|
230
|
+
48
|
|
231
|
+
49</pre>
|
|
232
232
|
</td>
|
|
233
233
|
<td>
|
|
234
|
-
<pre class="code"><span class="info file"># File 'lib/ballast.rb', line
|
|
234
|
+
<pre class="code"><span class="info file"># File 'lib/ballast.rb', line 38</span>
|
|
235
235
|
|
|
236
236
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_in_em_thread'>in_em_thread</span><span class='lparen'>(</span><span class='id identifier rubyid_start_reactor'>start_reactor</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
237
237
|
<span class='kw'>if</span> <span class='const'>EM</span><span class='period'>.</span><span class='id identifier rubyid_reactor_running?'>reactor_running?</span>
|
|
@@ -255,7 +255,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
255
255
|
</div>
|
|
256
256
|
|
|
257
257
|
<div id="footer">
|
|
258
|
-
Generated on
|
|
258
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
259
259
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
260
260
|
0.8.7.6 (ruby-2.1.3).
|
|
261
261
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
</div>
|
|
340
340
|
|
|
341
341
|
<div id="footer">
|
|
342
|
-
Generated on
|
|
342
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
343
343
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
344
344
|
0.8.7.6 (ruby-2.1.3).
|
|
345
345
|
</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
|
|
109
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
111
111
|
0.8.7.6 (ruby-2.1.3).
|
|
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
|
|
109
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
111
111
|
0.8.7.6 (ruby-2.1.3).
|
|
112
112
|
</div>
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
</div>
|
|
141
141
|
|
|
142
142
|
<div id="footer">
|
|
143
|
-
Generated on
|
|
143
|
+
Generated on Fri Dec 26 11:54:46 2014 by
|
|
144
144
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
145
145
|
0.8.7.6 (ruby-2.1.3).
|
|
146
146
|
</div>
|
data/lib/ballast/service.rb
CHANGED
|
@@ -61,8 +61,9 @@ module Ballast
|
|
|
61
61
|
|
|
62
62
|
# Converts this response to a AJAX response.
|
|
63
63
|
#
|
|
64
|
+
# @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`.
|
|
64
65
|
# @return [AjaxResponse] The AJAX response, which will include only the first error.
|
|
65
|
-
def as_ajax_response
|
|
66
|
+
def as_ajax_response(transport = nil)
|
|
66
67
|
status, error_message =
|
|
67
68
|
if successful?
|
|
68
69
|
[:ok, nil]
|
|
@@ -72,7 +73,7 @@ module Ballast
|
|
|
72
73
|
[:unknown, error]
|
|
73
74
|
end
|
|
74
75
|
|
|
75
|
-
AjaxResponse.new(status: status, data: data, error: error_message)
|
|
76
|
+
AjaxResponse.new(status: status, data: data, error: error_message, transport: transport)
|
|
76
77
|
end
|
|
77
78
|
end
|
|
78
79
|
|
data/lib/ballast/version.rb
CHANGED
data/lib/ballast.rb
CHANGED
data/spec/ballast/emoji_spec.rb
CHANGED
|
@@ -24,9 +24,9 @@ describe Ballast::Emoji do
|
|
|
24
24
|
it "should return unicode replaced using the requested method" do
|
|
25
25
|
expect(::Emoji.replace("Phone: \u{1F4F1}, Cat: \u{1F431}, #1: \u{0031}\u{20e3}, Invalid: \u{0000}.", mode: :markup)).to eq("Phone: :iphone:, Cat: :cat:, #1: 1⃣, Invalid: \u0000.")
|
|
26
26
|
expect(Emoji.replace("Phone: \u{1F4F1}, Cat: \u{1F431}, #1: \u{0031}\u{20e3}, Invalid: \u{0000}.", mode: :url)).to eq("Phone: URL/unicode/1f4f1.png, Cat: URL/unicode/1f431.png, #1: 1⃣, Invalid: \u0000.")
|
|
27
|
-
expect(Emoji.replace("Phone: \u{1F4F1}, Cat: \u{1F431}, #1: \u{0031}\u{20e3}, Invalid: \u{0000}.", mode: :image_tag, rel: :tooltip)).to eq("Phone: <img alt=\":iphone:\"
|
|
27
|
+
expect(Emoji.replace("Phone: \u{1F4F1}, Cat: \u{1F431}, #1: \u{0031}\u{20e3}, Invalid: \u{0000}.", mode: :image_tag, rel: :tooltip)).to eq("Phone: <img alt=\":iphone:\" title=\":iphone:\" rel=\"tooltip\" src=\"URL/unicode/1f4f1.png\" class=\"emoji\" />, Cat: <img alt=\":cat:\" title=\":cat:\" rel=\"tooltip\" src=\"URL/unicode/1f431.png\" class=\"emoji\" />, #1: 1⃣, Invalid: \u0000.")
|
|
28
28
|
end
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
it "should fallback to markup when the method is not valid" do
|
|
31
31
|
expect(Emoji.replace("Phone: \u{1F4F1}, Cat: \u{1F431}, #1: \u{0031}\u{20e3}, Invalid: \u{0000}.", mode: :invalid)).to eq("Phone: :iphone:, Cat: :cat:, #1: 1⃣, Invalid: \u0000.")
|
|
32
32
|
end
|
|
@@ -37,7 +37,7 @@ describe Ballast::Emoji do
|
|
|
37
37
|
|
|
38
38
|
it "should enumerate all the available icons" do
|
|
39
39
|
expect(Emoji.enumerate(keys_method: :raw, values_method: :url)["\u{1f604}"]).to eq("URL/unicode/1f604.png")
|
|
40
|
-
expect(Emoji.enumerate(values_method: :image_tag, rel: :tooltip)[":smile:"]).to eq("<img alt=\":smile:\"
|
|
40
|
+
expect(Emoji.enumerate(values_method: :image_tag, rel: :tooltip)[":smile:"]).to eq("<img alt=\":smile:\" title=\":smile:\" rel=\"tooltip\" src=\"URL/unicode/1f604.png\" class=\"emoji\" />")
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -95,9 +95,9 @@ describe Ballast::Emoji do
|
|
|
95
95
|
include_examples :dummy_url
|
|
96
96
|
|
|
97
97
|
it "should return an image" do
|
|
98
|
-
expect(Emoji.find_by_alias("cat").image_tag).to eq("<img alt=\":cat:\"
|
|
99
|
-
expect(Emoji.find_by_alias("cat").image_tag(class: "foo")).to eq("<img alt=\":cat:\"
|
|
100
|
-
expect(Emoji.find_by_alias("cat").image_tag(rel: "tooltip1", class: "abc emoji")).to eq("<img alt=\":cat:\"
|
|
98
|
+
expect(Emoji.find_by_alias("cat").image_tag).to eq("<img alt=\":cat:\" title=\":cat:\" rel=\"tooltip\" src=\"URL/unicode/1f431.png\" class=\"emoji\" />")
|
|
99
|
+
expect(Emoji.find_by_alias("cat").image_tag(class: "foo")).to eq("<img alt=\":cat:\" title=\":cat:\" rel=\"tooltip\" class=\"foo emoji\" src=\"URL/unicode/1f431.png\" />")
|
|
100
|
+
expect(Emoji.find_by_alias("cat").image_tag(rel: "tooltip1", class: "abc emoji")).to eq("<img alt=\":cat:\" title=\":cat:\" rel=\"tooltip1\" class=\"abc emoji\" src=\"URL/unicode/1f431.png\" />")
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
|
-
end
|
|
103
|
+
end
|
|
@@ -33,14 +33,17 @@ describe Ballast::Service::Response do
|
|
|
33
33
|
|
|
34
34
|
describe "as_ajax_response" do
|
|
35
35
|
it "should create the right response" do
|
|
36
|
-
expect(Ballast::AjaxResponse).to receive(:new).with(status: :ok, data: "DATA", error: nil)
|
|
36
|
+
expect(Ballast::AjaxResponse).to receive(:new).with(status: :ok, data: "DATA", error: nil, transport: nil)
|
|
37
37
|
Ballast::Service::Response.new(true, data: "DATA", errors: "ERRORS").as_ajax_response
|
|
38
38
|
|
|
39
|
-
expect(Ballast::AjaxResponse).to receive(:new).with(status: 403, data: "DATA", error: "ERROR")
|
|
39
|
+
expect(Ballast::AjaxResponse).to receive(:new).with(status: 403, data: "DATA", error: "ERROR", transport: nil)
|
|
40
40
|
Ballast::Service::Response.new(false, data: "DATA", errors: {status: 403, error: "ERROR"}).as_ajax_response
|
|
41
41
|
|
|
42
|
-
expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR")
|
|
42
|
+
expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR", transport: nil)
|
|
43
43
|
Ballast::Service::Response.new(false, data: "DATA", errors: "ERROR").as_ajax_response
|
|
44
|
+
|
|
45
|
+
expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR", transport: "TRANSPORT")
|
|
46
|
+
Ballast::Service::Response.new(false, data: "DATA", errors: "ERROR").as_ajax_response("TRANSPORT")
|
|
44
47
|
end
|
|
45
48
|
end
|
|
46
49
|
end
|
|
@@ -134,4 +137,4 @@ describe Ballast::Service do
|
|
|
134
137
|
DummyService.new.fail!("ERRORS", on_validation: "ON VALIDATION")
|
|
135
138
|
end
|
|
136
139
|
end
|
|
137
|
-
end
|
|
140
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ballast
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shogun
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-12-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|