batch_api2 0.3.1 → 0.3.2
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/lib/batch_api/error_wrapper.rb +3 -1
- data/lib/batch_api/rack_middleware.rb +3 -1
- data/lib/batch_api/version.rb +1 -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: b18a95595ad709d6f90b6be38c8eeef761e24e80
|
4
|
+
data.tar.gz: ce04420589eb159fa123d5ef257cbf621213f4f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a463e5746cf879da06be7e150817de1903bc9d7335d579f1b23fcff04b92aa2809f3eab6344a910d93caf242fdff9dd1a8398010ef4e579e2c39f431b76e914
|
7
|
+
data.tar.gz: 7117fe6d112e5518777722bbdd7a1f49ba80a3396d264af6f5e0e54b3711e3edd02d1110f33e1f3826a9602c5a6b2a9235406d46ecea2553f27a3f4a98c63bd7
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'multi_json'
|
2
|
+
|
1
3
|
module BatchApi
|
2
4
|
# Public: wrap an error thrown during a batch operation.
|
3
5
|
# This has a body class and a cookies accessor and can
|
@@ -27,7 +29,7 @@ module BatchApi
|
|
27
29
|
#
|
28
30
|
# Returns: an Array with the error body represented as JSON.
|
29
31
|
def render
|
30
|
-
[status_code, RackMiddleware.content_type, [body
|
32
|
+
[status_code, RackMiddleware.content_type, [MultiJson.dump(body)]]
|
31
33
|
end
|
32
34
|
|
33
35
|
# Public: the status code to return for the given error.
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'multi_json'
|
2
|
+
|
1
3
|
module BatchApi
|
2
4
|
class RackMiddleware
|
3
5
|
def initialize(app, &block)
|
@@ -10,7 +12,7 @@ module BatchApi
|
|
10
12
|
begin
|
11
13
|
request = request_klass.new(env)
|
12
14
|
result = BatchApi::Processor.new(request, @app).execute!
|
13
|
-
[200, self.class.content_type, [result]]
|
15
|
+
[200, self.class.content_type, [MultiJson.dump(result)]]
|
14
16
|
rescue => err
|
15
17
|
ErrorWrapper.new(err).render
|
16
18
|
end
|
data/lib/batch_api/version.rb
CHANGED