contentful 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/contentful/array.rb +15 -0
- data/lib/contentful/version.rb +1 -1
- data/spec/array_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b88ce6b2f318329940d00e5caef099b4df98cdb3
|
4
|
+
data.tar.gz: a8f3faaad9fbf0dbfe570c8cf668300f48bda9bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a46ff4f68e54e2b0f36d6a06d419e1b51d0624b03c4e28c8a06ecec78a1e3c3d74ecad99ad879fd3450271c489e1b77f072820fb87f294e75c205402285ba5
|
7
|
+
data.tar.gz: a8edabd0c40d9e73a9240352f7b7cef24ebc9f9735c5c69db22823ba8cdcbbf9306a917c5acc73dbb1d3e6caf5495ac5887b0382ca99a500e93b6dca7de416b1
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.0.3
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
* `Contentful::Array` now marshalls properly, respecting all properties [#132](https://github.com/contentful/contentful.rb/issues/132)
|
10
|
+
|
5
11
|
## 2.0.2
|
6
12
|
|
7
13
|
### Fixed
|
@@ -32,6 +38,7 @@
|
|
32
38
|
* CustomResource was removed, now subclasses of Entry should be used instead.
|
33
39
|
* `max_include_resolution_depth` option added to the client, defaults to 20.
|
34
40
|
* `sys` properties now match accessors.
|
41
|
+
* `fields` properties now match accessors.
|
35
42
|
* Updated LICENSE
|
36
43
|
* Updated examples
|
37
44
|
|
data/lib/contentful/array.rb
CHANGED
@@ -25,6 +25,21 @@ module Contentful
|
|
25
25
|
@items = item.fetch('items', [])
|
26
26
|
end
|
27
27
|
|
28
|
+
# @private
|
29
|
+
def marshal_dump
|
30
|
+
super.merge(endpoint: endpoint)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @private
|
34
|
+
def marshal_load(raw_object)
|
35
|
+
super
|
36
|
+
@endpoint = raw_object[:endpoint]
|
37
|
+
@total = raw.fetch('total', nil)
|
38
|
+
@limit = raw.fetch('limit', nil)
|
39
|
+
@skip = raw.fetch('skip', nil)
|
40
|
+
@items = raw.fetch('items', [])
|
41
|
+
end
|
42
|
+
|
28
43
|
# @private
|
29
44
|
def inspect
|
30
45
|
"<#{repr_name} total=#{total} skip=#{skip} limit=#{limit}>"
|
data/lib/contentful/version.rb
CHANGED
data/spec/array_spec.rb
CHANGED
@@ -62,4 +62,16 @@ describe Contentful::Array do
|
|
62
62
|
expect(Contentful::Array.new({}).reload).to be_falsey
|
63
63
|
end
|
64
64
|
end
|
65
|
+
|
66
|
+
describe 'marshalling' do
|
67
|
+
it 'marshals/unmarshals properly - #132' do
|
68
|
+
re_array = Marshal.load(Marshal.dump(array))
|
69
|
+
|
70
|
+
expect(re_array.endpoint).to eq array.endpoint
|
71
|
+
expect(re_array.total).to eq array.total
|
72
|
+
expect(re_array.limit).to eq array.limit
|
73
|
+
expect(re_array.skip).to eq array.skip
|
74
|
+
expect(re_array.items).to eq array.items
|
75
|
+
end
|
76
|
+
end
|
65
77
|
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.0.
|
4
|
+
version: 2.0.3
|
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: 2017-04-
|
13
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|