httpsensible 0.2.1 → 0.3.0

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: de5889c323583e2bcf7d1a9ab5ff1ea61da2e864383318bc4a00dd60b7f28e1b
4
- data.tar.gz: 9e5725a7847f091526bbe42866744eec8468947ccd78787e3193d6694e2a7449
3
+ metadata.gz: 67217d28061fff4c9f3bab811de26d1ff50189f03810a3744941fb156cb42f21
4
+ data.tar.gz: 60308b862e869bb13df28b1b2b2dc4bff26782a4b645728fd2bfea7374b8328e
5
5
  SHA512:
6
- metadata.gz: 39c930f4965504f7c86fd139e241b78089e94e7982cb80fa3572bf7d30be2358cd853b55fe0f0ed5a79b4bb3203b9ee00d7295d814fd6928364e8db1740cf517
7
- data.tar.gz: 074465b931e1e4ae81f93845a860f6cd65edd847db28f8a6311433574fb7017af85d220446504a9a037975001ba84dcff851e555d64e2399c96dc34e8547f2be
6
+ metadata.gz: a279cccf3dd033a7502d316ddc87f3bc1fe6434e90a47ef5d8391eafb23f843be08bc5abfb549555f3134a4a3f0321e031f2d2190a28a49da0410c05fa54a4cc
7
+ data.tar.gz: b29a088b323b0e91419924cedb65f4bc35e18d0196b84f0e552c05e936bdc39b12273315ad07c036bc34923dc7b65803c24b0de37c9d41af2c8638dd0a8d0aeb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # [v0.3.0] - 19-05-2024
2
+ ## What's Changed
3
+ * support and client methods along by @gjtorikian in https://github.com/yettoapp/httpsensible/pull/7
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/httpsensible/compare/v0.2.2...v0.3.0
7
+ ## [v0.2.2] - 28-12-2023
8
+ **Full Changelog**: https://github.com/yettoapp/httpsensible/compare/v0.2.1...v0.2.2
9
+ ## [v0.2.1] - 27-12-2023
10
+ ## What's Changed
11
+ * Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/yettoapp/httpsensible/pull/3
12
+ * Bump the bundler-dependencies group with 1 update by @dependabot in https://github.com/yettoapp/httpsensible/pull/5
13
+
14
+ ## New Contributors
15
+ * @dependabot made their first contribution in https://github.com/yettoapp/httpsensible/pull/3
16
+
17
+ **Full Changelog**: https://github.com/yettoapp/httpsensible/compare/v0.2.0...v0.2.1
1
18
  ## [v0.2.0] - 10-07-2023
2
19
  null
3
20
  ## [v0.1.2] - 10-07-2023
@@ -36,14 +36,10 @@ module Httpsensible
36
36
  # sig { params(response: T.any(HTTPX::Response, HTTPX::ErrorResponse)).returns(T::Boolean) }
37
37
  def unavailable?
38
38
  return true if @response.nil?
39
+ return true if @response.is_a?(HTTPX::ErrorResponse)
39
40
  return false if (200..299).cover?(@response.status)
40
41
 
41
- case @response
42
- when HTTPX::Response
43
- raw_body.nil? || raw_body.empty? || raw_body == "{}"
44
- when HTTPX::ErrorResponse
45
- true
46
- end
42
+ true if (400..599).cover?(@response.status)
47
43
  end
48
44
 
49
45
  def available?
@@ -35,6 +35,18 @@ module Httpsensible
35
35
  self
36
36
  end
37
37
 
38
+ # TODO: test this
39
+ def with(options, &blk)
40
+ @client = @client.with(options, &blk)
41
+ self
42
+ end
43
+
44
+ # TODO: test this
45
+ def request(*args, **options)
46
+ @client = @client.request(*args, *options)
47
+ self
48
+ end
49
+
38
50
  def with_headers(headers)
39
51
  @client = @client.with(headers: headers)
40
52
  self
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Httpsensible
5
- VERSION = "0.2.1"
5
+ VERSION = "0.3.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpsensible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-27 00:00:00.000000000 Z
11
+ date: 2024-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpx
@@ -88,7 +88,7 @@ dependencies:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
90
  version: '3.8'
91
- description:
91
+ description:
92
92
  email:
93
93
  - gjtorikian@users.noreply.github.com
94
94
  executables: []
@@ -173,7 +173,7 @@ licenses:
173
173
  metadata:
174
174
  homepage_uri: https://github.com/yettoapp/httpsensible
175
175
  source_code_uri: https://github.com/yettoapp/httpsensible
176
- post_install_message:
176
+ post_install_message:
177
177
  rdoc_options: []
178
178
  require_paths:
179
179
  - lib
@@ -191,8 +191,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.5.3
195
- signing_key:
194
+ rubygems_version: 3.4.21
195
+ signing_key:
196
196
  specification_version: 4
197
197
  summary: An HTTP client with sensible defaults.
198
198
  test_files: []