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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecdde9c5629a65f454e68bb548e593ca89a5b0b5
4
- data.tar.gz: 668305f0091b468349264a9ca2d278269597ff95
3
+ metadata.gz: b18a95595ad709d6f90b6be38c8eeef761e24e80
4
+ data.tar.gz: ce04420589eb159fa123d5ef257cbf621213f4f4
5
5
  SHA512:
6
- metadata.gz: 2e22a29578b16b06931c69bcff6a235b0fefba8a5f936cccd27fb87960a3e936e2888761ff2d28bf2c928a771eb22000eb197a4da96c0c02a539f0b31f777322
7
- data.tar.gz: 7e206a258a7a3e6f5a2af8c36160f892aaa4d0f8fe1c68386accf1f9dabd033d165840731ed34547255525ff4d9c8cf2bd4e0ce419760ad90bd048e8a6702d91
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.to_json]]
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
@@ -1,3 +1,3 @@
1
1
  module BatchApi
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch_api2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Koppel, Arvind, Sandhiya