contentful 2.13.1 → 2.13.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/contentful/resource_builder.rb +7 -7
- data/lib/contentful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a64b9fa9568c2d2a26ff203279e1a38241acc5faa7fb06cd748e4c67b9d786c
|
|
4
|
+
data.tar.gz: 7833adc9a98931215a6a01a6463a20ee7fef2f15debff96c9b825b371fbaeb3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 583e43111095e7aedcddbd92727d603d2302b60d8fedab98cb77af53dc47e1b937800c736b2cc25960d870476489c2678fa6023941f81a9bd0ec327d2f7ab914
|
|
7
|
+
data.tar.gz: fe4173f920702c5ca6d2699de67720b59e8263b627d3ab6e804d64e63e69f9d8c453ddff69fdf03471d742cee5708bb4c882c447571aa22c836b40b6ef091cf0
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.13.2
|
|
6
|
+
### Fixed
|
|
7
|
+
* Removed unnecessary object dups and moved some static arrays that were regenerated each time to constants.
|
|
8
|
+
|
|
5
9
|
## 2.13.1
|
|
6
10
|
### Fixed
|
|
7
11
|
* Fixed detection of empty fields when `:use_camel_case` is `true`. [#203](https://github.com/contentful/contentful.rb/issues/203)
|
|
@@ -25,10 +25,11 @@ module Contentful
|
|
|
25
25
|
'DeletedEntry' => DeletedEntry,
|
|
26
26
|
'DeletedAsset' => DeletedAsset,
|
|
27
27
|
'Locale' => Locale
|
|
28
|
-
}
|
|
28
|
+
}.freeze
|
|
29
29
|
# Default Entry Mapping
|
|
30
30
|
# @see _ README for more information on Entry Mapping
|
|
31
|
-
DEFAULT_ENTRY_MAPPING = {}
|
|
31
|
+
DEFAULT_ENTRY_MAPPING = {}.freeze
|
|
32
|
+
BUILDABLES = %w[Entry Asset ContentType Space DeletedEntry DeletedAsset Locale].freeze
|
|
32
33
|
|
|
33
34
|
attr_reader :json, :default_locale, :endpoint, :depth, :localized, :resource_mapping, :entry_mapping, :resource
|
|
34
35
|
|
|
@@ -67,7 +68,7 @@ module Contentful
|
|
|
67
68
|
build_item(item, includes, errors)
|
|
68
69
|
end
|
|
69
70
|
array_class = fetch_array_class
|
|
70
|
-
array_class.new(json.
|
|
71
|
+
array_class.new(json.merge('items' => result), @configuration, endpoint)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
def build_single
|
|
@@ -77,8 +78,7 @@ module Contentful
|
|
|
77
78
|
end
|
|
78
79
|
|
|
79
80
|
def build_item(item, includes = [], errors = [])
|
|
80
|
-
|
|
81
|
-
item_type = buildables.detect { |b| b.to_s == item['sys']['type'] }
|
|
81
|
+
item_type = BUILDABLES.detect { |b| b == item['sys']['type'] }
|
|
82
82
|
fail UnparsableResource, 'Item type is not known, could not parse' if item_type.nil?
|
|
83
83
|
item_class = resource_class(item)
|
|
84
84
|
|
|
@@ -155,12 +155,12 @@ module Contentful
|
|
|
155
155
|
|
|
156
156
|
# The default mapping for #detect_resource_class
|
|
157
157
|
def default_resource_mapping
|
|
158
|
-
DEFAULT_RESOURCE_MAPPING
|
|
158
|
+
DEFAULT_RESOURCE_MAPPING
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
# The default entry mapping
|
|
162
162
|
def default_entry_mapping
|
|
163
|
-
DEFAULT_ENTRY_MAPPING
|
|
163
|
+
DEFAULT_ENTRY_MAPPING
|
|
164
164
|
end
|
|
165
165
|
end
|
|
166
166
|
end
|
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.13.
|
|
4
|
+
version: 2.13.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Contentful GmbH (Jan Lelis)
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2019-07-
|
|
13
|
+
date: 2019-07-26 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: http
|