rack-json_schema 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13b64aeff3cae973d98aaf8f50c868a8b2223318
4
- data.tar.gz: 30059b1a8a875156c441daf348cfe4ec245309dc
3
+ metadata.gz: 5e80c53d0d282d68127eb359e681eff4c2d44c66
4
+ data.tar.gz: 2f7c3a9358f5bd61050d46659d78303875650122
5
5
  SHA512:
6
- metadata.gz: a3b043a0df3ae347ac84a03ab87bc843b76479dde93ad7f479752e34609e0ff0658cd2e1e6e9ddce0c16b139ff60144a4f24f1613e00f4e9d03f6481332a1374
7
- data.tar.gz: 960189e3f983e32e73376a518a7cedfa53e1ec9479d9829c2a8b25a3b184cced50f3d7ae8a4f4e5a636c26179e1cf8dc721b09d96531df78ce024bda60bb0772
6
+ metadata.gz: 996a3985a0b8b7f9aef82b4d061c50e482cf1ec2fb5a9cf0bc8f1855ff1dd74478eba661a09140418c4d33403ed96377f1642437c4ae77c3578a62e8eba192bf
7
+ data.tar.gz: 9f719f845cbd9957cc6790beb8269092b249ab2c9fc711ee8a5235d13744c3637d6ca4e580fbdc1822b31355f6c6cb229b7d7026d97c76ec3b65734f2b117fb7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.0.3
2
+ * Remove dependency on multi_json
3
+
1
4
  ## 1.0.2
2
5
  * Bundled all middlewares into `specup` executable command
3
6
 
data/bin/specup CHANGED
@@ -16,7 +16,7 @@ case File.extname(path)
16
16
  when ".yml", ".yaml"
17
17
  schema = YAML.load(str)
18
18
  else
19
- schema = MultiJson.decode(str)
19
+ schema = JSON.parse(str)
20
20
  end
21
21
 
22
22
  app = Rack::Builder.new do
@@ -1,7 +1,6 @@
1
1
  require "jdoc"
2
2
  require "json"
3
3
  require "json_schema"
4
- require "multi_json"
5
4
  require "rack"
6
5
 
7
6
  require "rack/json_schema/base_request_handler"
@@ -23,7 +23,7 @@ module Rack
23
23
  end
24
24
 
25
25
  def body
26
- MultiJson.encode({ id: id, message: message }, pretty: true) + "\n"
26
+ JSON.pretty_generate(id: id, message: message) + "\n"
27
27
  end
28
28
  end
29
29
  end
@@ -49,7 +49,7 @@ module Rack
49
49
  def dummy_body
50
50
  document = ResponseGenerator.call(schema_for_current_link)
51
51
  document = [document] if has_list_data?
52
- MultiJson.encode(document, pretty: true) + "\n"
52
+ JSON.pretty_generate(document) + "\n"
53
53
  end
54
54
  end
55
55
 
@@ -50,7 +50,7 @@ module Rack
50
50
  def has_valid_json?
51
51
  parameters
52
52
  true
53
- rescue MultiJson::ParseError
53
+ rescue JSON::JSONError
54
54
  false
55
55
  end
56
56
 
@@ -108,11 +108,11 @@ module Rack
108
108
  end
109
109
 
110
110
  # @return [Hash] Request parameters decoded from JSON
111
- # @raise [MultiJson::ParseError]
111
+ # @raise [JSON::JSONError]
112
112
  def parameters
113
113
  @parameters ||= begin
114
114
  if has_body?
115
- MultiJson.decode(body)
115
+ JSON.parse(body)
116
116
  else
117
117
  {}
118
118
  end
@@ -62,7 +62,7 @@ module Rack
62
62
 
63
63
  # @return [Array, Hash] Response body data, decoded from JSON
64
64
  def data
65
- MultiJson.decode(body)
65
+ JSON.parse(body)
66
66
  end
67
67
 
68
68
  # @return [JsonSchema::Validator]
@@ -38,7 +38,7 @@ module Rack
38
38
 
39
39
  # @return [String] Rendered JSON Schema in JSON format
40
40
  def rendered_schema
41
- MultiJson.encode(@schema, pretty: true)
41
+ JSON.pretty_generate(@schema)
42
42
  end
43
43
  end
44
44
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module JsonSchema
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency "jdoc", ">= 0.0.3"
21
21
  spec.add_dependency "json_schema"
22
- spec.add_dependency "multi_json"
23
22
  spec.add_dependency "rack"
24
23
  spec.add_development_dependency "bundler", "~> 1.5"
25
24
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-08 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jdoc
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: multi_json
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rack
57
43
  requirement: !ruby/object:Gem::Requirement