rack-json-pretty-print 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 +8 -8
- data/CHANGELOG.md +15 -0
- data/lib/rack/json_pretty_print.rb +4 -4
- data/lib/rack/json_pretty_print/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MThmM2Q1ZTNiNWRjMWYyNWFkOGYyMDAxZGQ4YmJkNmQ3OWJkYWU2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzNjNGNmMzVlYWNhNGEyMGJkMDk0NjUwODc3YjViMjg5MDJhZWY4Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzRlYzMwY2E4ODExZjdmNGRhMGQ3MDgyNjFjYjlhZTczYjFlYmMzODRlMTVk
|
10
|
+
Y2FlYTU2YzdhZTBlYmVlYjc1NDEzZDA5ODg5OTFkYzRlNTk0ODgxODg1NjVj
|
11
|
+
YjRhZGM5MmY1MmIyNTJiMTMyMDUzMDRiMDk5NDYyODk4NGIxOTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2I2OGQ0YmQxY2FlOTI5ZTE4MWRjNDE4NjAwZDA1ZmNmNzI2MzliYmE2NGIy
|
14
|
+
ZDE4MTY1OTQ3ZjllMzMwYWQyODBmYWU5NjlmMDk2Y2IwOWRmOTM4MTU5NTIy
|
15
|
+
NmM0NTY2Y2M1YjQ4ZTBmMjVjN2IxNjY5NTNmYTc3ODA3ZmI2Y2Q=
|
data/CHANGELOG.md
ADDED
@@ -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?
|
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
|
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.
|
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-
|
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
|