uc3-dmp-external-api 0.0.16 → 0.0.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8e39973a3b40b3db04e6c29f794882480c708a2a87d40b224bdaa1d0d77e196
4
- data.tar.gz: c6e41bb28b599435ff4181a2ddbddaad688c3cd02d2c3e20bb824c43bdf4050e
3
+ metadata.gz: 476dd02adf8b66b2cb0acf3a2f260e4b84b2c21c9450cd39263ca263d7847652
4
+ data.tar.gz: '0997e69f4e0030b3a62c9b1ebb42adb851add0892f800cbe8e3ec614e6bb340d'
5
5
  SHA512:
6
- metadata.gz: ddce47c28c5d53a8534f2a81bbb677ed2010ae8b9cd893ce3e10f61d26818a25aee7f3be22866f0d0fe2be30d01e3218b9094dba47c744c92a9732909a8695a4
7
- data.tar.gz: 2e12614a7d6e0511be963ad169203e458a15b6a3fcb32c92c054db5001f6b84658a42335ed7f96684dd887d29c4bf8050e61382b7c86435ff431b0f09f6c14e4
6
+ metadata.gz: e9df15ca00f7fdced900bb60e98ed2fe7515efe9475670a7a93fbed714201b457ec6177c57958c3fb3ff610dbec4822709773232f437f820e713c35275a88616
7
+ data.tar.gz: 8f880ba9e3719b92809627cffc3b956f65c0f1e339941584dcf794fc9caa7bff3825fabab5fe0c41a7f2a13e63172d57f599f0cb4353eed7fb2a3ad24c2b4821
@@ -17,27 +17,27 @@ module Uc3DmpExternalApi
17
17
 
18
18
  class << self
19
19
  # Call the specified URL using the specified HTTP method, body and headers
20
- # rubocop:disable Metrics/AbcSize
20
+ # rubocop:disable Metrics/AbcSize, Metrics/ParameterLists
21
21
  def call(url:, method: :get, body: '', basic_auth: {}, additional_headers: {}, logger: nil)
22
22
  uri = URI(url)
23
23
  # Skip the body if we are doing a get
24
24
  body = nil if method.to_sym == :get
25
- opts = _options(body: body, basic_auth: basic_auth, additional_headers: additional_headers, logger: logger)
25
+ opts = _options(body:, basic_auth:, additional_headers:, logger:)
26
26
  resp = HTTParty.send(method.to_sym, uri, opts)
27
27
 
28
- if ![200, 201].include?(resp.code)
28
+ unless [200, 201].include?(resp.code)
29
29
  msg = "status: #{resp&.code}, body: #{resp&.body}"
30
- raise ExternalApiError, "#{format(MSG_ERROR_FROM_EXTERNAL_API, url: url)} - #{msg}"
30
+ raise ExternalApiError, "#{format(MSG_ERROR_FROM_EXTERNAL_API, url:)} - #{msg}"
31
31
  end
32
- resp.body.nil? || resp.body.empty? ? nil : _process_response(resp: resp)
32
+ resp.body.nil? || resp.body.empty? ? nil : _process_response(resp:)
33
33
  rescue JSON::ParserError
34
- raise ExternalApiError, format(MSG_UNABLE_TO_PARSE, url: url)
34
+ raise ExternalApiError, format(MSG_UNABLE_TO_PARSE, url:)
35
35
  rescue HTTParty::Error => e
36
- raise ExternalApiError, "#{format(MSG_HTTPARTY_ERR, url: url)} - #{e.message}"
36
+ raise ExternalApiError, "#{format(MSG_HTTPARTY_ERR, url:)} - #{e.message}"
37
37
  rescue URI::InvalidURIError
38
- raise ExternalApiError, format(MSG_INVALID_URI, url: url)
38
+ raise ExternalApiError, format(MSG_INVALID_URI, url:)
39
39
  end
40
- # rubocop:enable Metrics/AbcSize
40
+ # rubocop:enable Metrics/AbcSize, Metrics/ParameterLists
41
41
 
42
42
  private
43
43
 
@@ -63,7 +63,7 @@ module Uc3DmpExternalApi
63
63
 
64
64
  # Prepare the HTTParty gem options
65
65
  def _options(body:, basic_auth: nil, additional_headers: {}, logger: nil)
66
- hdrs = _headers(additional_headers: additional_headers)
66
+ hdrs = _headers(additional_headers:)
67
67
  opts = {
68
68
  headers: hdrs,
69
69
  follow_redirects: true,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpExternalApi
4
- VERSION = '0.0.16'
4
+ VERSION = '0.0.17'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-external-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns
@@ -152,7 +152,7 @@ licenses:
152
152
  - MIT
153
153
  metadata:
154
154
  rubygems_mfa_required: 'false'
155
- post_install_message:
155
+ post_install_message:
156
156
  rdoc_options: []
157
157
  require_paths:
158
158
  - lib
@@ -160,15 +160,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
- version: '2.7'
163
+ version: '3.2'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.1.6
171
- signing_key:
170
+ rubygems_version: 3.4.10
171
+ signing_key:
172
172
  specification_version: 4
173
173
  summary: DMPTool gem that provides general support for accessing external APIs
174
174
  test_files: []