contentful_middleman 2.1.3 → 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
  SHA1:
3
- metadata.gz: a4e1ca29530fe1fccd43b993eaa8851f74d806aa
4
- data.tar.gz: 7b0e5e24f95b21aec66d8c30599483f9eb75e6bc
3
+ metadata.gz: 1f2caf1c451b4d1c5775bd1febbf4132438a02c2
4
+ data.tar.gz: 36e15755edb936f0736c165d035584f12f9b1bb1
5
5
  SHA512:
6
- metadata.gz: d9285bf41c9aafbfdde8b803d89df58fab1a5b03d916a705d4ceee176398be1d123cb3013e1540ce6cb1718d81fb7c872950725deecc3c1655da0c7daeb02e29
7
- data.tar.gz: dd322ff7267683d0b2b9ed502a6cb075e172dd75d0036ec0989dd9cc89df221e39ba40e10a68456e43735c6c704ab83a73d5dd11d729abcf9b8f704d59cf97a3
6
+ metadata.gz: f3a1a10b30f596340df8fc0fc83993a82372f084984266289d682020a072919dec93adf1563de3251bbb7829b1d2c011642192283e6f8e1098a50302818d5332
7
+ data.tar.gz: 4bd32921dc5d64ffb4254f0d0d5898bdf47105ff8eb5776c546249599a165d628eea2ed8b2cef4a1d93f0f1417277d9ea7822889f0c9e4013f8f15023f8a018c
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
3
 
4
+ ## 3.0.0
5
+
6
+ This is an atificial version bump, no new features have been added and no breaking change introduced.
7
+ We use this upgrade as an opportunity to match the version of this gem with the Middleman version this release
8
+ will stay compatible with.
9
+
4
10
  ## 2.1.3
5
11
  ### Fixed
6
12
  * `#map_location` properly maps locations
data/README.md CHANGED
@@ -75,8 +75,21 @@ The default mapper will map fields, assets and linked entries.
75
75
 
76
76
  ### Custom mappers
77
77
 
78
- You can create your own mappers if you need so. The only requirement for a class to behave as a
79
- mapper is to have a `map(context, entry)` instance method. This method will take as parameters:
78
+ You can create your own mappers if you need so. The only requirements for a class to behave as a
79
+ mapper are an initializer and a `map(context, entry)` instance method.
80
+
81
+ The initializer takes two parameters:
82
+
83
+ * A `Contentful::Array` of all entries for the current content model
84
+ * A `Middleman::Configuration::ConfigurationManager` object containing the Contentful configuration options set in `config.rb`
85
+
86
+ [See BackrefMapper](https://github.com/contentful/contentful_middleman/blob/master/examples/mappers/backref.rb)
87
+ for an example use of entries.
88
+
89
+ [See the Base mapper](https://github.com/contentful/contentful_middleman/blob/master/lib/contentful_middleman/mappers/base.rb)
90
+ for an example use of options.
91
+
92
+ The `map` method takes two parameters:
80
93
 
81
94
  * A context object. All properties set on this object will be written to the yaml file
82
95
  * An entry
@@ -85,6 +98,11 @@ Following is an example of such custom mapper:
85
98
 
86
99
  ```ruby
87
100
  class MyAwesomeMapper
101
+ def initialize(entries, options)
102
+ @entries = entries
103
+ @options = options
104
+ end
105
+
88
106
  def map(context, entry)
89
107
  context.slug = entry.title.parameterize
90
108
  #... more transformations
@@ -1,3 +1,3 @@
1
1
  module ContentfulMiddleman
2
- VERSION = "2.1.3"
2
+ VERSION = "3.0.0"
3
3
  end
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.3
4
+ version: 3.0.0
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-08-21 00:00:00.000000000 Z
12
+ date: 2017-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  version: '0'
299
299
  requirements: []
300
300
  rubyforge_project:
301
- rubygems_version: 2.6.11
301
+ rubygems_version: 2.6.14
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: Include mangablable content from the Contentful CMS and API into your Middleman