contentful 2.13.3 → 2.14.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/.travis.yml +3 -2
- data/CHANGELOG.md +4 -0
- data/lib/contentful/base_resource.rb +1 -3
- data/lib/contentful/fields_resource.rb +1 -3
- data/lib/contentful/resource_builder.rb +1 -0
- data/lib/contentful/version.rb +1 -1
- data/spec/entry_spec.rb +25 -0
- 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: a1930a37ca31d693b4cb4ff55f065b85cc3271696ae3dd96b063093a2f9c24be
|
4
|
+
data.tar.gz: 5299cd8d71d9200873fcbc527d41bedd717ed216a323b0a537d9148d1b0a664d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b3f75e991ce3eecde93a3109acafb20f400e349df4f369463d2adfea36c863772cdc84d1353b7e24018342fbc4eb0cbf6ee9d884b445877817f4821ef26b3ef
|
7
|
+
data.tar.gz: 2bf465ba3e6a9e8129fe7648212d75454332866a478f2aebfb2effb8679a56338cf2890bcd0718a4815f20ca42292f496427aedda571f9b7ab4b5ac5470c0523
|
data/.travis.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
3
|
+
- 2.6.1
|
4
|
+
- 2.5.1
|
5
|
+
- 2.4.1
|
4
6
|
- 2.3.1
|
5
|
-
- 2.2.1
|
6
7
|
notifications:
|
7
8
|
slack:
|
8
9
|
secure: Zr3mKCiTb0vaTD4MPtTG8BbyYyErFuoxioM25QyrqePKVkDFeZC1MtGmg5klQQrJiWTKZPa/zB8NAHYkoUxg9I+z15JK0hYfz9KRubEpCrXCaqTC9Vzq88kJ3LN8YsTyBF66izaBH2KLsOfaJRxwplFzZqgpg4GG2DUBPtrGtes=
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.14.0
|
6
|
+
### Added
|
7
|
+
* Allow user defined methods to override properties created by the SDK, if you want to access overriden fields or sys properties use `#fields[]` or `#sys[]` as accessors. [#210](https://github.com/contentful/contentful.rb/pull/210)
|
8
|
+
|
5
9
|
## 2.13.3
|
6
10
|
### Fixed
|
7
11
|
* Fixed unfiltered unresolvable entries and assets from re-marshalled entries. [#207](https://github.com/contentful/contentful.rb/pull/207)
|
@@ -29,6 +29,7 @@ module Contentful
|
|
29
29
|
# Default Entry Mapping
|
30
30
|
# @see _ README for more information on Entry Mapping
|
31
31
|
DEFAULT_ENTRY_MAPPING = {}.freeze
|
32
|
+
# Buildable Resources
|
32
33
|
BUILDABLES = %w[Entry Asset ContentType Space DeletedEntry DeletedAsset Locale].freeze
|
33
34
|
|
34
35
|
attr_reader :json, :default_locale, :endpoint, :depth, :localized, :resource_mapping, :entry_mapping, :resource
|
data/lib/contentful/version.rb
CHANGED
data/spec/entry_spec.rb
CHANGED
@@ -3,6 +3,19 @@ require 'spec_helper'
|
|
3
3
|
describe Contentful::Entry do
|
4
4
|
let(:entry) { vcr('entry') { create_client.entry 'nyancat' } }
|
5
5
|
|
6
|
+
let(:subclass) do
|
7
|
+
Class.new(described_class) do
|
8
|
+
# An overridden sys method:
|
9
|
+
def created_at; 'yesterday'; end
|
10
|
+
|
11
|
+
# An overridden field method:
|
12
|
+
def best_friend; 'octocat'; end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:raw) { entry.raw }
|
17
|
+
let(:subclassed_entry) { subclass.new(raw, create_client.configuration) }
|
18
|
+
|
6
19
|
describe 'SystemProperties' do
|
7
20
|
it 'has a #sys getter returning a hash with symbol keys' do
|
8
21
|
expect(entry.sys).to be_a Hash
|
@@ -36,6 +49,12 @@ describe Contentful::Entry do
|
|
36
49
|
it 'has #revision' do
|
37
50
|
expect(entry.revision).to eq 5
|
38
51
|
end
|
52
|
+
|
53
|
+
context 'when subclassed' do
|
54
|
+
it 'does not redefine existing methods' do
|
55
|
+
expect(subclassed_entry.created_at).to eq 'yesterday'
|
56
|
+
end
|
57
|
+
end
|
39
58
|
end
|
40
59
|
|
41
60
|
describe 'Fields' do
|
@@ -48,6 +67,12 @@ describe Contentful::Entry do
|
|
48
67
|
expect(entry.fields[:color]).to eq 'rainbow'
|
49
68
|
expect(entry.fields[:best_friend]).to be_a Contentful::Entry
|
50
69
|
end
|
70
|
+
|
71
|
+
context 'when subclassed' do
|
72
|
+
it 'does not redefine existing methods' do
|
73
|
+
expect(subclassed_entry.best_friend).to eq 'octocat'
|
74
|
+
end
|
75
|
+
end
|
51
76
|
end
|
52
77
|
|
53
78
|
describe 'multiple locales' do
|
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.
|
4
|
+
version: 2.14.0
|
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-
|
13
|
+
date: 2019-10-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|