contentful_middleman 2.0.1 → 2.1.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: 696271c04cb1bd35a07944ca7cdef844a4a04db0
4
- data.tar.gz: 0666f72f63064ae8103fd5a6b5493eb3a1a6a7e6
3
+ metadata.gz: 7a948ce797429e759a2b669c3974a3a87af9169b
4
+ data.tar.gz: 0a5097bf21e15a5b0cb6be5f955187d3cc3ce3e9
5
5
  SHA512:
6
- metadata.gz: 6c713f9374a71c4e66b9f02e8b15dc8ea537cd6f40e492916420c9e9471d7a4c9012ab4f39229d826f63ce860b952eb5002910e080d8d679410d9bf65d946bbe
7
- data.tar.gz: b9cc6c52393aa54f1f490c154c690bf0587ebd8ce5708b6099567b91ee39f9c400827997f10ff3bfc45d502f2633dcb76d36fc331141e7187ac30add760dd1cf
6
+ metadata.gz: fe41fcfdd319df04a02552e9aa31de29025d25560ca5f0770cdb63bb901bc2c04329b07c00745f5fcb0355a5573b4e65e146cdb7f5fb6e18fd0426283a91db10
7
+ data.tar.gz: f875e7042ef6d44ce1d8880983ff7357b2b55cec7431ba7112308b3e87923bdfd13fd09e7a51390cd82e03887088e65a66cd2db93579e979a1a844ff79596e45
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
3
 
4
+ ## 2.1.0
5
+
6
+ ### Added
7
+ * Added User Agent Integration Headers
8
+
4
9
  ## 2.0.1
5
10
  ### Fixed
6
11
  * Fixed issue when generating file on entries with a field called `Content Type`
data/DEPLOYING.md CHANGED
@@ -21,6 +21,24 @@
21
21
 
22
22
  ---
23
23
 
24
+ # Netlify
25
+
26
+ ## Requirements for Build
27
+
28
+ > Minimum requirements for a clean build of a Contentful Middleman app on Netlify
29
+
30
+ Steps to solve:
31
+
32
+ 1. add `.*-space-hash` to .gitignore
33
+ 2. add `/data` to .gitignore
34
+ 3. add a .ruby-version file
35
+ 4. add a .nvmrc file
36
+ 5. Netlify Site > Settings > Deploy Settings > Build Command: `middleman contentful --rebuild && middleman build`
37
+
38
+ > Contributed by @joshRpowell
39
+
40
+ ---
41
+
24
42
  # Placeholder Platform
25
43
 
26
44
  ## Placeholder Caveat
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency("middleman-core", ["~> 3.4"])
23
23
 
24
24
  # Additional dependencies
25
- s.add_dependency("contentful", '~> 2.0', '>= 2.0.1')
25
+ s.add_dependency("contentful", '~> 2.1')
26
26
  s.add_dependency("contentful-webhook-listener", '~> 0.1')
27
27
 
28
28
  s.add_development_dependency 'rubygems-tasks', '~> 0.2'
@@ -38,6 +38,10 @@ module ContentfulMiddleman
38
38
  @extension.options
39
39
  end
40
40
 
41
+ def client
42
+ @client ||= Contentful::Client.new(client_options)
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def all_entries(cda_query)
@@ -56,17 +60,15 @@ module ContentfulMiddleman
56
60
  all
57
61
  end
58
62
 
59
- def client
60
- @client ||= Contentful::Client.new(client_options)
61
- end
62
-
63
63
  def client_options
64
64
  client_options = {
65
65
  access_token: options.access_token,
66
66
  space: options.space.fetch(:id),
67
67
  dynamic_entries: :auto,
68
68
  raise_errors: true,
69
- default_locale: options.default_locale
69
+ default_locale: options.default_locale,
70
+ integration_name: 'middleman',
71
+ integration_version: ContentfulMiddleman::VERSION
70
72
  }.merge(options.client_options)
71
73
 
72
74
  client_options[:api_url] = API_PREVIEW_URL if options.use_preview_api
@@ -1,3 +1,3 @@
1
1
  module ContentfulMiddleman
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -82,6 +82,16 @@ describe ContentfulMiddleman::Instance do
82
82
  end
83
83
 
84
84
  describe 'client options' do
85
+ it 'has proper headers' do
86
+ options = OptionsDouble.new(client_options: {max_include_resolution_depth: 1})
87
+ extension = ExtensionDouble.new(options)
88
+ subject = described_class.new(extension)
89
+
90
+ vcr('client') {
91
+ expect(subject.client.integration_info).to eq(name: 'middleman', version: ContentfulMiddleman::VERSION)
92
+ }
93
+ end
94
+
85
95
  it 'respects the client configuration' do
86
96
  options = OptionsDouble.new(client_options: {max_include_resolution_depth: 1})
87
97
  extension = ExtensionDouble.new(options)
@@ -0,0 +1,98 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/cfexampleapi/content_types?limit=1000
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulGem/2.0.3
12
+ Authorization:
13
+ - Bearer b4c0n73n7fu1
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Accept-Encoding:
17
+ - gzip
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - cdn.contentful.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Access-Control-Allow-Headers:
28
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
29
+ Access-Control-Allow-Methods:
30
+ - GET,HEAD,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Expose-Headers:
34
+ - Etag
35
+ Access-Control-Max-Age:
36
+ - '86400'
37
+ Cache-Control:
38
+ - max-age=0
39
+ Content-Encoding:
40
+ - gzip
41
+ Content-Type:
42
+ - application/vnd.contentful.delivery.v1+json
43
+ Etag:
44
+ - W/"544f2fc4143849532b1aaa2d94f16221"
45
+ Server:
46
+ - Contentful
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Contentful-Request-Id:
50
+ - 901257998b2b070f76084465e0b52295
51
+ Content-Length:
52
+ - '866'
53
+ Accept-Ranges:
54
+ - bytes
55
+ Date:
56
+ - Wed, 14 Jun 2017 21:25:57 GMT
57
+ Via:
58
+ - 1.1 varnish
59
+ Age:
60
+ - '0'
61
+ Connection:
62
+ - close
63
+ X-Served-By:
64
+ - cache-lax8645-LAX
65
+ X-Cache:
66
+ - MISS
67
+ X-Cache-Hits:
68
+ - '0'
69
+ X-Timer:
70
+ - S1497475558.544372,VS0,VE352
71
+ Vary:
72
+ - Accept-Encoding
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: !binary |-
76
+ H4sIAAAAAAAAA+1YTVPbMBC98ytSnxuPZRuT+AahTDOlvSSndjgotgKayB+1
77
+ FUrK8N+7kmNHsh0mmBCmQC4grT727Vpvn3R/1OsZ+So3/N49/AsNvkoJtIzT
78
+ LMMrA/oePosxPOGYQb8rW/mCptCwZIPRiHJoIcsqOignkVjxl1yxWLe2jdwq
79
+ T3Eg9ipHFJ2KM6JDdpZOXdJ4YYhNNz/YPl5M105P5Iq1ATQUeII5ucNRyghO
80
+ qYBV/h6q/yXQ4mcUcxAfjmfBPBwtvMhyl+PJJMfjb8r6lWOjJOYk5tIPZZkg
81
+ I5iT8FSEx7At5PYtu2+jKXJ81/Ydx7Ss4U91wjINnzYhI7c0p0ks4r92v8Jh
82
+ hDRPGV5dUMJkDGIcbdwrWtA7onxV+WCEJA8ymvJizXjJWInHmIt1NokVodJS
83
+ VwRN20SMqTb6oW4vLWVep+SOa2kzWBJgRv8S4fccs5yoSTUy8ntJM2nk2VK3
84
+ AWg8Y1smJvCpQkLKRdty3wIpgNSSTHdQwhTRa7FVnyuAkIHUnD80tDXIK/l3
85
+ /XH8x4fyZhlhNaJPPYNO3/L69snUtn3X85FrIsd59AzChCGc2yk69pHl2545
86
+ QANtgnIGnY5n8KsG6uMQthxClZi081SexHOFubQBe2CZJgW9AM0wuiB5O8tc
87
+ Nk16oe7GMM+Dpe1ZFn01cwrDT1bRLGEaOLDeAsdDwQOKlGWloChBU0BUO3Iz
88
+ jfC1XvKrejNuml48aI1yVKs4T4lZm9qpR0xdT2qxjRg6zXPCt0idN1YTwuRa
89
+ VVFllndUZbWK4JjuUCf4uiqrKoLrO7aPkDlwTrZVBLtjRThXINXqgXGGs8Wn
90
+ jWR7t7rs7ZeEbuzWII7d5fQeK8IjXFSS+1vRpCDz98c/tjk4th9VpF4fIXmN
91
+ PPYt5LuOOfCsbfzjdeSfkQKpzj/fSfLHfH3+adTaA18LP/RapdF212tBwpJt
92
+ V+mmqazkLfLxUJy2ow6dkZxfZJTEYbuCPwN7r21A9VhQf9s6FED96qAIyC8x
93
+ z+QT4FqRbwa2XM9mNOM3ITwZtt7NzlqtJfRzePPS5+38RvK8erUjNkbn2y9m
94
+ YOoxMq+9X5XQxvBydF1/O9oPugb9dXvcYvR2OzgwvQ64Zl67oXsfAgq+46uj
95
+ h6N/7PsSCM4XAAA=
96
+ http_version:
97
+ recorded_at: Wed, 14 Jun 2017 21:25:57 GMT
98
+ recorded_with: VCR 3.0.3
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.0.1
4
+ version: 2.1.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-05-19 00:00:00.000000000 Z
12
+ date: 2017-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
@@ -31,20 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.0'
35
- - - ">="
36
- - !ruby/object:Gem::Version
37
- version: 2.0.1
34
+ version: '2.1'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
38
  requirements:
42
39
  - - "~>"
43
40
  - !ruby/object:Gem::Version
44
- version: '2.0'
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 2.0.1
41
+ version: '2.1'
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: contentful-webhook-listener
50
44
  requirement: !ruby/object:Gem::Requirement
@@ -261,6 +255,7 @@ files:
261
255
  - spec/fixtures/space_hash_fixtures/.foo-space-hash
262
256
  - spec/fixtures/space_hash_fixtures/.foobar-space-hash
263
257
  - spec/fixtures/space_hash_fixtures/.my_space-space-hash
258
+ - spec/fixtures/vcr_fixtures/client.yml
264
259
  - spec/fixtures/vcr_fixtures/entries/localized_references.yml
265
260
  - spec/fixtures/vcr_fixtures/entries/localized_references_localized_assets.yml
266
261
  - spec/fixtures/vcr_fixtures/entries/nil_file.yml
@@ -326,6 +321,7 @@ test_files:
326
321
  - spec/fixtures/space_hash_fixtures/.foo-space-hash
327
322
  - spec/fixtures/space_hash_fixtures/.foobar-space-hash
328
323
  - spec/fixtures/space_hash_fixtures/.my_space-space-hash
324
+ - spec/fixtures/vcr_fixtures/client.yml
329
325
  - spec/fixtures/vcr_fixtures/entries/localized_references.yml
330
326
  - spec/fixtures/vcr_fixtures/entries/localized_references_localized_assets.yml
331
327
  - spec/fixtures/vcr_fixtures/entries/nil_file.yml