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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77d1a0312ff87aa52f3b6c0764b9771b38842f1b24e18128bff86c9aefd59fde
4
- data.tar.gz: bec8478bf8561cc00a782d465f80b839a49002f8d9476af88e624ed5814e5d9b
3
+ metadata.gz: 4a64b9fa9568c2d2a26ff203279e1a38241acc5faa7fb06cd748e4c67b9d786c
4
+ data.tar.gz: 7833adc9a98931215a6a01a6463a20ee7fef2f15debff96c9b825b371fbaeb3d
5
5
  SHA512:
6
- metadata.gz: 0b1d915d4ac1a8ec6f1df4a16a6e2f90e871a93e5c6041fd0e43215fb7ccdaa997a08b7d183d77285516cc2a094be53df8511fad53cf32b24ce3b7907f481622
7
- data.tar.gz: 918b2ab9bc2831814fb779cdeb124ea41c73aed753907f41f72b8aa0362e39ebdd4a2099db4cc0b2a13569a148c4cea11130c34d30af35b2a77fcfabf99d32ad
6
+ metadata.gz: 583e43111095e7aedcddbd92727d603d2302b60d8fedab98cb77af53dc47e1b937800c736b2cc25960d870476489c2678fa6023941f81a9bd0ec327d2f7ab914
7
+ data.tar.gz: fe4173f920702c5ca6d2699de67720b59e8263b627d3ab6e804d64e63e69f9d8c453ddff69fdf03471d742cee5708bb4c882c447571aa22c836b40b6ef091cf0
@@ -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.dup.merge('items' => result), @configuration, endpoint)
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
- buildables = %w[Entry Asset ContentType Space DeletedEntry DeletedAsset Locale]
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.dup
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.dup
163
+ DEFAULT_ENTRY_MAPPING
164
164
  end
165
165
  end
166
166
  end
@@ -1,5 +1,5 @@
1
1
  # Contentful Namespace
2
2
  module Contentful
3
3
  # Gem Version
4
- VERSION = '2.13.1'
4
+ VERSION = '2.13.2'
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.13.1
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-08 00:00:00.000000000 Z
13
+ date: 2019-07-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http