esplanade 1.7.1 → 1.8.0

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
  SHA256:
3
- metadata.gz: 1709500c684e2cd5fb6c0c86445bd413e46ed575e191f5e1557c85680b3b118b
4
- data.tar.gz: b7aa44c92516981b0f0433378b6b526e48656198782cd8c7fed0d2147a902249
3
+ metadata.gz: 6ffb0698e7cf24ebc36233050d09fd554687ce58d52e7bd7ca22cdccb13d005a
4
+ data.tar.gz: a70a122a41e29e8c7124cea908110340440702af5da52b6e41a32d73348214b2
5
5
  SHA512:
6
- metadata.gz: f4372ec2e97839ea3dee256282954c5a5b8540eaa592afa37ab976ef0dff7da7d49357318e292d7aa834ba27f1593b659cf589d159f1ca6e17c6bae1d13bc053
7
- data.tar.gz: 3a59d0192b6d4bef73e5c239deb16dff6b4fe96eb4b353d67edbf72b645c4084aac0c5d0175e3482c01368023540166939997219b3cbde2a83b7f295dc554d3f
6
+ metadata.gz: 3ee7a3176c117d301dd0bc96bd460ae23fba1a052d371a8a0be9ce4d7f70f6234c9047fb07835573e6a1444bbc91069ed62b1972899d2e1619dfb84a09a9749a
7
+ data.tar.gz: 06dc2239fa3d97135ffcc6046fbd9b7fb2581ba8ba15e93c56df3caca5777856037a5a638118a03f86e9c43fb76257c43fcf0695ab6aaf9f65bbd5fd4c04005e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ### 1.8.0 - 2021-09-29
4
+
5
+ * patch
6
+ * remove multi_json
7
+
3
8
  ### 1.7.1 - 2021-02-10
4
9
 
5
10
  * setting
data/README.md CHANGED
@@ -167,20 +167,6 @@ Error message format:
167
167
 
168
168
  Parent class for those described below. Inherited from `Esplanade::Error`.
169
169
 
170
- #### Esplanade::Response::PrefixNotMatch
171
-
172
- Error message format:
173
-
174
- ```ruby
175
- {
176
- :request => {
177
- :method => "method",
178
- :path => "path"
179
- },
180
- :status => "status"
181
- }
182
- ```
183
-
184
170
  #### Esplanade::Response::NotDocumented
185
171
 
186
172
  Error message format:
data/esplanade.gemspec CHANGED
@@ -17,12 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ['lib']
18
18
 
19
19
  spec.add_runtime_dependency 'json-schema', '~> 2.6', '>= 2.6.2'
20
- spec.add_runtime_dependency 'multi_json', '~> 1.11', '>= 1.11.1'
21
20
  spec.add_runtime_dependency 'tomograph', '~> 3.1', '>= 3.1.0'
22
- spec.add_development_dependency 'byebug', '>= 10.0.0'
23
- spec.add_development_dependency 'rake', '~> 13'
24
- spec.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
25
- spec.add_development_dependency 'rubocop', '~> 0.81', '>= 0.81.0'
26
- spec.add_development_dependency 'simplecov', '~> 0.18', '>= 0.18'
21
+ spec.add_development_dependency 'byebug', '~> 11.1', '>= 11.1.3'
22
+ spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
23
+ spec.add_development_dependency 'rspec', '~> 3.10'
24
+ spec.add_development_dependency 'rubocop', '~> 1.22.0'
25
+ spec.add_development_dependency 'simplecov', '~> 0.21'
27
26
  spec.required_ruby_version = '>= 2.4.0'
28
27
  end
@@ -1,5 +1,3 @@
1
- require 'multi_json'
2
-
3
1
  module Esplanade
4
2
  class Request
5
3
  class Raw
@@ -18,8 +16,8 @@ module Esplanade
18
16
  end
19
17
 
20
18
  def to_hash
21
- @hash ||= MultiJson.load(to_string)
22
- rescue MultiJson::ParseError
19
+ @hash ||= JSON.parse(to_string.to_s)
20
+ rescue JSON::ParserError
23
21
  raise BodyIsNotJson.new(**message)
24
22
  end
25
23
 
@@ -32,10 +32,10 @@ module Esplanade
32
32
  res = JSON::Validator.fully_validate(json_schema, @raw.body.to_hash)
33
33
  break res if res == []
34
34
  end
35
- if main_res != []
36
- ['invalid']
37
- else
35
+ if main_res == []
38
36
  []
37
+ else
38
+ ['invalid']
39
39
  end
40
40
  end
41
41
 
@@ -11,8 +11,6 @@ module Esplanade
11
11
  raise NotDocumented.new(**message) if @tomogram == []
12
12
 
13
13
  @tomogram
14
- rescue Esplanade::Request::PrefixNotMatch
15
- raise PrefixNotMatch.new(**message)
16
14
  end
17
15
 
18
16
  def json_schemas
@@ -2,8 +2,6 @@ module Esplanade
2
2
  class Response
3
3
  class Error < Esplanade::Error; end
4
4
 
5
- class PrefixNotMatch < Error; end
6
-
7
5
  class NotDocumented < Error
8
6
  def initialize(request:, status:)
9
7
  @method = request[:method]
@@ -1,5 +1,3 @@
1
- require 'multi_json'
2
-
3
1
  module Esplanade
4
2
  class Response
5
3
  class Raw
@@ -16,8 +14,8 @@ module Esplanade
16
14
  end
17
15
 
18
16
  def to_hash
19
- @hash ||= MultiJson.load(to_string)
20
- rescue MultiJson::ParseError
17
+ @hash ||= JSON.parse(to_string)
18
+ rescue JSON::ParserError
21
19
  raise BodyIsNotJson.new(**message)
22
20
  end
23
21
 
@@ -29,10 +29,10 @@ module Esplanade
29
29
  res = JSON::Validator.fully_validate(json_schema, @raw.body.to_hash)
30
30
  break res if res == []
31
31
  end
32
- if main_res != []
33
- ['invalid']
34
- else
32
+ if main_res == []
35
33
  []
34
+ else
35
+ ['invalid']
36
36
  end
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module Esplanade
2
- VERSION = '1.7.1'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esplanade
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.efimov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -30,26 +30,6 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.6.2
33
- - !ruby/object:Gem::Dependency
34
- name: multi_json
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.11'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 1.11.1
43
- type: :runtime
44
- prerelease: false
45
- version_requirements: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '1.11'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 1.11.1
53
33
  - !ruby/object:Gem::Dependency
54
34
  name: tomograph
55
35
  requirement: !ruby/object:Gem::Requirement
@@ -74,91 +54,85 @@ dependencies:
74
54
  name: byebug
75
55
  requirement: !ruby/object:Gem::Requirement
76
56
  requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '11.1'
77
60
  - - ">="
78
61
  - !ruby/object:Gem::Version
79
- version: 10.0.0
62
+ version: 11.1.3
80
63
  type: :development
81
64
  prerelease: false
82
65
  version_requirements: !ruby/object:Gem::Requirement
83
66
  requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '11.1'
84
70
  - - ">="
85
71
  - !ruby/object:Gem::Version
86
- version: 10.0.0
72
+ version: 11.1.3
87
73
  - !ruby/object:Gem::Dependency
88
74
  name: rake
89
75
  requirement: !ruby/object:Gem::Requirement
90
76
  requirements:
91
77
  - - "~>"
92
78
  - !ruby/object:Gem::Version
93
- version: '13'
79
+ version: '13.0'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 13.0.6
94
83
  type: :development
95
84
  prerelease: false
96
85
  version_requirements: !ruby/object:Gem::Requirement
97
86
  requirements:
98
87
  - - "~>"
99
88
  - !ruby/object:Gem::Version
100
- version: '13'
89
+ version: '13.0'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 13.0.6
101
93
  - !ruby/object:Gem::Dependency
102
94
  name: rspec
103
95
  requirement: !ruby/object:Gem::Requirement
104
96
  requirements:
105
97
  - - "~>"
106
98
  - !ruby/object:Gem::Version
107
- version: '3.9'
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: 3.9.0
99
+ version: '3.10'
111
100
  type: :development
112
101
  prerelease: false
113
102
  version_requirements: !ruby/object:Gem::Requirement
114
103
  requirements:
115
104
  - - "~>"
116
105
  - !ruby/object:Gem::Version
117
- version: '3.9'
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- version: 3.9.0
106
+ version: '3.10'
121
107
  - !ruby/object:Gem::Dependency
122
108
  name: rubocop
123
109
  requirement: !ruby/object:Gem::Requirement
124
110
  requirements:
125
111
  - - "~>"
126
112
  - !ruby/object:Gem::Version
127
- version: '0.81'
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: 0.81.0
113
+ version: 1.22.0
131
114
  type: :development
132
115
  prerelease: false
133
116
  version_requirements: !ruby/object:Gem::Requirement
134
117
  requirements:
135
118
  - - "~>"
136
119
  - !ruby/object:Gem::Version
137
- version: '0.81'
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: 0.81.0
120
+ version: 1.22.0
141
121
  - !ruby/object:Gem::Dependency
142
122
  name: simplecov
143
123
  requirement: !ruby/object:Gem::Requirement
144
124
  requirements:
145
125
  - - "~>"
146
126
  - !ruby/object:Gem::Version
147
- version: '0.18'
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- version: '0.18'
127
+ version: '0.21'
151
128
  type: :development
152
129
  prerelease: false
153
130
  version_requirements: !ruby/object:Gem::Requirement
154
131
  requirements:
155
132
  - - "~>"
156
133
  - !ruby/object:Gem::Version
157
- version: '0.18'
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: '0.18'
161
- description:
134
+ version: '0.21'
135
+ description:
162
136
  email:
163
137
  - d.efimov@fun-box.ru
164
138
  executables: []
@@ -199,11 +173,11 @@ files:
199
173
  - lib/esplanade/response/raw/body.rb
200
174
  - lib/esplanade/response/validation.rb
201
175
  - lib/esplanade/version.rb
202
- homepage:
176
+ homepage:
203
177
  licenses:
204
178
  - MIT
205
179
  metadata: {}
206
- post_install_message:
180
+ post_install_message:
207
181
  rdoc_options: []
208
182
  require_paths:
209
183
  - lib
@@ -219,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
193
  version: '0'
220
194
  requirements: []
221
195
  rubygems_version: 3.1.2
222
- signing_key:
196
+ signing_key:
223
197
  specification_version: 4
224
198
  summary: Validate requests and responses against API Blueprint specifications
225
199
  test_files: []