rack-mongoid_adapter 0.0.2 → 0.0.3

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: 102e4ece3407cbf13e0b951505d9bc0fc0befb28
4
- data.tar.gz: 495da19c17ef093f7e1c87984647e5c6b4291547
3
+ metadata.gz: 7005071dc97f96b8543e2c017df2dd3a68cf4b8a
4
+ data.tar.gz: d8ee3bb1e897a20708b1a5b23385d47bea611193
5
5
  SHA512:
6
- metadata.gz: 1315d24bba545128f170ce477ebf72f4f43a18a59ba80200e6fb982ee9e273e21844fdba04ea639210448cba11ad5a7c7440621b441f2852cc99e07e8cf5e3a0
7
- data.tar.gz: 8dd54c5e31c9508a5702ac1264766d7fcdadc86067fcfd7d3611329e6b3814f63984d130b8830da31db9059ac15680b3027b5c0cd6f08f41ad3e6fc335f67fd4
6
+ metadata.gz: 6efb9623cda2e68100b79080de6745a443eaba7c94d6d47f6e30675c82b22096c888d9568ec889aabb24ae3574c6f03c0c2ee50be4527bb9015d8293086d3435
7
+ data.tar.gz: e58a7ba3cb44c5db34907a13804b05f2ba06e297e9010f2c3a0870c155e9e0aef1a828424ae2a20e49eb16a9a6e861bb751ff6b2504be253db718ee28a8e8e46
@@ -1,3 +1,6 @@
1
+ ## 0.0.3
2
+ * Return prettified JSON response
3
+
1
4
  ## 0.0.2
2
5
  * Accepts JSON request body on POST and PUT request
3
6
  * Return response body on PUT and DELETE request
@@ -33,7 +33,7 @@ module Rack
33
33
  end
34
34
 
35
35
  def response_body_for_not_found
36
- { message: "Not found" }.to_json
36
+ JSON.pretty_generate(message: "Not found", pretty: true) + "\n"
37
37
  end
38
38
 
39
39
  def request
@@ -11,7 +11,7 @@ module Rack
11
11
  def response_body
12
12
  attributes = params.merge(_id: BSON::ObjectId.new.to_s)
13
13
  connection.insert(attributes)
14
- attributes.to_json
14
+ JSON.pretty_generate(attributes, pretty: true) + "\n"
15
15
  end
16
16
  end
17
17
  end
@@ -13,7 +13,7 @@ module Rack
13
13
  def response_body
14
14
  if resource
15
15
  connection.find(_id: id).remove
16
- resource.to_json
16
+ JSON.pretty_generate(resource, pretty: true) + "\n"
17
17
  else
18
18
  response_body_for_not_found
19
19
  end
@@ -5,7 +5,7 @@ module Rack
5
5
  private
6
6
 
7
7
  def response_body
8
- connection.find.to_a.to_json
8
+ JSON.pretty_generate(connection.find.to_a, pretty: true) + "\n"
9
9
  end
10
10
  end
11
11
  end
@@ -14,7 +14,7 @@ module Rack
14
14
 
15
15
  def response_body
16
16
  if resource
17
- resource.to_json
17
+ JSON.pretty_generate(resource, pretty: true) + "\n"
18
18
  else
19
19
  response_body_for_not_found
20
20
  end
@@ -16,7 +16,7 @@ module Rack
16
16
  if resource
17
17
  attributes = resource.merge(params)
18
18
  connection.find(_id: id).update(attributes)
19
- attributes.to_json
19
+ JSON.pretty_generate(attributes, pretty: true) + "\n"
20
20
  else
21
21
  response_body_for_not_found
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MongoidAdapter
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-mongoid_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura