esi-sdk 2.1.1 → 2.1.2
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 +4 -4
- data/.github/workflows/{cicd.yml → build.yml} +1 -1
- data/CHANGELOG.md +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/esi/client.rb +36 -31
- data/lib/esi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7c874338d7aa0d467285e375390a6b185c184d9e5882a7f2ca519411b76e6df
|
4
|
+
data.tar.gz: 80b17cc143a6e5479005498a6351adccec57a997ac405138677beeb6dc10789e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50b8969549d4f8a8cb866725f46e058cd761072da6024a781469d95123e5a84bdcd981f77d4fe636b575ec333c08cfe6db95c78b5374c44df8a58a1db96bd9f
|
7
|
+
data.tar.gz: d8ca8eeba8e76b7c7915edd7703ca4a57046ccb54fa520384239331dc7a26ee2dd8c0604659acad2b184348589a9650d7e2be5e35eb8ff6227532bac7d25ea09
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ESI SDK Changelog
|
2
2
|
|
3
|
+
## [2.1.2](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.1.1...v2.1.2) (2021-10-09)
|
4
|
+
|
3
5
|
## [2.1.1](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.1.0...v2.1.1) (2021-10-09)
|
4
6
|
|
5
7
|
# [2.1.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.0.0...v2.1.0) (2021-10-09)
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
](https://github.com/bokoboshahni/esi-sdk-ruby/actions/workflows/build.yml)
|
2
|
+
[](https://badge.fury.io/rb/esi-sdk)
|
2
3
|
|
3
4
|
# EVE Swagger Interface (ESI) SDK
|
4
5
|
|
data/lib/esi/client.rb
CHANGED
@@ -123,53 +123,58 @@ module ESI
|
|
123
123
|
session.authentication token
|
124
124
|
end
|
125
125
|
|
126
|
+
# Make a `DELETE` request to the ESI endpoint.
|
127
|
+
#
|
128
|
+
# @param path [String] The request path, excluding version like `latest`.
|
129
|
+
# @param params [Hash] Query string parameters to pass to the request.
|
130
|
+
# @param headers [Hash] Headers to pass to the request.
|
126
131
|
def delete(path, params: {}, headers: {})
|
127
|
-
params
|
128
|
-
response = session.delete("/#{version}#{path}", params: params, headers: headers)
|
129
|
-
response.raise_for_status
|
130
|
-
response
|
131
|
-
rescue HTTPX::Error
|
132
|
-
raise_error(response)
|
132
|
+
make_request(:delete, path, params: params, headers: headers)
|
133
133
|
end
|
134
134
|
|
135
|
+
# Make a `GET` request to the ESI endpoint.
|
136
|
+
#
|
137
|
+
# @param path [String] The request path, excluding version like `latest`.
|
138
|
+
# @param params [Hash] Query string parameters to pass to the request.
|
139
|
+
# @param headers [Hash] Headers to pass to the request.
|
135
140
|
def get(path, params: {}, headers: {})
|
136
|
-
params
|
137
|
-
response = session.get("/#{version}#{path}", params: params, headers: headers)
|
138
|
-
response.raise_for_status
|
139
|
-
|
140
|
-
return paginate(response, "/#{version}#{path}", params, headers) if paginated?(response)
|
141
|
-
|
142
|
-
response
|
143
|
-
rescue HTTPX::Error
|
144
|
-
raise_error(response)
|
141
|
+
make_request(:get, path, params: params, headers: headers)
|
145
142
|
end
|
146
143
|
|
144
|
+
# Make a `POST` request to the ESI endpoint.
|
145
|
+
#
|
146
|
+
# @param path [String] The request path, excluding version like `latest`.
|
147
|
+
# @param params [Hash] Query string parameters to pass to the request.
|
148
|
+
# @param headers [Hash] Headers to pass to the request.
|
149
|
+
# @param payload [Hash] Payload to encode as JSON to pass to the request.
|
147
150
|
def post(path, payload: {}, params: {}, headers: {})
|
148
|
-
params
|
149
|
-
response = session.post("/#{version}#{path}",
|
150
|
-
params: params,
|
151
|
-
headers: headers,
|
152
|
-
json: payload)
|
153
|
-
response.raise_for_status
|
154
|
-
response
|
155
|
-
rescue HTTPX::Error
|
156
|
-
raise_error(response)
|
151
|
+
make_request(:post, path, params: params, headers: headers, payload: payload)
|
157
152
|
end
|
158
153
|
|
154
|
+
# Make a `PUT` request to the ESI endpoint.
|
155
|
+
#
|
156
|
+
# @param path [String] The request path, excluding version like `latest`.
|
157
|
+
# @param params [Hash] Query string parameters to pass to the request.
|
158
|
+
# @param headers [Hash] Headers to pass to the request.
|
159
|
+
# @param payload [Hash] Payload to encode as JSON to pass to the request.
|
159
160
|
def put(path, payload: {}, params: {}, headers: {})
|
160
|
-
params
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
161
|
+
make_request(:put, path, params: params, headers: headers, payload: payload)
|
162
|
+
end
|
163
|
+
|
164
|
+
private
|
165
|
+
|
166
|
+
def make_request(method, path, params: {}, headers: {}, payload: nil)
|
167
|
+
versioned_path = "/#{version}#{path}"
|
168
|
+
response = session.request(method, versioned_path, params: params, headers: headers, json: payload)
|
165
169
|
response.raise_for_status
|
170
|
+
|
171
|
+
return paginate(response, versioned_path, params, headers) if paginated?(response)
|
172
|
+
|
166
173
|
response
|
167
174
|
rescue HTTPX::Error
|
168
175
|
raise_error(response)
|
169
176
|
end
|
170
177
|
|
171
|
-
private
|
172
|
-
|
173
178
|
def paginate(response, path, params, headers) # rubocop:disable Metrics/MethodLength
|
174
179
|
response_headers = normalize_headers(response.headers)
|
175
180
|
page_count = response_headers["x-pages"].to_i
|
data/lib/esi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esi-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bokobo Shahni
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- ".github/ISSUE_TEMPLATE/support.md"
|
54
54
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
55
55
|
- ".github/dependabot.yml"
|
56
|
-
- ".github/workflows/
|
56
|
+
- ".github/workflows/build.yml"
|
57
57
|
- ".gitignore"
|
58
58
|
- ".rspec"
|
59
59
|
- ".rubocop.yml"
|