rack-json-pretty-print 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2E0MjM0YzhlYjgzZjA0Mjc3YzVhZWY1ODViNWE0ODQxMjNkY2Q4Yg==
4
+ MThmM2Q1ZTNiNWRjMWYyNWFkOGYyMDAxZGQ4YmJkNmQ3OWJkYWU2ZA==
5
5
  data.tar.gz: !binary |-
6
- ZTc3YjEwNjI1M2JiYWUzZjUwZmI3NzZhNDYwZWE4Y2Y0Njg1ZjA3OA==
6
+ NzNjNGNmMzVlYWNhNGEyMGJkMDk0NjUwODc3YjViMjg5MDJhZWY4Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjU5ZTU0ZDVhZWIzMmU3OTlkZjBkNDZhYWZlMzZiZDlhZWIxZGQ2ZTNlMWY1
10
- YTQ2MzhmZDU1NDc3OWUwZTM1MTcxNmY2NzA1MjdlMTkwMmY3YjMzMWY4OGQy
11
- ODk1MDQyMTVlN2VmNDNiMWNmYWU1OTI0MTBlN2ExZGRlOTVmZDY=
9
+ MzRlYzMwY2E4ODExZjdmNGRhMGQ3MDgyNjFjYjlhZTczYjFlYmMzODRlMTVk
10
+ Y2FlYTU2YzdhZTBlYmVlYjc1NDEzZDA5ODg5OTFkYzRlNTk0ODgxODg1NjVj
11
+ YjRhZGM5MmY1MmIyNTJiMTMyMDUzMDRiMDk5NDYyODk4NGIxOTE=
12
12
  data.tar.gz: !binary |-
13
- NDkzODZmMGViNTVhNzVmNmJhNGFmNzVhN2VkZTQ4OGU0Y2JlYmM2NzE3ZTBj
14
- ZGQ1YWE4MmQ2YzMxZWUyOGFhNzQ3MGQyYWNmZmE1MTBhZjVmYWI2YjEwYWFk
15
- MzcyNTc1NjYwN2UwZjg0YTBhNDNhZGI1M2Q3ZWY3OWMxMDAwM2Y=
13
+ M2I2OGQ0YmQxY2FlOTI5ZTE4MWRjNDE4NjAwZDA1ZmNmNzI2MzliYmE2NGIy
14
+ ZDE4MTY1OTQ3ZjllMzMwYWQyODBmYWU5NjlmMDk2Y2IwOWRmOTM4MTU5NTIy
15
+ NmM0NTY2Y2M1YjQ4ZTBmMjVjN2IxNjY5NTNmYTc3ODA3ZmI2Y2Q=
@@ -0,0 +1,15 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## 0.0.2 - 2014-08-29
5
+ ### Changed
6
+ - Change JSON library preference to Yajl, Json, and MultiJson last. MultiJson's pretty printing doesn't seem to be very robust.
7
+
8
+ ## 0.0.2 - 2014-08-29
9
+ ### Added
10
+ - Set Content-Length header
11
+
12
+ ## 0.0.1 - 2014-08-29
13
+ ### Added
14
+ - Initial release
15
+
@@ -26,16 +26,16 @@ module Rack
26
26
  end
27
27
 
28
28
  def pretty_json(json)
29
- if defined? MultiJson
30
- hash = MultiJson.load(json)
31
- MultiJson.dump(hash, :pretty => true)
32
- elsif defined? Yajl
29
+ if defined? Yajl
33
30
  parser = Yajl::Parser.new
34
31
  hash = parser.parse(json)
35
32
  Yajl::Encoder.encode(hash, :pretty => true)
36
33
  elsif defined? JSON
37
34
  hash = JSON.parse(json)
38
35
  JSON.pretty_generate(hash)
36
+ elsif defined? MultiJson
37
+ hash = MultiJson.load(json)
38
+ MultiJson.dump(hash, :pretty => true)
39
39
  else
40
40
  json
41
41
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class JSONPrettyPrint
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json-pretty-print
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
  - Calvin Yu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -61,6 +61,7 @@ extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
63
  - .gitignore
64
+ - CHANGELOG.md
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md