esplanade 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/gempush.yml +28 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/.travis.yml +5 -2
- data/CHANGELOG.md +6 -0
- data/esplanade.gemspec +6 -6
- data/lib/esplanade/request/doc.rb +2 -2
- data/lib/esplanade/request/raw/body.rb +1 -1
- data/lib/esplanade/request/validation.rb +2 -2
- data/lib/esplanade/response/doc.rb +1 -1
- data/lib/esplanade/response/raw/body.rb +3 -3
- data/lib/esplanade/response/validation.rb +1 -1
- data/lib/esplanade/version.rb +1 -1
- metadata +22 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a3373c627cdf10a0e2f896e87f1d35ac03f54e35633a405feb2948e550ed8a1c
|
4
|
+
data.tar.gz: f264e61df01786b3d14ecb9771691c330b6e028ddba7e2067e0a73b2fbfbace5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffa353a02394d3bafe0d2197932b3e1243bed4dd2fe11c47cc7a235f733db739c00fa698bdb9f689624fd1064c24f0af2c74a2ff26b31dbe6c4eb7e359e4cb13
|
7
|
+
data.tar.gz: b9a19774d5bdd62d65854525b1a8606bc4babb0cd1eb02ffcb0737c5e12f05f72e0c81fb60866fcb86e5db5e5cebad9f7849aab75a520aec3a8176feacd06812
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
name: Build + Publish
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby 2.6
|
17
|
+
uses: actions/setup-ruby@v1
|
18
|
+
|
19
|
+
- name: Publish to RubyGems
|
20
|
+
run: |
|
21
|
+
mkdir -p $HOME/.gem
|
22
|
+
touch $HOME/.gem/credentials
|
23
|
+
chmod 0600 $HOME/.gem/credentials
|
24
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
25
|
+
gem build *.gemspec
|
26
|
+
gem push *.gem
|
27
|
+
env:
|
28
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.2.0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/esplanade.gemspec
CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_runtime_dependency 'json-schema', '~> 2.6', '>= 2.6.2'
|
20
20
|
spec.add_runtime_dependency 'multi_json', '~> 1.11', '>= 1.11.1'
|
21
21
|
spec.add_runtime_dependency 'tomograph', '~> 2.0', '>= 2.0.0'
|
22
|
-
spec.add_development_dependency '
|
23
|
-
spec.add_development_dependency '
|
24
|
-
spec.add_development_dependency '
|
25
|
-
spec.add_development_dependency '
|
26
|
-
spec.add_development_dependency '
|
27
|
-
spec.
|
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'
|
27
|
+
spec.required_ruby_version = '>= 2.4.0'
|
28
28
|
end
|
@@ -7,14 +7,14 @@ module Esplanade
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def tomogram
|
10
|
-
raise PrefixNotMatch
|
10
|
+
raise PrefixNotMatch.new(**message) unless @main_documentation.prefix_match?(@raw.path)
|
11
11
|
|
12
12
|
@tomogram = @main_documentation.find_request_with_content_type(
|
13
13
|
method: @raw.method,
|
14
14
|
path: @raw.path,
|
15
15
|
content_type: @raw.content_type
|
16
16
|
)
|
17
|
-
raise NotDocumented
|
17
|
+
raise NotDocumented.new(**message) if @tomogram.nil?
|
18
18
|
|
19
19
|
@tomogram
|
20
20
|
end
|
@@ -10,11 +10,11 @@ module Esplanade
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def valid!
|
13
|
-
raise ContentTypeIsNotJson
|
13
|
+
raise ContentTypeIsNotJson.new(**mini_message) unless @doc.content_type == 'application/json'
|
14
14
|
|
15
15
|
@error ||= JSON::Validator.fully_validate(@doc.json_schema, @raw.body.to_hash)
|
16
16
|
|
17
|
-
raise Invalid
|
17
|
+
raise Invalid.new(**message) unless @error.empty?
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -11,14 +11,14 @@ module Esplanade
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def to_string
|
14
|
-
@
|
15
|
-
@
|
14
|
+
@to_string ||= @raw_body.body rescue nil
|
15
|
+
@to_string ||= @raw_body.first rescue nil
|
16
16
|
end
|
17
17
|
|
18
18
|
def to_hash
|
19
19
|
@hash ||= MultiJson.load(to_string)
|
20
20
|
rescue MultiJson::ParseError
|
21
|
-
raise BodyIsNotJson
|
21
|
+
raise BodyIsNotJson.new(**message)
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
data/lib/esplanade/version.rb
CHANGED
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.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- d.efimov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|
@@ -70,114 +70,94 @@ dependencies:
|
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 2.0.0
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: bundler
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '1.12'
|
80
|
-
type: :development
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '1.12'
|
87
73
|
- !ruby/object:Gem::Dependency
|
88
74
|
name: byebug
|
89
75
|
requirement: !ruby/object:Gem::Requirement
|
90
76
|
requirements:
|
91
|
-
- - "~>"
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '8.2'
|
94
77
|
- - ">="
|
95
78
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
79
|
+
version: 10.0.0
|
97
80
|
type: :development
|
98
81
|
prerelease: false
|
99
82
|
version_requirements: !ruby/object:Gem::Requirement
|
100
83
|
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '8.2'
|
104
84
|
- - ">="
|
105
85
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
86
|
+
version: 10.0.0
|
107
87
|
- !ruby/object:Gem::Dependency
|
108
88
|
name: rake
|
109
89
|
requirement: !ruby/object:Gem::Requirement
|
110
90
|
requirements:
|
111
91
|
- - "~>"
|
112
92
|
- !ruby/object:Gem::Version
|
113
|
-
version: '
|
93
|
+
version: '13'
|
114
94
|
type: :development
|
115
95
|
prerelease: false
|
116
96
|
version_requirements: !ruby/object:Gem::Requirement
|
117
97
|
requirements:
|
118
98
|
- - "~>"
|
119
99
|
- !ruby/object:Gem::Version
|
120
|
-
version: '
|
100
|
+
version: '13'
|
121
101
|
- !ruby/object:Gem::Dependency
|
122
102
|
name: rspec
|
123
103
|
requirement: !ruby/object:Gem::Requirement
|
124
104
|
requirements:
|
125
105
|
- - "~>"
|
126
106
|
- !ruby/object:Gem::Version
|
127
|
-
version: '3.
|
107
|
+
version: '3.9'
|
128
108
|
- - ">="
|
129
109
|
- !ruby/object:Gem::Version
|
130
|
-
version: 3.
|
110
|
+
version: 3.9.0
|
131
111
|
type: :development
|
132
112
|
prerelease: false
|
133
113
|
version_requirements: !ruby/object:Gem::Requirement
|
134
114
|
requirements:
|
135
115
|
- - "~>"
|
136
116
|
- !ruby/object:Gem::Version
|
137
|
-
version: '3.
|
117
|
+
version: '3.9'
|
138
118
|
- - ">="
|
139
119
|
- !ruby/object:Gem::Version
|
140
|
-
version: 3.
|
120
|
+
version: 3.9.0
|
141
121
|
- !ruby/object:Gem::Dependency
|
142
122
|
name: rubocop
|
143
123
|
requirement: !ruby/object:Gem::Requirement
|
144
124
|
requirements:
|
145
125
|
- - "~>"
|
146
126
|
- !ruby/object:Gem::Version
|
147
|
-
version: '0.
|
127
|
+
version: '0.81'
|
148
128
|
- - ">="
|
149
129
|
- !ruby/object:Gem::Version
|
150
|
-
version: 0.
|
130
|
+
version: 0.81.0
|
151
131
|
type: :development
|
152
132
|
prerelease: false
|
153
133
|
version_requirements: !ruby/object:Gem::Requirement
|
154
134
|
requirements:
|
155
135
|
- - "~>"
|
156
136
|
- !ruby/object:Gem::Version
|
157
|
-
version: '0.
|
137
|
+
version: '0.81'
|
158
138
|
- - ">="
|
159
139
|
- !ruby/object:Gem::Version
|
160
|
-
version: 0.
|
140
|
+
version: 0.81.0
|
161
141
|
- !ruby/object:Gem::Dependency
|
162
142
|
name: simplecov
|
163
143
|
requirement: !ruby/object:Gem::Requirement
|
164
144
|
requirements:
|
165
145
|
- - "~>"
|
166
146
|
- !ruby/object:Gem::Version
|
167
|
-
version: '0.
|
147
|
+
version: '0.18'
|
168
148
|
- - ">="
|
169
149
|
- !ruby/object:Gem::Version
|
170
|
-
version: 0.
|
150
|
+
version: '0.18'
|
171
151
|
type: :development
|
172
152
|
prerelease: false
|
173
153
|
version_requirements: !ruby/object:Gem::Requirement
|
174
154
|
requirements:
|
175
155
|
- - "~>"
|
176
156
|
- !ruby/object:Gem::Version
|
177
|
-
version: '0.
|
157
|
+
version: '0.18'
|
178
158
|
- - ">="
|
179
159
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
160
|
+
version: '0.18'
|
181
161
|
description:
|
182
162
|
email:
|
183
163
|
- d.efimov@fun-box.ru
|
@@ -185,9 +165,11 @@ executables: []
|
|
185
165
|
extensions: []
|
186
166
|
extra_rdoc_files: []
|
187
167
|
files:
|
168
|
+
- ".github/workflows/gempush.yml"
|
188
169
|
- ".gitignore"
|
189
170
|
- ".rubocop.yml"
|
190
171
|
- ".ruby-version"
|
172
|
+
- ".tool-versions"
|
191
173
|
- ".travis.yml"
|
192
174
|
- CHANGELOG.md
|
193
175
|
- CODE_OF_CONDUCT.md
|
@@ -230,15 +212,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
212
|
requirements:
|
231
213
|
- - ">="
|
232
214
|
- !ruby/object:Gem::Version
|
233
|
-
version:
|
215
|
+
version: 2.4.0
|
234
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
217
|
requirements:
|
236
218
|
- - ">="
|
237
219
|
- !ruby/object:Gem::Version
|
238
220
|
version: '0'
|
239
221
|
requirements: []
|
240
|
-
|
241
|
-
rubygems_version: 2.4.5
|
222
|
+
rubygems_version: 3.1.2
|
242
223
|
signing_key:
|
243
224
|
specification_version: 4
|
244
225
|
summary: Validate requests and responses against API Blueprint specifications
|