chimera_http_client 1.5.0 → 1.6.0

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: da90ccc4dfdbaf080bf84581cebbf3344e85793653605ecf49075a524c4ecef2
4
- data.tar.gz: 5b93585a12aad3e8c927853e44dd0bc9b22b61f606edd7d3627a89ec91879cc2
3
+ metadata.gz: d06e90c8db720a8514ea698a264d4aaeb31f1457437d2c9ffd61b4ab1b6d9578
4
+ data.tar.gz: 6a285c505ab7c0de92599cc45a661654b3ec69412ea234c9cf0cbabc81fbdb24
5
5
  SHA512:
6
- metadata.gz: 805969007906d493de7b720747c7235345ad12022711f616557944053b7b57310ff587a3f381d081a68f9d63525a176f85dc1a67dc5002b5a4c01a939dea0ceb
7
- data.tar.gz: ffc28a398833e72ae2e760826e418dff7a7d5221e61443974c3bff4277ada7f2c9c1e71e7b1b7da3b20fc1251ccabd4d15c1f646061c74c03fcb45bfd63105a4
6
+ metadata.gz: 9d0cc0b198066b749752df6dc1102055b3f042b511f9a109934159808fcc2f17c41881815c0772a5e95ce40f4062d69bb7c1fcbfb7ca0e62e8bb826dfbcf8e8f
7
+ data.tar.gz: 6ae6be95e3fc0dea402983c97700fd0bdff1b4bb435e6fd0eec275cb1568353406c53a14659bb3e9128542603f02f584f11ab0574fb750a7f577af6da01f4e71
@@ -6,12 +6,12 @@ jobs:
6
6
  fail-fast: false
7
7
  matrix:
8
8
  os: [ubuntu-latest] # macos-latest
9
- ruby: ['2.5', '2.6', '2.7', '3.0'] # Due to https://github.com/actions/runner/issues/849, we have to use quotes
9
+ ruby: ['truffleruby', 'jruby', '2.7', '3.0', '3.1', '3.2', '3.3'] # Due to https://github.com/actions/runner/issues/849, we have to use quotes
10
10
 
11
11
  runs-on: ${{ matrix.os }}
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
15
  - uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: ${{ matrix.ruby }}
data/.rubocop.yml CHANGED
@@ -3,13 +3,17 @@ require:
3
3
  - rubocop-rspec
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.5
6
+ TargetRubyVersion: 2.7
7
7
  DisplayCopNames: true
8
8
  NewCops: enable # but feel free to disable them below
9
+ SuggestExtensions: false
9
10
  Exclude:
10
11
  - vendor/**/*
11
12
  - config.ru
12
13
 
14
+ Gemspec/DevelopmentDependencies:
15
+ EnforcedStyle: gemspec
16
+
13
17
  Layout/EmptyLineBetweenDefs:
14
18
  AllowAdjacentOneLineDefs: true
15
19
 
@@ -27,12 +31,25 @@ Layout/LineLength:
27
31
  Metrics:
28
32
  Enabled: false
29
33
 
34
+ RSpec/ClassCheck:
35
+ Enabled: false
36
+
30
37
  RSpec/ContextWording:
31
38
  Enabled: false
32
39
 
33
40
  RSpec/ExampleLength:
34
41
  Max: 25
35
42
 
43
+ RSpec/FilePath:
44
+ Exclude:
45
+ - spec/chimera_http_client/server/*
46
+ - spec/chimera_http_client/stubbed/*
47
+
48
+ RSpec/SpecFilePathFormat:
49
+ Exclude:
50
+ - spec/chimera_http_client/server/*
51
+ - spec/chimera_http_client/stubbed/*
52
+ -
36
53
  RSpec/MultipleExpectations:
37
54
  Enabled: false
38
55
 
@@ -42,6 +59,9 @@ RSpec/MultipleMemoizedHelpers:
42
59
  RSpec/NestedGroups:
43
60
  Max: 4
44
61
 
62
+ RSpec/PendingWithoutReason:
63
+ Enabled: false
64
+
45
65
  Style/CaseLikeIf:
46
66
  Enabled: false
47
67
 
@@ -53,6 +73,7 @@ Style/Documentation:
53
73
 
54
74
  Style/DoubleNegation:
55
75
  Enabled: true
76
+
56
77
  Style/FrozenStringLiteralComment:
57
78
  Enabled: false
58
79
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.2.2
data/README.markdown CHANGED
@@ -18,14 +18,16 @@ The only other runtime dependency is Ruby's latest code loader [**zeitwerk**](ht
18
18
 
19
19
  ### Ruby version
20
20
 
21
- | Chimera version | Ruby version |
22
- |:----------------|:-----------------------------------|
23
- | >= 1.4 | >= 2.5 (3.0 compatibility ensured) |
24
- | >= 1.1 | >= 2.5 |
25
- | = 1.0 | >= 2.4, <= 3.0 |
26
- | <= 0.5 | >= 2.1, <= 3.0 |
21
+ | Chimera version | Ruby version |
22
+ |:----------------|:------------------------------------|
23
+ | >= 1.6 | >= 2.7 (all 3.x versions supported) |
24
+ | >= 1.4 | >= 2.5 (3.0 compatibility ensured) |
25
+ | >= 1.1 | >= 2.5 |
26
+ | = 1.0 | >= 2.4, <= 3.0 |
27
+ | <= 0.5 | >= 2.1, <= 3.0 |
27
28
 
28
29
  The test suite of v1.4 passes on **MRI Ruby** (2.5, 2.6, 2.7, 3.0) and on **JRuby**, but not on **TruffleRuby**.
30
+ The test suite of v1.6 passes on **MRI Ruby** (2.7, 3.0, 3.1, 3.2, 3.3) and on **JRuby** and **TruffleRuby**.
29
31
 
30
32
  ### ENV variables
31
33
 
@@ -153,9 +155,9 @@ connection.get("/users/#{id}")
153
155
 
154
156
  All forms above ave valid and will make a request to the same URL.
155
157
 
156
- * Please take note that _the endpoint can be given as a String, a Symbol, or an Array._
157
- * While they do no harm, there is _no need to pass leading or trailing `/` in endpoints._
158
- * When passing the endpoint as an Array, _it's elements are converted to Strings and concatenated with `/`._
158
+ * Please take note that _the endpoint can be given as a String, a Symbol, or an Array._
159
+ * While they do no harm, there is _no need to pass leading or trailing `/` in endpoints._
160
+ * When passing the endpoint as an Array, _it's elements are converted to Strings and concatenated with `/`._
159
161
 
160
162
  #### Optional request parameters
161
163
 
@@ -185,7 +187,7 @@ connection.post(
185
187
 
186
188
  #### Basic auth
187
189
 
188
- In case you need to use an API that is protected by **basic_auth** just pass the credentials as optional parameters:
190
+ In case you need to use an API that is protected by **basic_auth** just pass the credentials as optional parameters:
189
191
  `username: 'admin', password: 'secret'`
190
192
 
191
193
  #### Timeout duration
@@ -355,6 +357,7 @@ The error classes and their corresponding http error codes:
355
357
  RedirectionError # 301, 302, 303, 307
356
358
  BadRequestError # 400
357
359
  UnauthorizedError # 401
360
+ PaymentRequiredError # 402
358
361
  ForbiddenError # 403
359
362
  NotFoundError # 404
360
363
  MethodNotAllowedError # 405
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "chimera_http_client/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.required_ruby_version = ">= 2.5.0" # without Deserializer's `rescue` in block it would be 2.4.4 (because of zeitwerk)
6
+ spec.required_ruby_version = ">= 2.7.0" # probably 2.5.0 still works, but 2.7 is the oldest tested version
7
7
 
8
8
  spec.name = "chimera_http_client"
9
9
  spec.version = ChimeraHttpClient::VERSION
@@ -27,6 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
+ spec.metadata["rubygems_mfa_required"] = "true"
31
+
30
32
  # the only sub-dependencies
31
33
  spec.add_runtime_dependency "typhoeus", "~> 1.1"
32
34
  spec.add_runtime_dependency "zeitwerk", ">= 2.0"
@@ -70,6 +70,7 @@ module ChimeraHttpClient
70
70
  class RedirectionError < Error; end # 301, 302, 303, 307
71
71
  class BadRequestError < Error; end # 400
72
72
  class UnauthorizedError < Error; end # 401
73
+ class PaymentRequiredError < Error; end # 402
73
74
  class ForbiddenError < Error; end # 403
74
75
  class NotFoundError < Error; end # 404
75
76
  class MethodNotAllowedError < Error; end # 405
@@ -93,6 +93,8 @@ module ChimeraHttpClient
93
93
  BadRequestError.new(response, @options)
94
94
  when 401
95
95
  UnauthorizedError.new(response, @options)
96
+ when 402
97
+ PaymentRequiredError.new(response, @options)
96
98
  when 403
97
99
  ForbiddenError.new(response, @options)
98
100
  when 404
@@ -1,3 +1,3 @@
1
1
  module ChimeraHttpClient
2
- VERSION = "1.5.0".freeze
2
+ VERSION = "1.6.0".freeze
3
3
  end
@@ -7,5 +7,5 @@ module ChimeraHttpClient
7
7
  loader.setup
8
8
 
9
9
  # as Zeitwerk can't handle innner classes properly :-/
10
- require_relative "./chimera_http_client/error"
10
+ require_relative "chimera_http_client/error"
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimera_http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Finger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2024-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -284,7 +284,8 @@ files:
284
284
  homepage: https://github.com/mediafinger/chimera_http_client
285
285
  licenses:
286
286
  - MIT
287
- metadata: {}
287
+ metadata:
288
+ rubygems_mfa_required: 'true'
288
289
  post_install_message:
289
290
  rdoc_options: []
290
291
  require_paths:
@@ -293,14 +294,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
294
  requirements:
294
295
  - - ">="
295
296
  - !ruby/object:Gem::Version
296
- version: 2.5.0
297
+ version: 2.7.0
297
298
  required_rubygems_version: !ruby/object:Gem::Requirement
298
299
  requirements:
299
300
  - - ">="
300
301
  - !ruby/object:Gem::Version
301
302
  version: '0'
302
303
  requirements: []
303
- rubygems_version: 3.2.15
304
+ rubygems_version: 3.4.19
304
305
  signing_key:
305
306
  specification_version: 4
306
307
  summary: General http client functionality to quickly connect to JSON REST API endpoints