contentful_middleman 1.2.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +13 -0
- data/Gemfile +0 -2
- data/README.md +61 -5
- data/contentful_middleman.gemspec +1 -1
- data/lib/contentful_middleman/core.rb +17 -5
- data/lib/contentful_middleman/helpers.rb +13 -0
- data/lib/contentful_middleman/tools/preview_proxy.rb +131 -0
- data/lib/contentful_middleman/version.rb +1 -1
- data/lib/contentful_middleman/webhook_handler.rb +1 -1
- data/spec/contentful_middleman/core_spec.rb +10 -11
- data/spec/contentful_middleman/helpers_spec.rb +17 -0
- data/spec/contentful_middleman/tools/preview_proxy_spec.rb +368 -0
- data/spec/fixtures/vcr_fixtures/helpers/preview.yml +211 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper.yml +93 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/asset.yml +104 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/asset_2.yml +104 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/assets.yml +91 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/assets_2.yml +91 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/entries.yml +121 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/entries_2.yml +96 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/entry.yml +106 -0
- data/spec/fixtures/vcr_fixtures/tools/preview_helper/entry_2.yml +119 -0
- data/spec/spec_helper.rb +7 -1
- metadata +28 -5
@@ -0,0 +1,121 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- RubyContentfulGem/0.8.0
|
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
|
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
|
+
Server:
|
44
|
+
- nginx
|
45
|
+
X-Contentful-Request-Id:
|
46
|
+
- c40-594530717
|
47
|
+
Content-Length:
|
48
|
+
- '2169'
|
49
|
+
Accept-Ranges:
|
50
|
+
- bytes
|
51
|
+
Date:
|
52
|
+
- Thu, 10 Dec 2015 20:19:01 GMT
|
53
|
+
Via:
|
54
|
+
- 1.1 varnish
|
55
|
+
Age:
|
56
|
+
- '0'
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
X-Served-By:
|
60
|
+
- cache-iad2134-IAD
|
61
|
+
X-Cache:
|
62
|
+
- MISS
|
63
|
+
X-Cache-Hits:
|
64
|
+
- '0'
|
65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9yON4u49wbP2RqCh8+jiNQBN9Pw+EQYiCNNc2hRKC26VY1yCE
|
116
|
+
IJWvv5wOorNQS6zzxzvaX45mq+Unwha3y67pWMh2MDge7EomhqMThSrMMFUL
|
117
|
+
IUfDuLt3df/ZHrl7jll2SiFrc1AIpAc7ZRE1d5rs33xsQmD69y/4/+urr6/+
|
118
|
+
A+LLui4aMQAA
|
119
|
+
http_version:
|
120
|
+
recorded_at: Thu, 10 Dec 2015 20:19:01 GMT
|
121
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?content_type=cat
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- RubyContentfulGem/0.8.0
|
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
|
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
|
+
Server:
|
44
|
+
- nginx
|
45
|
+
X-Contentful-Request-Id:
|
46
|
+
- c40-594531487
|
47
|
+
Content-Length:
|
48
|
+
- '1053'
|
49
|
+
Accept-Ranges:
|
50
|
+
- bytes
|
51
|
+
Date:
|
52
|
+
- Thu, 10 Dec 2015 20:20:40 GMT
|
53
|
+
Via:
|
54
|
+
- 1.1 varnish
|
55
|
+
Age:
|
56
|
+
- '0'
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
X-Served-By:
|
60
|
+
- cache-atl6228-ATL
|
61
|
+
X-Cache:
|
62
|
+
- MISS
|
63
|
+
X-Cache-Hits:
|
64
|
+
- '0'
|
65
|
+
Vary:
|
66
|
+
- Accept-Encoding
|
67
|
+
body:
|
68
|
+
encoding: ASCII-8BIT
|
69
|
+
string: !binary |-
|
70
|
+
H4sIAAAAAAAAA+1YWW/bOBB+z68I9LprmaRuvRnBHgF2iwXiYoEsioCWaJmx
|
71
|
+
rtXR1C3y33dISxZ1OHLRtH3YCoYgXsPhcL6Zb/zp6vpaKw+l5l9/gk9oVIec
|
72
|
+
QUtbFQU9aND3/LOYU2UVjaHfkK1yz3NoINmIecIraGF0bPOKJULgP1LgUSxM
|
73
|
+
23IWh91GcrOUJnKz32meH65vaKUJicdH27Cy+rXgLA1P2jUjqsKn6a3if/B0
|
74
|
+
r4iR+8TQt24O9ktaFYfhBC720NIDTQNQ4qQDnP70Le3QKBDzPeuO2HQGO8Y+
|
75
|
+
buoiYkUn4Z2yKsjirBD7RMK06kl5Ue1C6IMxgpCxwGhB3DUxfITg95N8qwti
|
76
|
+
/l7ujxUhPKGRMGZrcHnwL7LUqiyZeiNS4tFSO3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yrHVV1P7/UDnOluCrCiiVfyUuAqWJ1AT4EihPOB4tmQel
|
93
|
+
vKd38H6+er76D4EX7zD4EgAA
|
94
|
+
http_version:
|
95
|
+
recorded_at: Thu, 10 Dec 2015 20:20:41 GMT
|
96
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,106 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries/garfield
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- RubyContentfulGem/0.8.0
|
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
|
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-Type:
|
40
|
+
- application/vnd.contentful.delivery.v1+json
|
41
|
+
Etag:
|
42
|
+
- '"3dd136e9704fdebe3e7b9a3785ddcf42"'
|
43
|
+
Server:
|
44
|
+
- nginx
|
45
|
+
X-Contentful-Request-Id:
|
46
|
+
- 405-1395085560
|
47
|
+
Content-Length:
|
48
|
+
- '633'
|
49
|
+
Accept-Ranges:
|
50
|
+
- bytes
|
51
|
+
Date:
|
52
|
+
- Fri, 11 Dec 2015 12:02:12 GMT
|
53
|
+
Via:
|
54
|
+
- 1.1 varnish
|
55
|
+
Age:
|
56
|
+
- '0'
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
X-Served-By:
|
60
|
+
- cache-iad2124-IAD
|
61
|
+
X-Cache:
|
62
|
+
- MISS
|
63
|
+
X-Cache-Hits:
|
64
|
+
- '0'
|
65
|
+
Vary:
|
66
|
+
- Accept-Encoding
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: |
|
70
|
+
{
|
71
|
+
"fields": {
|
72
|
+
"name": "Garfield",
|
73
|
+
"likes": [
|
74
|
+
"lasagna"
|
75
|
+
],
|
76
|
+
"color": "orange",
|
77
|
+
"lifes": null,
|
78
|
+
"lives": 9,
|
79
|
+
"birthday": "1979-06-18T23:00:00+00:00"
|
80
|
+
},
|
81
|
+
"sys": {
|
82
|
+
"space": {
|
83
|
+
"sys": {
|
84
|
+
"type": "Link",
|
85
|
+
"linkType": "Space",
|
86
|
+
"id": "cfexampleapi"
|
87
|
+
}
|
88
|
+
},
|
89
|
+
"type": "Entry",
|
90
|
+
"contentType": {
|
91
|
+
"sys": {
|
92
|
+
"type": "Link",
|
93
|
+
"linkType": "ContentType",
|
94
|
+
"id": "cat"
|
95
|
+
}
|
96
|
+
},
|
97
|
+
"id": "garfield",
|
98
|
+
"revision": 2,
|
99
|
+
"createdAt": "2013-06-27T22:46:20.821Z",
|
100
|
+
"updatedAt": "2013-08-27T10:09:07.929Z",
|
101
|
+
"locale": "en-US"
|
102
|
+
}
|
103
|
+
}
|
104
|
+
http_version:
|
105
|
+
recorded_at: Fri, 11 Dec 2015 12:02:12 GMT
|
106
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,119 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries/happycat
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- RubyContentfulGem/0.8.0
|
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
|
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-Type:
|
40
|
+
- application/vnd.contentful.delivery.v1+json
|
41
|
+
Etag:
|
42
|
+
- '"3af7376084551d7cdfa312678745e8c3"'
|
43
|
+
Server:
|
44
|
+
- nginx
|
45
|
+
X-Contentful-Request-Id:
|
46
|
+
- 90a-2093552045
|
47
|
+
Content-Length:
|
48
|
+
- '867'
|
49
|
+
Accept-Ranges:
|
50
|
+
- bytes
|
51
|
+
Date:
|
52
|
+
- Fri, 11 Dec 2015 12:02:16 GMT
|
53
|
+
Via:
|
54
|
+
- 1.1 varnish
|
55
|
+
Age:
|
56
|
+
- '0'
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
X-Served-By:
|
60
|
+
- cache-atl6221-ATL
|
61
|
+
X-Cache:
|
62
|
+
- MISS
|
63
|
+
X-Cache-Hits:
|
64
|
+
- '0'
|
65
|
+
Vary:
|
66
|
+
- Accept-Encoding
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: |
|
70
|
+
{
|
71
|
+
"fields": {
|
72
|
+
"name": "Happy Cat",
|
73
|
+
"bestFriend": {
|
74
|
+
"sys": {
|
75
|
+
"type": "Link",
|
76
|
+
"linkType": "Entry",
|
77
|
+
"id": "nyancat"
|
78
|
+
}
|
79
|
+
},
|
80
|
+
"likes": [
|
81
|
+
"cheezburger"
|
82
|
+
],
|
83
|
+
"color": "gray",
|
84
|
+
"birthday": "2003-10-28T23:00:00+00:00",
|
85
|
+
"lives": 1,
|
86
|
+
"image": {
|
87
|
+
"sys": {
|
88
|
+
"type": "Link",
|
89
|
+
"linkType": "Asset",
|
90
|
+
"id": "happycat"
|
91
|
+
}
|
92
|
+
}
|
93
|
+
},
|
94
|
+
"sys": {
|
95
|
+
"space": {
|
96
|
+
"sys": {
|
97
|
+
"type": "Link",
|
98
|
+
"linkType": "Space",
|
99
|
+
"id": "cfexampleapi"
|
100
|
+
}
|
101
|
+
},
|
102
|
+
"type": "Entry",
|
103
|
+
"contentType": {
|
104
|
+
"sys": {
|
105
|
+
"type": "Link",
|
106
|
+
"linkType": "ContentType",
|
107
|
+
"id": "cat"
|
108
|
+
}
|
109
|
+
},
|
110
|
+
"id": "happycat",
|
111
|
+
"revision": 8,
|
112
|
+
"createdAt": "2013-06-27T22:46:20.171Z",
|
113
|
+
"updatedAt": "2013-11-18T15:58:02.018Z",
|
114
|
+
"locale": "en-US"
|
115
|
+
}
|
116
|
+
}
|
117
|
+
http_version:
|
118
|
+
recorded_at: Fri, 11 Dec 2015 12:02:16 GMT
|
119
|
+
recorded_with: VCR 2.9.3
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,7 @@ require 'vcr'
|
|
4
4
|
require 'yaml'
|
5
5
|
|
6
6
|
require 'contentful_middleman'
|
7
|
+
require 'middleman-core'
|
7
8
|
|
8
9
|
VCR.configure do |config|
|
9
10
|
config.cassette_library_dir = "spec/fixtures/vcr_fixtures"
|
@@ -47,7 +48,8 @@ class OptionsDouble
|
|
47
48
|
use_preview_api: false,
|
48
49
|
all_entries: false,
|
49
50
|
rebuild_on_webhook: false,
|
50
|
-
webhook_timeout: 300
|
51
|
+
webhook_timeout: 300,
|
52
|
+
webhook_controller: ::ContentfulMiddleman::WebhookHandler
|
51
53
|
}
|
52
54
|
|
53
55
|
def initialize(options = DEFAULT_OPTIONS)
|
@@ -55,6 +57,10 @@ class OptionsDouble
|
|
55
57
|
define_singleton_method(field.to_sym) do
|
56
58
|
value
|
57
59
|
end
|
60
|
+
|
61
|
+
define_singleton_method("#{field}=".to_sym) do |value|
|
62
|
+
options[field] = value
|
63
|
+
end
|
58
64
|
end
|
59
65
|
end
|
60
66
|
end
|