contentful-management 2.13.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ab386d5bdca593af2a33e0c20aa4497e3e8e19a72060e8481c11370e5007121
4
- data.tar.gz: ec6a5beca729d2eba0ee273112ebb45ab0ca9a8ce8f969023a2382ace4583385
3
+ metadata.gz: 85f13e855cf6a3d868bb24e36b3bc311f05a5df0206ae6d66a5f9b1d6ba5a94a
4
+ data.tar.gz: 979be40c83e892575ccebbd1fcd2a41f2da39a87992d43994d31d999feae33e8
5
5
  SHA512:
6
- metadata.gz: e379b2a6ff1c47622460bf7d1e06b00dc65aab3f086971a2eacc294a3a10ce943c0474e682be980ad0c9649f95e0981c89122a1fec2f4f5fcef2233ffc639c5d
7
- data.tar.gz: 7a05c37cb9471cc1405a82ec14bb9b92eced0494b184645f3b0be42ee8f0c68995fef40ea64c20c89ba195f402c0c4f7c2451497e747e1f22fdf7fc9d45eadc8
6
+ metadata.gz: 2e724340067a6e209d5387388e6c05e71fec59f9211cbcf60e868d79a439fe1a2f76ebfb36b936e7be61956be2b2fe3ee0c859d2f1125c48ccaaa007acdadcd7
7
+ data.tar.gz: e95297441626f040734f1e0719f748816ae76b72afe8c57a4f9705d4afde5ed568cfffce73f9ec438cc8ef92299d1ad5b6328d6ca29c0a4231e43ec54e3b55b5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 3.0.0
6
+ ### Fixed
7
+ * Added support for Tags metadata
8
+
9
+ ### Changed
10
+
11
+ **BREAKING CHANGES**:
12
+ * Introduction of new top-level tags `metadata` property in api response.
13
+
5
14
  ## 2.13.1
6
15
  ### Fixed
7
16
  * Fixed an issue when loading entries or assets that included tags. [#219](https://github.com/contentful/contentful-management.rb/issues/219)
@@ -4,25 +4,21 @@ module Contentful
4
4
  # Adds metadata logic for [Resource] classes
5
5
  module Metadata
6
6
  # Returns the metadata hash
7
- #
8
- # @return [Hash] Metadata
9
- def metadata
10
- @metadata
11
- end
7
+ attr_reader :_metadata
12
8
 
13
9
  # @private
14
10
  def initialize(object = nil, *)
15
11
  super
16
- @metadata = {}
12
+ @_metadata = {}
17
13
  extract_metadata_from_object! object if object
18
14
  end
19
15
 
20
16
  # @private
21
17
  def inspect(info = nil)
22
- if metadata.empty?
18
+ if _metadata.empty?
23
19
  super(info)
24
20
  else
25
- super("#{info} @metadata=#{metadata.inspect}")
21
+ super("#{info} @_metadata=#{_metadata.inspect}")
26
22
  end
27
23
  end
28
24
 
@@ -31,11 +27,11 @@ module Contentful
31
27
  def extract_metadata_from_object!(object)
32
28
  return unless object.key?('metadata')
33
29
  object['metadata'].each do |key, value|
34
- @metadata[key.to_sym] = if key == 'tags'
35
- coerce_tags(value)
36
- else
37
- value
38
- end
30
+ @_metadata[key.to_sym] = if key == 'tags'
31
+ coerce_tags(value)
32
+ else
33
+ value
34
+ end
39
35
  end
40
36
  end
41
37
 
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '2.13.1'.freeze
6
+ VERSION = '3.0.0'.freeze
7
7
  end
8
8
  end
@@ -474,14 +474,14 @@ module Contentful
474
474
  it 'hydrates tags' do
475
475
  vcr('asset/issue_219') {
476
476
  asset = environment.assets.find(asset_id)
477
- expect(asset.metadata[:tags].first).to be_a Contentful::Management::Link
477
+ expect(asset._metadata[:tags].first).to be_a Contentful::Management::Link
478
478
  }
479
479
  end
480
480
 
481
481
  it 'loads tag links with their proper attributes' do
482
482
  vcr('asset/issue_219') {
483
483
  asset = environment.assets.find(asset_id)
484
- tag = asset.metadata[:tags].first
484
+ tag = asset._metadata[:tags].first
485
485
  expect(tag.id).to eq 'mobQa'
486
486
  expect(tag.link_type).to eq 'Tag'
487
487
  }
@@ -885,14 +885,14 @@ describe Contentful::Management::Entry do
885
885
  it 'hydrates tags' do
886
886
  vcr('entry/issue_219') {
887
887
  entry = environment.entries.find(entry_id)
888
- expect(entry.metadata[:tags].first).to be_a Contentful::Management::Link
888
+ expect(entry._metadata[:tags].first).to be_a Contentful::Management::Link
889
889
  }
890
890
  end
891
891
 
892
892
  it 'loads tag links with their proper attributes' do
893
893
  vcr('entry/issue_219') {
894
894
  entry = environment.entries.find(entry_id)
895
- tag = entry.metadata[:tags].first
895
+ tag = entry._metadata[:tags].first
896
896
  expect(tag.id).to eq 'mobQa'
897
897
  expect(tag.link_type).to eq 'Tag'
898
898
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-01-07 00:00:00.000000000 Z
13
+ date: 2021-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http