httpsensible 0.2.0 → 0.2.2

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: 43e4e734cb0dd2e3f35946764a2f7d8fccd462ad58f75a94abf8f38996e82c90
4
- data.tar.gz: 704cf714dc7cb7c6d1da85fd278e012c223319b71518c3afda48f6490944aae0
3
+ metadata.gz: 89e017ec4e16bff039a61596353a54bf29efe688d653a4c580cda1501ab7c799
4
+ data.tar.gz: 75c2d3c63b76845ab303da46c89f464f976594f3c55d2a83adde55ad66cea693
5
5
  SHA512:
6
- metadata.gz: 6b3bbb009276d320331a875d23fdfdf250f4550f8daac0697b154c5e3b89dd5f5cadf0eae548792fbd0c4eed776dbe28d36698652b1c85d35a80981f6cba92ea
7
- data.tar.gz: fea550fc6f43b98c9d67ae1686da64aff5aac155bde484bbdb2d8fb1d083d399d6ab1395c548301e06b4609a63e768ea1a8496788eeb6839924fca03a45f1592
6
+ metadata.gz: b60d107062d08050bef5fd8d227c543f2bf58bfffa91b84b1d84cdaf6a7d6cb4ab8626e67d61ad3e0c1e96100450278ad1020f5c4ffc506937d59b4bbd0260c0
7
+ data.tar.gz: d5d8facade2cdbcef8e01453179a2e87c5f3de49fca05524eb33cf59e5c66b4258763a129ab41da0ceab5149561c24fe8fe80d7bed31c3a62766df143f4ef5de
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [v0.2.1] - 27-12-2023
2
+ ## What's Changed
3
+ * Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/yettoapp/httpsensible/pull/3
4
+ * Bump the bundler-dependencies group with 1 update by @dependabot in https://github.com/yettoapp/httpsensible/pull/5
5
+
6
+ ## New Contributors
7
+ * @dependabot made their first contribution in https://github.com/yettoapp/httpsensible/pull/3
8
+
9
+ **Full Changelog**: https://github.com/yettoapp/httpsensible/compare/v0.2.0...v0.2.1
10
+ ## [v0.2.0] - 10-07-2023
11
+ null
1
12
  ## [v0.1.2] - 10-07-2023
2
13
  null
3
14
  ## [v0.1.1] - 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 unless (200..299).cover?(response.status)
39
+ return true if @response.is_a?(HTTPX::ErrorResponse)
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?
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Httpsensible
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
data/script/ci ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ export CI=true
6
+
7
+ script/test
data/script/test ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ #/ Usage: script/test <filename:test_line>
3
+ #/ 1. `script/test FILE` runs all tests in the file.
4
+ #/ 1. `script/test FILE:LINE` runs test in specific line of the file.
5
+ #/ 1. `script/test 'GLOB'` runs all tests for matching glob.
6
+ #/ * make sure to wrap the `GLOB` in single quotes `''`.
7
+
8
+ if ! [ $# -eq 0 ]; then
9
+ export TEST=$(echo "$1" | cut -d ":" -f 1)
10
+
11
+ if [[ "$1" == *":"* ]]; then
12
+ LINE=$(echo "$1" | cut -d ":" -f 2)
13
+ LINE=$(head -n $LINE $TEST | tail -1)
14
+ NAME=$(echo "$LINE" | sed "s/.*def //")
15
+
16
+ if ! [[ "$NAME" == "test_"* ]]; then
17
+ echo
18
+ echo "ERROR: Line provided does not define a test case"
19
+ exit 1
20
+ fi
21
+
22
+ export TESTOPTS="--name=$NAME"
23
+ fi
24
+ fi
25
+
26
+ bundle exec rake test
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpsensible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpx
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.24'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.24'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
27
33
  force_ruby_platform: false
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: jwt
@@ -102,6 +108,8 @@ files:
102
108
  - lib/httpsensible/client/response.rb
103
109
  - lib/httpsensible/jwt.rb
104
110
  - lib/httpsensible/version.rb
111
+ - script/ci
112
+ - script/test
105
113
  - sorbet/config
106
114
  - sorbet/rbi/annotations/rainbow.rbi
107
115
  - sorbet/rbi/dsl/active_support/callbacks.rbi
@@ -183,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
191
  - !ruby/object:Gem::Version
184
192
  version: '0'
185
193
  requirements: []
186
- rubygems_version: 3.4.16
194
+ rubygems_version: 3.5.3
187
195
  signing_key:
188
196
  specification_version: 4
189
197
  summary: An HTTP client with sensible defaults.