contentful-management 3.8.0 → 3.9.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/.circleci/config.yml +1 -1
- data/.rubocop_todo.yml +72 -7
- data/CHANGELOG.md +6 -0
- data/contentful-management.gemspec +4 -3
- data/lib/contentful/management/api_key.rb +2 -0
- data/lib/contentful/management/array.rb +2 -0
- data/lib/contentful/management/asset.rb +5 -3
- data/lib/contentful/management/client.rb +8 -4
- data/lib/contentful/management/client_api_key_methods_factory.rb +2 -0
- data/lib/contentful/management/client_asset_methods_factory.rb +2 -0
- data/lib/contentful/management/client_association_all_published_method_factory.rb +2 -0
- data/lib/contentful/management/client_association_methods_factory.rb +2 -0
- data/lib/contentful/management/client_content_type_methods_factory.rb +2 -0
- data/lib/contentful/management/client_editor_interface_methods_factory.rb +2 -0
- data/lib/contentful/management/client_entry_methods_factory.rb +2 -0
- data/lib/contentful/management/client_environment_methods_factory.rb +2 -0
- data/lib/contentful/management/client_locale_methods_factory.rb +2 -0
- data/lib/contentful/management/client_organization_methods_factory.rb +2 -0
- data/lib/contentful/management/client_organization_periodic_usage_methods_factory.rb +2 -0
- data/lib/contentful/management/client_personal_access_tokens_methods_factory.rb +2 -0
- data/lib/contentful/management/client_preview_api_key_methods_factory.rb +2 -0
- data/lib/contentful/management/client_role_methods_factory.rb +2 -0
- data/lib/contentful/management/client_snapshot_methods_factory.rb +2 -0
- data/lib/contentful/management/client_space_membership_methods_factory.rb +2 -0
- data/lib/contentful/management/client_space_methods_factory.rb +2 -0
- data/lib/contentful/management/client_space_periodic_usage_methods_factory.rb +2 -0
- data/lib/contentful/management/client_tag_methods_factory.rb +2 -0
- data/lib/contentful/management/client_ui_extension_methods_factory.rb +2 -0
- data/lib/contentful/management/client_upload_methods_factory.rb +2 -0
- data/lib/contentful/management/client_user_methods_factory.rb +2 -0
- data/lib/contentful/management/client_webhook_call_methods_factory.rb +2 -0
- data/lib/contentful/management/client_webhook_health_methods_factory.rb +2 -0
- data/lib/contentful/management/client_webhook_methods_factory.rb +2 -0
- data/lib/contentful/management/content_type.rb +13 -11
- data/lib/contentful/management/content_type_editor_interface_methods_factory.rb +2 -0
- data/lib/contentful/management/content_type_entry_methods_factory.rb +2 -0
- data/lib/contentful/management/content_type_snapshot_methods_factory.rb +2 -0
- data/lib/contentful/management/dynamic_entry.rb +3 -3
- data/lib/contentful/management/editor_interface.rb +3 -1
- data/lib/contentful/management/entry.rb +5 -3
- data/lib/contentful/management/entry_association_methods_factory.rb +2 -0
- data/lib/contentful/management/entry_snapshot_methods_factory.rb +2 -0
- data/lib/contentful/management/environment.rb +2 -0
- data/lib/contentful/management/environment_asset_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_association_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_content_type_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_editor_interface_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_entry_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_locale_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_tag_methods_factory.rb +2 -0
- data/lib/contentful/management/environment_ui_extension_methods_factory.rb +2 -0
- data/lib/contentful/management/error.rb +5 -2
- data/lib/contentful/management/field.rb +2 -0
- data/lib/contentful/management/file.rb +2 -0
- data/lib/contentful/management/link.rb +2 -0
- data/lib/contentful/management/locale.rb +3 -1
- data/lib/contentful/management/location.rb +2 -0
- data/lib/contentful/management/organization.rb +2 -0
- data/lib/contentful/management/organization_periodic_usage.rb +2 -0
- data/lib/contentful/management/organization_user_methods_factory.rb +2 -0
- data/lib/contentful/management/personal_access_token.rb +2 -0
- data/lib/contentful/management/preview_api_key.rb +2 -0
- data/lib/contentful/management/request.rb +3 -8
- data/lib/contentful/management/resource/all_published.rb +2 -0
- data/lib/contentful/management/resource/archiver.rb +2 -0
- data/lib/contentful/management/resource/array_like.rb +2 -0
- data/lib/contentful/management/resource/asset_fields.rb +2 -0
- data/lib/contentful/management/resource/entry_fields.rb +2 -0
- data/lib/contentful/management/resource/environment_aware.rb +2 -0
- data/lib/contentful/management/resource/field_aware.rb +2 -0
- data/lib/contentful/management/resource/fields.rb +3 -1
- data/lib/contentful/management/resource/metadata.rb +3 -0
- data/lib/contentful/management/resource/publisher.rb +2 -0
- data/lib/contentful/management/resource/refresher.rb +3 -0
- data/lib/contentful/management/resource/system_properties.rb +3 -1
- data/lib/contentful/management/resource.rb +4 -3
- data/lib/contentful/management/resource_builder.rb +5 -2
- data/lib/contentful/management/resource_requester.rb +4 -1
- data/lib/contentful/management/response.rb +4 -2
- data/lib/contentful/management/role.rb +3 -1
- data/lib/contentful/management/snapshot.rb +2 -0
- data/lib/contentful/management/space.rb +3 -0
- data/lib/contentful/management/space_api_key_methods_factory.rb +2 -0
- data/lib/contentful/management/space_association_methods_factory.rb +2 -0
- data/lib/contentful/management/space_environment_methods_factory.rb +2 -0
- data/lib/contentful/management/space_membership.rb +2 -0
- data/lib/contentful/management/space_periodic_usage.rb +2 -0
- data/lib/contentful/management/space_preview_api_key_methods_factory.rb +2 -0
- data/lib/contentful/management/space_role_methods_factory.rb +2 -0
- data/lib/contentful/management/space_space_membership_methods_factory.rb +2 -0
- data/lib/contentful/management/space_user_methods_factory.rb +2 -0
- data/lib/contentful/management/space_webhook_methods_factory.rb +2 -0
- data/lib/contentful/management/support.rb +4 -2
- data/lib/contentful/management/tag.rb +2 -0
- data/lib/contentful/management/ui_extension.rb +4 -0
- data/lib/contentful/management/upload.rb +2 -0
- data/lib/contentful/management/user.rb +2 -0
- data/lib/contentful/management/validation.rb +2 -0
- data/lib/contentful/management/version.rb +3 -1
- data/lib/contentful/management/webhook.rb +2 -0
- data/lib/contentful/management/webhook_call.rb +2 -0
- data/lib/contentful/management/webhook_health.rb +2 -0
- data/lib/contentful/management/webhook_webhook_call_methods_factory.rb +2 -0
- data/lib/contentful/management/webhook_webhook_health_methods_factory.rb +2 -0
- data/lib/contentful/management.rb +2 -0
- metadata +13 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c3fb532555b680e1310d4919295c046a81e7cf25143157b846aa2bffaa6e6fc8
|
|
4
|
+
data.tar.gz: 7e21aed3e6c01cfd0dec029553753a3eb059975f060831c26163b43361c63a52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8930ebc2559f4ac7e7664ee04c5edeb12adf679d26d6935037bc0786d0375a1d284a803a3139d98edd6f5eb65949c2ec093c677088756ce1c72df2a8a025d6a
|
|
7
|
+
data.tar.gz: 6a8a800dbb58060d2113ba8b3d62804cd26a682e10fad1fdc8e66129108a058a534d056ec3b4e6cc361402e9e724b074d8b562320b789aadfcdac9d168b23135
|
data/.circleci/config.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,24 +1,89 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2023-09-07 21:06:26 UTC using RuboCop version 1.56.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 1
|
|
10
|
+
Lint/DuplicateMethods:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'lib/contentful/management/resource.rb'
|
|
13
|
+
|
|
14
|
+
# Offense count: 1
|
|
15
|
+
# Configuration parameters: MaximumRangeSize.
|
|
16
|
+
Lint/MissingCopEnableDirective:
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'lib/contentful/management/snapshot.rb'
|
|
19
|
+
|
|
20
|
+
# Offense count: 3
|
|
21
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
22
|
+
Lint/RedundantCopDisableDirective:
|
|
23
|
+
Exclude:
|
|
24
|
+
- 'lib/contentful/management/entry.rb'
|
|
25
|
+
- 'lib/contentful/management/error.rb'
|
|
26
|
+
- 'lib/contentful/management/resource.rb'
|
|
27
|
+
|
|
28
|
+
# Offense count: 3
|
|
29
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
30
|
+
Lint/UselessMethodDefinition:
|
|
31
|
+
Exclude:
|
|
32
|
+
- 'lib/contentful/management/client_personal_access_tokens_methods_factory.rb'
|
|
33
|
+
- 'lib/contentful/management/client_user_methods_factory.rb'
|
|
34
|
+
|
|
35
|
+
# Offense count: 14
|
|
36
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
10
37
|
Metrics/AbcSize:
|
|
11
|
-
Max:
|
|
38
|
+
Max: 42
|
|
12
39
|
|
|
13
40
|
# Offense count: 4
|
|
41
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
14
42
|
Metrics/CyclomaticComplexity:
|
|
15
|
-
Max:
|
|
43
|
+
Max: 9
|
|
16
44
|
|
|
17
|
-
# Offense count:
|
|
18
|
-
# Configuration parameters: CountComments.
|
|
45
|
+
# Offense count: 21
|
|
46
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
19
47
|
Metrics/MethodLength:
|
|
20
|
-
Max:
|
|
48
|
+
Max: 22
|
|
49
|
+
|
|
50
|
+
# Offense count: 2
|
|
51
|
+
# Configuration parameters: Max, CountKeywordArgs.
|
|
52
|
+
Metrics/ParameterLists:
|
|
53
|
+
MaxOptionalParameters: 4
|
|
21
54
|
|
|
22
55
|
# Offense count: 2
|
|
56
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
23
57
|
Metrics/PerceivedComplexity:
|
|
24
58
|
Max: 10
|
|
59
|
+
|
|
60
|
+
# Offense count: 1
|
|
61
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
62
|
+
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
|
63
|
+
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
|
64
|
+
Naming/MemoizedInstanceVariableName:
|
|
65
|
+
Exclude:
|
|
66
|
+
- 'lib/contentful/management/entry.rb'
|
|
67
|
+
|
|
68
|
+
# Offense count: 1
|
|
69
|
+
Style/MissingRespondToMissing:
|
|
70
|
+
Exclude:
|
|
71
|
+
- 'lib/contentful/management/entry.rb'
|
|
72
|
+
|
|
73
|
+
# Offense count: 2
|
|
74
|
+
# Configuration parameters: AllowedMethods.
|
|
75
|
+
# AllowedMethods: respond_to_missing?
|
|
76
|
+
Style/OptionalBooleanParameter:
|
|
77
|
+
Exclude:
|
|
78
|
+
- 'lib/contentful/management/entry.rb'
|
|
79
|
+
- 'lib/contentful/management/resource.rb'
|
|
80
|
+
|
|
81
|
+
# Offense count: 5
|
|
82
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
83
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
84
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
85
|
+
Style/SafeNavigation:
|
|
86
|
+
Exclude:
|
|
87
|
+
- 'lib/contentful/management/asset.rb'
|
|
88
|
+
- 'lib/contentful/management/client.rb'
|
|
89
|
+
- 'lib/contentful/management/resource_builder.rb'
|
data/CHANGELOG.md
CHANGED
|
@@ -11,13 +11,14 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
spec.description = %q{Ruby client for the https://www.contentful.com Content Management API}
|
|
12
12
|
spec.homepage = 'https://github.com/contentful/contentful-management.rb'
|
|
13
13
|
spec.license = 'MIT'
|
|
14
|
+
spec.required_ruby_version = '>= 3.0'
|
|
14
15
|
|
|
15
16
|
spec.files = `git ls-files -z`.split("\x0")
|
|
16
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
19
|
spec.require_paths = ['lib']
|
|
19
20
|
|
|
20
|
-
spec.add_dependency 'http', '
|
|
21
|
+
spec.add_dependency 'http', '~> 5.0'
|
|
21
22
|
spec.add_dependency 'multi_json', '~> 1'
|
|
22
23
|
spec.add_dependency 'json', '>= 1.8', '< 3.0'
|
|
23
24
|
|
|
@@ -30,9 +31,9 @@ Gem::Specification.new do |spec|
|
|
|
30
31
|
spec.add_development_dependency 'guard-rspec'
|
|
31
32
|
spec.add_development_dependency 'guard-rubocop'
|
|
32
33
|
spec.add_development_dependency 'guard-yard'
|
|
33
|
-
spec.add_development_dependency 'rubocop', '~>
|
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 1.56.2'
|
|
34
35
|
spec.add_development_dependency 'listen', '~> 3.0'
|
|
35
|
-
spec.add_development_dependency 'vcr', '~>
|
|
36
|
+
spec.add_development_dependency 'vcr', '~> 6.2.0'
|
|
36
37
|
spec.add_development_dependency 'webmock'
|
|
37
38
|
spec.add_development_dependency 'tins', '~> 1.6.0'
|
|
38
39
|
spec.add_development_dependency 'simplecov'
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'resource'
|
|
2
4
|
require_relative 'resource/fields'
|
|
3
5
|
require_relative 'resource/archiver'
|
|
@@ -52,7 +54,7 @@ module Contentful
|
|
|
52
54
|
#
|
|
53
55
|
# @return [Contentful::Management::Asset]
|
|
54
56
|
def process_file
|
|
55
|
-
instance_variable_get(:@fields).
|
|
57
|
+
instance_variable_get(:@fields).each_key do |locale|
|
|
56
58
|
request = Request.new(
|
|
57
59
|
client,
|
|
58
60
|
process_url(locale),
|
|
@@ -75,8 +77,8 @@ module Contentful
|
|
|
75
77
|
# Parser for assets attributes, creates appropriate form of request.
|
|
76
78
|
def fields_for_query
|
|
77
79
|
self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|
|
|
78
|
-
results[field_name] = @fields.
|
|
79
|
-
|
|
80
|
+
results[field_name] = @fields.transform_values do |fields|
|
|
81
|
+
get_value_from(fields, field_name)
|
|
80
82
|
end
|
|
81
83
|
end
|
|
82
84
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'http'
|
|
2
4
|
require 'json'
|
|
3
5
|
require 'logger'
|
|
@@ -68,7 +70,7 @@ module Contentful
|
|
|
68
70
|
}.freeze
|
|
69
71
|
|
|
70
72
|
# Rate Limit Reset Header Key
|
|
71
|
-
RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
|
|
73
|
+
RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
|
|
72
74
|
|
|
73
75
|
# @param [String] access_token
|
|
74
76
|
# @param [Hash] configuration
|
|
@@ -395,8 +397,8 @@ module Contentful
|
|
|
395
397
|
logger.debug(response: raw_response) if logger
|
|
396
398
|
result = Response.new(raw_response, request)
|
|
397
399
|
fail result.object if result.object.is_a?(Error) && configuration[:raise_errors]
|
|
398
|
-
rescue Contentful::Management::RateLimitExceeded =>
|
|
399
|
-
reset_time =
|
|
400
|
+
rescue Contentful::Management::RateLimitExceeded => e
|
|
401
|
+
reset_time = e.response.raw[RATE_LIMIT_RESET_HEADER_KEY].to_i
|
|
400
402
|
if should_retry(retries_left, reset_time, configuration[:max_rate_limit_wait])
|
|
401
403
|
retries_left -= 1
|
|
402
404
|
logger.info(retry_message(retries_left, reset_time)) if logger
|
|
@@ -428,7 +430,7 @@ module Contentful
|
|
|
428
430
|
|
|
429
431
|
# @private
|
|
430
432
|
def should_retry(retries_left, reset_time, max_wait)
|
|
431
|
-
retries_left
|
|
433
|
+
retries_left.positive? && max_wait > reset_time
|
|
432
434
|
end
|
|
433
435
|
|
|
434
436
|
# @private
|
|
@@ -502,6 +504,7 @@ module Contentful
|
|
|
502
504
|
# @return [HTTP::Response]
|
|
503
505
|
def http_send(type, url, params, headers, proxy)
|
|
504
506
|
return proxy_send(type, url, params, headers, proxy) unless proxy[:host].nil?
|
|
507
|
+
|
|
505
508
|
HTTP[headers].public_send(type, url, params)
|
|
506
509
|
end
|
|
507
510
|
|
|
@@ -592,6 +595,7 @@ module Contentful
|
|
|
592
595
|
result = []
|
|
593
596
|
header.each do |key, values|
|
|
594
597
|
next unless values[:name]
|
|
598
|
+
|
|
595
599
|
result << format_user_agent_header(key, values)
|
|
596
600
|
end
|
|
597
601
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'field'
|
|
2
4
|
require_relative 'support'
|
|
3
5
|
require_relative 'resource'
|
|
@@ -16,17 +18,17 @@ module Contentful
|
|
|
16
18
|
class ContentType
|
|
17
19
|
# Shortcuts for Contentful Field Types
|
|
18
20
|
FIELD_TYPES = [
|
|
19
|
-
SYMBOL = 'Symbol'
|
|
20
|
-
TEXT = 'Text'
|
|
21
|
-
INTEGER = 'Integer'
|
|
22
|
-
FLOAT = 'Number'
|
|
23
|
-
DATE = 'Date'
|
|
24
|
-
BOOLEAN = 'Boolean'
|
|
25
|
-
LINK = 'Link'
|
|
26
|
-
ARRAY = 'Array'
|
|
27
|
-
OBJECT = 'Object'
|
|
28
|
-
LOCATION = 'Location'
|
|
29
|
-
STRUCTURED_TEXT = 'RichText'
|
|
21
|
+
SYMBOL = 'Symbol',
|
|
22
|
+
TEXT = 'Text',
|
|
23
|
+
INTEGER = 'Integer',
|
|
24
|
+
FLOAT = 'Number',
|
|
25
|
+
DATE = 'Date',
|
|
26
|
+
BOOLEAN = 'Boolean',
|
|
27
|
+
LINK = 'Link',
|
|
28
|
+
ARRAY = 'Array',
|
|
29
|
+
OBJECT = 'Object',
|
|
30
|
+
LOCATION = 'Location',
|
|
31
|
+
STRUCTURED_TEXT = 'RichText'
|
|
30
32
|
].freeze
|
|
31
33
|
|
|
32
34
|
include Contentful::Management::Resource
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'resource'
|
|
2
4
|
require_relative 'location'
|
|
3
5
|
require_relative 'resource/fields'
|
|
@@ -49,9 +51,7 @@ module Contentful
|
|
|
49
51
|
|
|
50
52
|
# @private
|
|
51
53
|
def self.create(content_type, client)
|
|
52
|
-
unless content_type.is_a? ContentType
|
|
53
|
-
content_type = ContentType.new(content_type)
|
|
54
|
-
end
|
|
54
|
+
content_type = ContentType.new(content_type) unless content_type.is_a? ContentType
|
|
55
55
|
|
|
56
56
|
Class.new DynamicEntry do
|
|
57
57
|
DynamicEntry.define_singleton_properties(self, content_type, client)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'resource'
|
|
2
4
|
require_relative 'resource/environment_aware'
|
|
3
5
|
|
|
@@ -96,7 +98,7 @@ module Contentful
|
|
|
96
98
|
controls: controls,
|
|
97
99
|
sidebar: sidebar
|
|
98
100
|
}.merge(
|
|
99
|
-
attributes.
|
|
101
|
+
attributes.transform_keys(&:to_sym)
|
|
100
102
|
)
|
|
101
103
|
end
|
|
102
104
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'resource'
|
|
2
4
|
require_relative 'resource/fields'
|
|
3
5
|
require_relative 'resource/archiver'
|
|
@@ -72,11 +74,11 @@ module Contentful
|
|
|
72
74
|
# @private
|
|
73
75
|
def self.parse_attribute_with_field(attribute, field)
|
|
74
76
|
case field.type
|
|
75
|
-
when ContentType::LINK
|
|
77
|
+
when ContentType::LINK
|
|
76
78
|
{ sys: { type: field.type, linkType: field.link_type, id: attribute.id } } if attribute
|
|
77
|
-
when ContentType::ARRAY
|
|
79
|
+
when ContentType::ARRAY
|
|
78
80
|
parse_fields_array(attribute)
|
|
79
|
-
when ContentType::LOCATION
|
|
81
|
+
when ContentType::LOCATION
|
|
80
82
|
{ lat: attribute.properties[:lat], lon: attribute.properties[:lon] } if attribute
|
|
81
83
|
else
|
|
82
84
|
attribute
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Contentful
|
|
2
4
|
module Management
|
|
3
5
|
# All errors raised by the contentful gem are either instances of Contentful::Management::Error
|
|
@@ -66,7 +68,7 @@ module Contentful
|
|
|
66
68
|
error_message << "Message: #{message}"
|
|
67
69
|
error_message << "Details: #{handle_details(details)}" if details
|
|
68
70
|
error_message << "Request ID: #{request_id}" if request_id
|
|
69
|
-
rescue
|
|
71
|
+
rescue StandardError
|
|
70
72
|
error_message << "Message: #{default_error_message}"
|
|
71
73
|
end
|
|
72
74
|
|
|
@@ -89,6 +91,7 @@ module Contentful
|
|
|
89
91
|
|
|
90
92
|
handle_detail = proc do |detail|
|
|
91
93
|
return detail if detail.is_a?(String)
|
|
94
|
+
|
|
92
95
|
detail.fetch('details', nil)
|
|
93
96
|
end
|
|
94
97
|
|
|
@@ -177,7 +180,7 @@ module Contentful
|
|
|
177
180
|
# 429
|
|
178
181
|
class RateLimitExceeded < Error
|
|
179
182
|
# Rate Limit Reset Header Key
|
|
180
|
-
RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
|
|
183
|
+
RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'
|
|
181
184
|
|
|
182
185
|
def reset_time?
|
|
183
186
|
# rubocop:disable Style/DoubleNegation
|