rack-json-pretty-print 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rack/json_pretty_print.rb +7 -3
- data/lib/rack/json_pretty_print/version.rb +1 -1
- data/rack-json-pretty-print.gemspec +2 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2E0MjM0YzhlYjgzZjA0Mjc3YzVhZWY1ODViNWE0ODQxMjNkY2Q4Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTc3YjEwNjI1M2JiYWUzZjUwZmI3NzZhNDYwZWE4Y2Y0Njg1ZjA3OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjU5ZTU0ZDVhZWIzMmU3OTlkZjBkNDZhYWZlMzZiZDlhZWIxZGQ2ZTNlMWY1
|
10
|
+
YTQ2MzhmZDU1NDc3OWUwZTM1MTcxNmY2NzA1MjdlMTkwMmY3YjMzMWY4OGQy
|
11
|
+
ODk1MDQyMTVlN2VmNDNiMWNmYWU1OTI0MTBlN2ExZGRlOTVmZDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDkzODZmMGViNTVhNzVmNmJhNGFmNzVhN2VkZTQ4OGU0Y2JlYmM2NzE3ZTBj
|
14
|
+
ZGQ1YWE4MmQ2YzMxZWUyOGFhNzQ3MGQyYWNmZmE1MTBhZjVmYWI2YjEwYWFk
|
15
|
+
MzcyNTc1NjYwN2UwZjg0YTBhNDNhZGI1M2Q3ZWY3OWMxMDAwM2Y=
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require 'rack/utils'
|
2
|
+
require 'rack/json_pretty_print/version'
|
2
3
|
|
3
4
|
module Rack
|
4
5
|
class JSONPrettyPrint
|
@@ -13,8 +14,11 @@ module Rack
|
|
13
14
|
if qs.split('&').include?('pretty=1')
|
14
15
|
json = []
|
15
16
|
response[2].each { |str| json << str }
|
16
|
-
response[2].close if response[2].respond_to?
|
17
|
-
|
17
|
+
response[2].close if response[2].respond_to?(:close) # Rack::Lock
|
18
|
+
|
19
|
+
json_prettified = pretty_json(json.join)
|
20
|
+
response[1]['Content-Length'] = Rack::Utils.bytesize(json_prettified).to_s
|
21
|
+
response[2] = [json_prettified]
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_dependency "rack", ">= 1.0.0"
|
22
|
+
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
24
|
spec.add_development_dependency "rake"
|
23
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calvin Yu
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|