contentful 2.19.0 → 2.20.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -2
- data/lib/contentful/error.rb +1 -1
- data/lib/contentful/response.rb +10 -6
- data/lib/contentful/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5b438ba31c476508694b1c294d2881789d186aa3177a35be94d17e8921a9014
|
|
4
|
+
data.tar.gz: 993a24776cff08778e8b6b473933bdf234f31f6ccdd5742c907d05a4d4f05a10
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83c52658865579070c024434d1bc6ad1ca115e00c8f60f32d8354cf7b5bf71a08092ba640ab109f98d0a84b3853347741628cc9a1202a5f893fe45c98d22058b
|
|
7
|
+
data.tar.gz: 547b64d7a90788e3dfae97a03b17356b5dd0f9cd6a00fdb72d4b98d742c8597b907127b2670acb1691002f1198d2afd0edc81831df924056761157e661f59edb
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.20.0
|
|
6
|
+
* Allow `http` gem `6.x` by widening the dependency constraint to `'> 0.8', '< 7.0'`. Resolves [#278](https://github.com/contentful/contentful.rb/issues/278).
|
|
7
|
+
* Adapted error response handling for `http` 6.x: status codes are now coerced to integers for class lookup (`HTTP::Response::Status` no longer inherits from `Delegator`), and the rate-limit reset header is read via `raw.headers[...]` (the `[]` delegator on `HTTP::Response` was removed).
|
|
8
|
+
|
|
5
9
|
## 2.19.0
|
|
6
10
|
* Added `http_instrumenter` configuration option to allow instrumenting HTTP requests. [#266](https://github.com/contentful/contentful.rb/pull/266)
|
|
7
11
|
* Updated `http` gem version to `> 4`
|
data/README.md
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" />
|
|
22
22
|
</a>
|
|
23
23
|
|
|
24
|
-
<a href="https://
|
|
25
|
-
<img src="https://
|
|
24
|
+
<a href="https://github.com/contentful/contentful.rb/actions/workflows/ci.yml">
|
|
25
|
+
<img src="https://github.com/contentful/contentful.rb/actions/workflows/ci.yml/badge.svg" alt="CI">
|
|
26
26
|
</a>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
@@ -758,6 +758,14 @@ For more information on the internal changes present in the 2.x release, please
|
|
|
758
758
|
|
|
759
759
|
We appreciate any help on our repositories. For more details about how to contribute see our [CONTRIBUTING.md](CONTRIBUTING.md) document.
|
|
760
760
|
|
|
761
|
+
For a reproducible local setup, open this repository in its included dev container. The container installs the project dependencies automatically when it is created.
|
|
762
|
+
|
|
763
|
+
After the container is ready, run:
|
|
764
|
+
|
|
765
|
+
```bash
|
|
766
|
+
bundle exec rake rspec_rubocop
|
|
767
|
+
```
|
|
768
|
+
|
|
761
769
|
## License
|
|
762
770
|
|
|
763
771
|
This repository is published under the [MIT](LICENSE.txt) license.
|
data/lib/contentful/error.rb
CHANGED
|
@@ -149,7 +149,7 @@ module Contentful
|
|
|
149
149
|
|
|
150
150
|
# Time until next available request, in seconds.
|
|
151
151
|
def reset_time
|
|
152
|
-
@reset_time ||= @response.raw[RATE_LIMIT_RESET_HEADER_KEY]
|
|
152
|
+
@reset_time ||= @response.raw.headers[RATE_LIMIT_RESET_HEADER_KEY]
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
protected
|
data/lib/contentful/response.rb
CHANGED
|
@@ -58,31 +58,35 @@ module Contentful
|
|
|
58
58
|
parse_http_error
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
def status_code
|
|
62
|
+
raw.status.to_i
|
|
63
|
+
end
|
|
64
|
+
|
|
61
65
|
def valid_http_response?
|
|
62
|
-
[200, 201].include?(
|
|
66
|
+
[200, 201].include?(status_code)
|
|
63
67
|
end
|
|
64
68
|
|
|
65
69
|
def service_unavailable_response?
|
|
66
|
-
|
|
70
|
+
status_code == 503
|
|
67
71
|
end
|
|
68
72
|
|
|
69
73
|
def service_unavailable_error
|
|
70
74
|
@status = :error
|
|
71
75
|
@error_message = '503 - Service Unavailable'
|
|
72
|
-
@object = Error[
|
|
76
|
+
@object = Error[status_code].new(self)
|
|
73
77
|
end
|
|
74
78
|
|
|
75
79
|
def parse_http_error
|
|
76
80
|
@status = :error
|
|
77
|
-
@object = Error[
|
|
81
|
+
@object = Error[status_code].new(self)
|
|
78
82
|
end
|
|
79
83
|
|
|
80
84
|
def invalid_response?
|
|
81
|
-
[400, 404].include?(
|
|
85
|
+
[400, 404].include?(status_code)
|
|
82
86
|
end
|
|
83
87
|
|
|
84
88
|
def no_content_response?
|
|
85
|
-
raw.to_s == '' &&
|
|
89
|
+
raw.to_s == '' && status_code == 204
|
|
86
90
|
end
|
|
87
91
|
|
|
88
92
|
def parse_json!
|
data/lib/contentful/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: contentful
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.20.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Contentful GmbH (Jan Lelis)
|
|
@@ -20,7 +20,7 @@ dependencies:
|
|
|
20
20
|
version: '0.8'
|
|
21
21
|
- - "<"
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: '
|
|
23
|
+
version: '7.0'
|
|
24
24
|
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -30,7 +30,7 @@ dependencies:
|
|
|
30
30
|
version: '0.8'
|
|
31
31
|
- - "<"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '7.0'
|
|
34
34
|
- !ruby/object:Gem::Dependency
|
|
35
35
|
name: multi_json
|
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|