contentful_middleman 2.1.0 → 2.1.1

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
  SHA1:
3
- metadata.gz: 7a948ce797429e759a2b669c3974a3a87af9169b
4
- data.tar.gz: 0a5097bf21e15a5b0cb6be5f955187d3cc3ce3e9
3
+ metadata.gz: 7d3cf9d63abb5e3bf74efca714827687e72ee6db
4
+ data.tar.gz: 609b5a7b692b432baeac066758c943201ca6a49a
5
5
  SHA512:
6
- metadata.gz: fe41fcfdd319df04a02552e9aa31de29025d25560ca5f0770cdb63bb901bc2c04329b07c00745f5fcb0355a5573b4e65e146cdb7f5fb6e18fd0426283a91db10
7
- data.tar.gz: f875e7042ef6d44ce1d8880983ff7357b2b55cec7431ba7112308b3e87923bdfd13fd09e7a51390cd82e03887088e65a66cd2db93579e979a1a844ff79596e45
6
+ metadata.gz: 85ebc4e4256b007c9fc3e61a5fb3abfd41eb051cc0f04ee0ecc0471d0f2a02ec878bb5c0d15688dfefbc62b24cb542e107abe027e78c548970b2d205b7cd933f
7
+ data.tar.gz: 1e135095400bc614778e93253abb36bb2ede7e8532f06776e48694ba9968a0e48f732ab91effddef3c869a0aac0fc998ef42f205904fe652807709f7c70973b2
@@ -1,18 +1,12 @@
1
1
  rvm:
2
- - 2.1.2
3
2
  - 2.2.3
4
3
  - 2.3.1
5
- - jruby
4
+ - 2.4.1
6
5
 
7
6
  script: "bundle exec rake test"
8
7
 
9
8
  before_install: gem install bundler -v 1.10.6
10
9
 
11
- env: TEST=true JRUBY_OPTS='--2.0'
12
10
  notifications:
13
11
  slack:
14
12
  secure: MMWxqKMT4m2UhZ+Ix4wgCs1nLvu9hUFCbyV/qJWmIFif7V4GUKXi6h9krMqGqBAd3YV3pP/InPlw3QoKBUGIAIr5GzDpSnU5ACv7E61v548qViEvPBqsfhRHha2M164rUHn32tpejJnIizVUyND/hIzNviIrab+G8uOaZXUtB5I=
15
-
16
- matrix:
17
- allow_failures:
18
- - rvm: jruby
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
3
 
4
+ ## 2.1.1
5
+ ### Fixed
6
+ * `localize` helpers now properly serialize `_meta` attributes [#124](https://github.com/contentful/contentful_middleman/issues/124) [#128](https://github.com/contentful/contentful_middleman/issues/128)
7
+
4
8
  ## 2.1.0
5
9
 
6
10
  ### Added
@@ -30,7 +30,7 @@ module ContentfulMiddleman
30
30
  def localize_value(value, locale, fallback_locale='en-US')
31
31
  if value.respond_to? :fetch
32
32
  return value.fetch(locale) if value.key? locale
33
- return value.fetch(fallback_locale)
33
+ return value.fetch(fallback_locale) if value.key? fallback_locale
34
34
  end
35
35
  value
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module ContentfulMiddleman
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -10,6 +10,9 @@ end
10
10
  describe ContentfulMiddleman::Helpers do
11
11
  let(:entry) do
12
12
  {
13
+ _meta: {
14
+ id: 'foo'
15
+ },
13
16
  value_field: {
14
17
  'es' => 'foo',
15
18
  'en-US' => 'bar'
@@ -60,8 +63,8 @@ describe ContentfulMiddleman::Helpers do
60
63
  expect(subject.localize_value({'es' => 'foobar'}, 'es')).to eq('foobar')
61
64
  end
62
65
 
63
- it 'fails if locale or fallback_locale not found' do
64
- expect { subject.localize_value({'de-DE' => 'baz'}, 'es') }.to raise_error KeyError
66
+ it 'returns original values if both locale and fallback_locale not found' do
67
+ expect(subject.localize_value({'foo' => 'baz'}, 'es', 'de-DE')).to eq({'foo'=>'baz'})
65
68
  end
66
69
  end
67
70
  end
@@ -90,6 +93,7 @@ describe ContentfulMiddleman::Helpers do
90
93
 
91
94
  it '#localize_entry' do
92
95
  expect(subject.localize_entry(entry, 'es')).to eq({
96
+ _meta: { id: 'foo' },
93
97
  value_field: 'foo',
94
98
  array_field: ['foobar']
95
99
  })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sascha Konietzke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-19 00:00:00.000000000 Z
12
+ date: 2017-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.5.1
300
+ rubygems_version: 2.6.12
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: Include mangablable content from the Contentful CMS and API into your Middleman