katinguele 1.0.5 → 1.0.6

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: cc4e75582da95c103a61bb1ae12455172080a71ea6b92677dc9af7f403a3bc6a
4
- data.tar.gz: f821ffbc534f81e71cac0f9c788f1dbec40cb2fc9c39f1d8c3011d08e72dc0ba
3
+ metadata.gz: 2cef8292f9c9a44045a4ca4c1a49ae172d7170430523e9b4949d04462b2db388
4
+ data.tar.gz: 138f2316107c80ed64d66959ea6c83ceaf3fefc258ece69558b585030511fbd7
5
5
  SHA512:
6
- metadata.gz: be720499d4655b68a9c331966113717930b72a220b39d6cf7755f5b4d62a11c0dfcb0c688629bad9f25510d6e5ae65c0748e82f2ecc29b103dc3a90924035b8c
7
- data.tar.gz: 13a7cc2dcb924fd1d783369fbce56958f1543286f03d88b65582e4133e022621be271e3c414e7902b2ade1162ea3508539b2b96665bb8fc5268a3e7089368cd9
6
+ metadata.gz: 1c2734cb6e7d18947cc769aa70387a514c7997a32aeb20cd6db4d6bc2bfb5fcb26342e63d423d2c6e1767b9682d3d734c87557af9a066656b0740d4c120c76be
7
+ data.tar.gz: 808d3f2504cbd1e1e498126143aef78ab17fa882f2f44d4338d370d365a48cf2cc0bc1a4fd7d9ef36db22d6b5b1123067c5d271eabe44a9b6afda5fa7d830a2d
@@ -20,13 +20,13 @@ module Katinguele
20
20
  def success?
21
21
  return false if timeout?
22
22
 
23
- @success ||= faraday_response? && @original&.success?
23
+ @success ||= success_response? && @original&.success?
24
24
  end
25
25
 
26
26
  def code
27
27
  return if timeout?
28
28
 
29
- @code ||= faraday_response? ? @original.status : @original.response[:status]
29
+ @code ||= success_response? ? @original.status : @original.response[:status]
30
30
  end
31
31
 
32
32
  def timeout?
@@ -42,11 +42,19 @@ module Katinguele
42
42
  private
43
43
 
44
44
  def parsed_body
45
- JSON.parse(faraday_response? ? @original.body : @original.response[:body], symbolize_names: true)
45
+ JSON.parse(handled_faraday_response, symbolize_names: true)
46
46
  end
47
47
 
48
- def faraday_response?
48
+ def success_response?
49
49
  @original.is_a?(Faraday::Response)
50
50
  end
51
+
52
+ def handled_faraday_response
53
+ faraday_response.nil? || faraday_response.empty? ? '{}' : faraday_response
54
+ end
55
+
56
+ def faraday_response
57
+ success_response? ? @original.body : @original.response[:body]
58
+ end
51
59
  end
52
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Katinguele
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katinguele
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - linqueta
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.17.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.17'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.17.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.17'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -42,6 +48,9 @@ dependencies:
42
48
  name: factory_bot
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '5.1'
45
54
  - - ">="
46
55
  - !ruby/object:Gem::Version
47
56
  version: 5.1.1
@@ -49,6 +58,9 @@ dependencies:
49
58
  prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '5.1'
52
64
  - - ">="
53
65
  - !ruby/object:Gem::Version
54
66
  version: 5.1.1
@@ -59,6 +71,9 @@ dependencies:
59
71
  - - ">="
60
72
  - !ruby/object:Gem::Version
61
73
  version: 3.7.0
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '3.7'
62
77
  type: :development
63
78
  prerelease: false
64
79
  version_requirements: !ruby/object:Gem::Requirement
@@ -66,6 +81,9 @@ dependencies:
66
81
  - - ">="
67
82
  - !ruby/object:Gem::Version
68
83
  version: 3.7.0
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '3.7'
69
87
  - !ruby/object:Gem::Dependency
70
88
  name: rake
71
89
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +119,9 @@ dependencies:
101
119
  - - ">="
102
120
  - !ruby/object:Gem::Version
103
121
  version: 0.74.0
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.74'
104
125
  type: :development
105
126
  prerelease: false
106
127
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,10 +129,16 @@ dependencies:
108
129
  - - ">="
109
130
  - !ruby/object:Gem::Version
110
131
  version: 0.74.0
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '0.74'
111
135
  - !ruby/object:Gem::Dependency
112
136
  name: rubocop-performance
113
137
  requirement: !ruby/object:Gem::Requirement
114
138
  requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '1.4'
115
142
  - - ">="
116
143
  - !ruby/object:Gem::Version
117
144
  version: 1.4.1
@@ -119,6 +146,9 @@ dependencies:
119
146
  prerelease: false
120
147
  version_requirements: !ruby/object:Gem::Requirement
121
148
  requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '1.4'
122
152
  - - ">="
123
153
  - !ruby/object:Gem::Version
124
154
  version: 1.4.1
@@ -129,6 +159,9 @@ dependencies:
129
159
  - - ">="
130
160
  - !ruby/object:Gem::Version
131
161
  version: 0.17.0
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '0.17'
132
165
  type: :development
133
166
  prerelease: false
134
167
  version_requirements: !ruby/object:Gem::Requirement
@@ -136,6 +169,9 @@ dependencies:
136
169
  - - ">="
137
170
  - !ruby/object:Gem::Version
138
171
  version: 0.17.0
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '0.17'
139
175
  - !ruby/object:Gem::Dependency
140
176
  name: simplecov-console
141
177
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +179,9 @@ dependencies:
143
179
  - - ">="
144
180
  - !ruby/object:Gem::Version
145
181
  version: 0.5.0
182
+ - - "~>"
183
+ - !ruby/object:Gem::Version
184
+ version: '0.5'
146
185
  type: :development
147
186
  prerelease: false
148
187
  version_requirements: !ruby/object:Gem::Requirement
@@ -150,6 +189,9 @@ dependencies:
150
189
  - - ">="
151
190
  - !ruby/object:Gem::Version
152
191
  version: 0.5.0
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.5'
153
195
  - !ruby/object:Gem::Dependency
154
196
  name: vcr
155
197
  requirement: !ruby/object:Gem::Requirement
@@ -157,6 +199,9 @@ dependencies:
157
199
  - - ">="
158
200
  - !ruby/object:Gem::Version
159
201
  version: 5.0.0
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: '5.0'
160
205
  type: :development
161
206
  prerelease: false
162
207
  version_requirements: !ruby/object:Gem::Requirement
@@ -164,10 +209,16 @@ dependencies:
164
209
  - - ">="
165
210
  - !ruby/object:Gem::Version
166
211
  version: 5.0.0
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: '5.0'
167
215
  - !ruby/object:Gem::Dependency
168
216
  name: webmock
169
217
  requirement: !ruby/object:Gem::Requirement
170
218
  requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '3.7'
171
222
  - - ">="
172
223
  - !ruby/object:Gem::Version
173
224
  version: 3.7.6
@@ -175,10 +226,13 @@ dependencies:
175
226
  prerelease: false
176
227
  version_requirements: !ruby/object:Gem::Requirement
177
228
  requirements:
229
+ - - "~>"
230
+ - !ruby/object:Gem::Version
231
+ version: '3.7'
178
232
  - - ">="
179
233
  - !ruby/object:Gem::Version
180
234
  version: 3.7.6
181
- description: katinguele
235
+ description: A library to execute HTTP request in an easy way
182
236
  email:
183
237
  - lincolnrodrs@gmail.com
184
238
  executables: []
@@ -225,5 +279,5 @@ requirements: []
225
279
  rubygems_version: 3.0.3
226
280
  signing_key:
227
281
  specification_version: 4
228
- summary: katinguele
282
+ summary: The easiest HTTP client for Ruby
229
283
  test_files: []