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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f73573b5e007f3d6ef23b5d347f1d524a0c88e7e1ad90f044a20290b71eb1df
4
- data.tar.gz: d9ba166255a82387acbea7127f665c4aedd5181b36f5dab67a6ddc6286d87876
3
+ metadata.gz: a5b438ba31c476508694b1c294d2881789d186aa3177a35be94d17e8921a9014
4
+ data.tar.gz: 993a24776cff08778e8b6b473933bdf234f31f6ccdd5742c907d05a4d4f05a10
5
5
  SHA512:
6
- metadata.gz: '0693f89bec3ad2bc4324b523fc6086260c26f0f48e20614df3005c8ae39d733915193ce7fe8f7698fe90c383610af030a8e18becd5ea4d8ae9dbb5dc0e6553d9'
7
- data.tar.gz: aef73a49aad4da0757a2a2f8e013a46137e5bb6ebed392de2a3c916093b3a4ef96deabca8e33c1360c6eff9dd4b1edce58be4b18309cdd95934ba6ae0d5d28f2
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
  &nbsp;
24
- <a href="https://app.circleci.com/pipelines/github/contentful/contentful.rb?branch=master">
25
- <img src="https://circleci.com/gh/contentful/contentful.rb/tree/master.svg?style=svg" alt="CircleCI">
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.
@@ -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
@@ -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?(raw.status)
66
+ [200, 201].include?(status_code)
63
67
  end
64
68
 
65
69
  def service_unavailable_response?
66
- @raw.status == 503
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[@raw.status].new(self)
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[raw.status].new(self)
81
+ @object = Error[status_code].new(self)
78
82
  end
79
83
 
80
84
  def invalid_response?
81
- [400, 404].include?(raw.status)
85
+ [400, 404].include?(status_code)
82
86
  end
83
87
 
84
88
  def no_content_response?
85
- raw.to_s == '' && raw.status == 204
89
+ raw.to_s == '' && status_code == 204
86
90
  end
87
91
 
88
92
  def parse_json!
@@ -1,5 +1,5 @@
1
1
  # Contentful Namespace
2
2
  module Contentful
3
3
  # Gem Version
4
- VERSION = '2.19.0'
4
+ VERSION = '2.20.0'
5
5
  end
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.19.0
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: '6.0'
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: '6.0'
33
+ version: '7.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: multi_json
36
36
  requirement: !ruby/object:Gem::Requirement