service_client 0.1.9 → 0.1.10
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/Gemfile +8 -6
- data/Gemfile.lock +6 -8
- data/README.md +2 -2
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/lib/service_client/base.rb +2 -1
- data/lib/service_client/errors.rb +1 -1
- data/lib/service_client/response.rb +2 -1
- data/lib/service_client/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 69224ff4b8d652bf43e798c54fb447a08d6f31a8257ca76349aff31a6ae5f285
|
|
4
|
+
data.tar.gz: 4eef55e77a8b0e60c26c9146fbba0037bcff44998107286a08dffa998bdec22d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f02c7ff167a37e7c7e69ea7ddf793492a7fd96391d72861330a0f92ee7615015ba8b84fb359d4e7422ce3f7dcc5aaecbce5dac6dbd2f9e48d4659f09076ab2c4
|
|
7
|
+
data.tar.gz: 00cf3d41c7c5952ccea81b81ca952a166ff2b0df40154c384becd57e642cedf48e865e1d0303000276150e2191c4be6e3b66c50e50420c8d5cb53cf410e3b85d
|
data/Gemfile
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
5
|
# Specify your gem's dependencies in service_client.gemspec
|
|
4
6
|
gemspec
|
|
5
7
|
|
|
6
|
-
ruby
|
|
8
|
+
ruby '2.7.1'
|
|
7
9
|
|
|
8
|
-
gem
|
|
9
|
-
gem
|
|
10
|
-
gem
|
|
11
|
-
gem
|
|
10
|
+
gem 'httparty', '~> 0.21.0'
|
|
11
|
+
gem 'rack', '~> 2.2.3'
|
|
12
|
+
gem 'rake', '~> 12.0'
|
|
13
|
+
gem 'rspec', '~> 3.0'
|
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
service_client (0.1.
|
|
5
|
-
httparty (~> 0.
|
|
4
|
+
service_client (0.1.10)
|
|
5
|
+
httparty (~> 0.21.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
diff-lcs (1.5.0)
|
|
11
|
-
httparty (0.
|
|
12
|
-
|
|
11
|
+
httparty (0.21.0)
|
|
12
|
+
mini_mime (>= 1.0.0)
|
|
13
13
|
multi_xml (>= 0.5.2)
|
|
14
|
-
|
|
15
|
-
mime-types-data (~> 3.2015)
|
|
16
|
-
mime-types-data (3.2022.0105)
|
|
14
|
+
mini_mime (1.1.2)
|
|
17
15
|
multi_xml (0.6.0)
|
|
18
16
|
rack (2.2.6.2)
|
|
19
17
|
rake (12.3.3)
|
|
@@ -36,7 +34,7 @@ PLATFORMS
|
|
|
36
34
|
|
|
37
35
|
DEPENDENCIES
|
|
38
36
|
bundler (= 2.1.4)
|
|
39
|
-
httparty (~> 0.
|
|
37
|
+
httparty (~> 0.21.0)
|
|
40
38
|
rack (~> 2.2.3)
|
|
41
39
|
rake (~> 12.0)
|
|
42
40
|
rspec (~> 3.0)
|
data/README.md
CHANGED
|
@@ -27,8 +27,8 @@ gem install service_client
|
|
|
27
27
|
Basic usage example:
|
|
28
28
|
|
|
29
29
|
<pre>
|
|
30
|
-
<code>
|
|
31
|
-
class
|
|
30
|
+
<code class="code ruby">
|
|
31
|
+
class CustomerClient < ServiceClient::Base
|
|
32
32
|
base_url 'https://api.com'
|
|
33
33
|
default_headers content_type: 'application/json'
|
|
34
34
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'service_client'
|
|
5
6
|
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
|
@@ -10,5 +11,5 @@ require "service_client"
|
|
|
10
11
|
# require "pry"
|
|
11
12
|
# Pry.start
|
|
12
13
|
|
|
13
|
-
require
|
|
14
|
+
require 'irb'
|
|
14
15
|
IRB.start(__FILE__)
|
data/lib/service_client/base.rb
CHANGED
|
@@ -9,6 +9,7 @@ module ServiceClient
|
|
|
9
9
|
# @example Raise an error if any of the required params are nil.
|
|
10
10
|
# raise ParamsRequired, "Params: #{params_required(params)} are required" if params_nil?(params)
|
|
11
11
|
class ParamsRequired < StandardError; end
|
|
12
|
+
|
|
12
13
|
# This class provides a lightweight and flexible way to make HTTP requests
|
|
13
14
|
# in Ruby projects.
|
|
14
15
|
#
|
|
@@ -96,7 +97,7 @@ module ServiceClient
|
|
|
96
97
|
end
|
|
97
98
|
|
|
98
99
|
# Raises an error if any of the required params are nil.
|
|
99
|
-
#
|
|
100
|
+
#
|
|
100
101
|
# @param params [Hash] the params to check for nil values
|
|
101
102
|
# @raise [ParamsRequired] if any of the params are nil
|
|
102
103
|
# @return [nil] if all params are not nil
|
|
@@ -155,7 +155,7 @@ module ServiceClient
|
|
|
155
155
|
'510': NotExtendedError,
|
|
156
156
|
'511': NetworkAuthenticationRequiredError,
|
|
157
157
|
'598': NetworkReadTimeoutError,
|
|
158
|
-
'599': NetworkConnectTimeoutError
|
|
158
|
+
'599': NetworkConnectTimeoutError
|
|
159
159
|
}.freeze
|
|
160
160
|
|
|
161
161
|
# Raises an error based on the given HTTP response.
|
|
@@ -40,7 +40,8 @@ module ServiceClient
|
|
|
40
40
|
#
|
|
41
41
|
# @param response [HTTParty::Response] The HTTP response object.
|
|
42
42
|
# @return [ServiceClient::Response] Returns itself if the response was successful.
|
|
43
|
-
# @raise [ServiceClient::Error] Raises an error with the response code
|
|
43
|
+
# @raise [ServiceClient::Error] Raises an error with the response code
|
|
44
|
+
# and object if the response was unsuccessful.
|
|
44
45
|
def call(response)
|
|
45
46
|
new(response).call
|
|
46
47
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: service_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alef Ojeda de Oliveira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.
|
|
33
|
+
version: 0.21.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.
|
|
40
|
+
version: 0.21.0
|
|
41
41
|
description: Service client
|
|
42
42
|
email:
|
|
43
43
|
- alef.oliveira@dimensa.com.br
|
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
147
|
version: '0'
|
|
148
148
|
requirements: []
|
|
149
|
-
rubygems_version: 3.
|
|
149
|
+
rubygems_version: 3.1.2
|
|
150
150
|
signing_key:
|
|
151
151
|
specification_version: 4
|
|
152
152
|
summary: Service client
|