contentful-management 0.0.1.pre → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/CHANGELOG.md +8 -0
  2. data/LICENSE.txt +17 -18
  3. data/README.md +10 -19
  4. data/examples/blog.rb +2 -0
  5. data/examples/create_space.rb +1 -1
  6. data/lib/contentful/management.rb +0 -8
  7. data/lib/contentful/management/asset.rb +41 -38
  8. data/lib/contentful/management/client.rb +8 -1
  9. data/lib/contentful/management/content_type.rb +44 -6
  10. data/lib/contentful/management/entry.rb +61 -29
  11. data/lib/contentful/management/field.rb +1 -1
  12. data/lib/contentful/management/file.rb +1 -0
  13. data/lib/contentful/management/link.rb +1 -1
  14. data/lib/contentful/management/locale.rb +24 -8
  15. data/lib/contentful/management/location.rb +1 -1
  16. data/lib/contentful/management/resource/asset_fields.rb +17 -0
  17. data/lib/contentful/management/resource/entry_fields.rb +13 -0
  18. data/lib/contentful/management/resource/fields.rb +1 -0
  19. data/lib/contentful/management/resource_builder.rb +0 -1
  20. data/lib/contentful/management/space.rb +38 -10
  21. data/lib/contentful/management/support.rb +3 -1
  22. data/lib/contentful/management/version.rb +1 -1
  23. data/spec/fixtures/vcr_cassettes/asset/publish_after_create.yml +268 -0
  24. data/spec/fixtures/vcr_cassettes/content_type/entry/all.yml +777 -0
  25. data/spec/fixtures/vcr_cassettes/entry/content_type_entires.yml +156 -0
  26. data/spec/fixtures/vcr_cassettes/entry/create_with_custom_id.yml +287 -0
  27. data/spec/fixtures/vcr_cassettes/space/{asset/assets.yml → entry/content_type_entires.yml} +369 -367
  28. data/spec/lib/contentful/management/asset_spec.rb +32 -23
  29. data/spec/lib/contentful/management/content_type_spec.rb +31 -6
  30. data/spec/lib/contentful/management/entry_spec.rb +21 -3
  31. data/spec/lib/contentful/management/space_spec.rb +26 -37
  32. metadata +22 -17
  33. data/spec/fixtures/vcr_cassettes/asset/image_url.yml +0 -133
  34. data/spec/fixtures/vcr_cassettes/space/content_type/content_types.yml +0 -341
  35. data/spec/fixtures/vcr_cassettes/space/entry/entries.yml +0 -498
  36. data/spec/fixtures/vcr_cassettes/space/locale/locales.yml +0 -480
@@ -1,133 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets/35Kt2tInIsoauo8sC82q04
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContenfulManagementGem/0.0.1
12
- Authorization:
13
- - Bearer <ACCESS_TOKEN>
14
- Content-Type:
15
- - application/vnd.contentful.management.v1+json
16
- Content-Length:
17
- - '0'
18
- Host:
19
- - api.contentful.com
20
- response:
21
- status:
22
- code: 200
23
- message: OK
24
- headers:
25
- Server:
26
- - nginx
27
- Date:
28
- - Fri, 01 Aug 2014 12:17:11 GMT
29
- Content-Type:
30
- - application/vnd.contentful.management.v1+json
31
- Content-Length:
32
- - '1822'
33
- Connection:
34
- - keep-alive
35
- X-Powered-By:
36
- - Express
37
- Cf-Space-Id:
38
- - yr5m0jky5hsh
39
- Etag:
40
- - '"ed8e3a625dfbe1c129f85ee2696f1672"'
41
- Access-Control-Allow-Origin:
42
- - "*"
43
- Access-Control-Allow-Headers:
44
- - 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
45
- Access-Control-Allow-Methods:
46
- - DELETE,GET,HEAD,POST,PUT,OPTIONS
47
- "^access-Control-Expose-Headers":
48
- - Etag
49
- Access-Control-Max-Age:
50
- - '1728000'
51
- body:
52
- encoding: UTF-8
53
- string: |
54
- {
55
- "fields": {
56
- "title": {
57
- "en-US": "Company logo",
58
- "pl": "Firmowe logo"
59
- },
60
- "description": {
61
- "en-US": "Company logo",
62
- "pl": "Logo firmy Codequest"
63
- },
64
- "file": {
65
- "en-US": {
66
- "fileName": "codequest.jpg",
67
- "contentType": "image/jpeg",
68
- "details": {
69
- "image": {
70
- "width": 90,
71
- "height": 90
72
- },
73
- "size": 7094
74
- },
75
- "url": "//images.contentful.com/yr5m0jky5hsh/35Kt2tInIsoauo8sC82q04/3c84f80a23e1f3ac7717a7a9be59e8d0/codequest.jpg"
76
- },
77
- "pl": {
78
- "fileName": "codequest.jpg",
79
- "contentType": "image/jpeg",
80
- "details": {
81
- "image": {
82
- "width": 90,
83
- "height": 90
84
- },
85
- "size": 7094
86
- },
87
- "url": "//images.contentful.com/yr5m0jky5hsh/35Kt2tInIsoauo8sC82q04/96228bd042f66a29b071c047350d0f4e/codequest.jpg"
88
- }
89
- }
90
- },
91
- "sys": {
92
- "id": "35Kt2tInIsoauo8sC82q04",
93
- "type": "Asset",
94
- "createdAt": "2014-07-31T12:57:45.481Z",
95
- "createdBy": {
96
- "sys": {
97
- "type": "Link",
98
- "linkType": "User",
99
- "id": "1E7acJL8I5XUXAMHQt9Grs"
100
- }
101
- },
102
- "space": {
103
- "sys": {
104
- "type": "Link",
105
- "linkType": "Space",
106
- "id": "yr5m0jky5hsh"
107
- }
108
- },
109
- "firstPublishedAt": "2014-08-01T12:09:35.071Z",
110
- "publishedCounter": 1,
111
- "publishedAt": "2014-08-01T12:09:35.071Z",
112
- "publishedBy": {
113
- "sys": {
114
- "type": "Link",
115
- "linkType": "User",
116
- "id": "1E7acJL8I5XUXAMHQt9Grs"
117
- }
118
- },
119
- "publishedVersion": 15,
120
- "version": 16,
121
- "updatedAt": "2014-08-01T12:09:35.075Z",
122
- "updatedBy": {
123
- "sys": {
124
- "type": "Link",
125
- "linkType": "User",
126
- "id": "1E7acJL8I5XUXAMHQt9Grs"
127
- }
128
- }
129
- }
130
- }
131
- http_version:
132
- recorded_at: Fri, 01 Aug 2014 12:17:11 GMT
133
- recorded_with: VCR 2.9.2
@@ -1,341 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.contentful.com/spaces/yr5m0jky5hsh
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - RubyContenfulManagementGem/0.0.1
12
- Authorization:
13
- - Bearer <ACCESS_TOKEN>
14
- Content-Type:
15
- - application/vnd.contentful.management.v1+json
16
- Content-Length:
17
- - '0'
18
- Host:
19
- - api.contentful.com
20
- response:
21
- status:
22
- code: 200
23
- message: OK
24
- headers:
25
- Server:
26
- - nginx
27
- Date:
28
- - Wed, 30 Jul 2014 11:13:55 GMT
29
- Content-Type:
30
- - application/vnd.contentful.management.v1+json
31
- Content-Length:
32
- - '450'
33
- Connection:
34
- - keep-alive
35
- Status:
36
- - 200 OK
37
- X-Contentful-Request-Id:
38
- - 85f-1334314714
39
- Etag:
40
- - '"1c1abb03603977c6748b4b47160384dd"'
41
- Accept-Ranges:
42
- - bytes
43
- Cache-Control:
44
- - max-age=0
45
- Access-Control-Allow-Origin:
46
- - "*"
47
- Access-Control-Allow-Headers:
48
- - 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
49
- Access-Control-Allow-Methods:
50
- - DELETE,GET,HEAD,POST,PUT,OPTIONS
51
- "^access-Control-Expose-Headers":
52
- - Etag
53
- Access-Control-Max-Age:
54
- - '1728000'
55
- body:
56
- encoding: UTF-8
57
- string: |
58
- {
59
- "sys":{
60
- "type":"Space",
61
- "id":"yr5m0jky5hsh",
62
- "version":5,
63
- "createdBy":{
64
- "sys":{
65
- "type":"Link",
66
- "linkType":"User",
67
- "id":"0fn5fOWn4WsKFyYla1gI5h"
68
- }
69
- },
70
- "createdAt":"2014-07-30T07:46:19Z",
71
- "updatedBy":{
72
- "sys":{
73
- "type":"Link",
74
- "linkType":"User",
75
- "id":"1E7acJL8I5XUXAMHQt9Grs"
76
- }
77
- },
78
- "updatedAt":"2014-07-30T11:02:15Z"
79
- },
80
- "name":"BlogSpace"}
81
- http_version:
82
- recorded_at: Wed, 30 Jul 2014 11:13:56 GMT
83
- - request:
84
- method: get
85
- uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
86
- body:
87
- encoding: US-ASCII
88
- string: ''
89
- headers:
90
- User-Agent:
91
- - RubyContenfulManagementGem/0.0.1
92
- Authorization:
93
- - Bearer <ACCESS_TOKEN>
94
- Content-Type:
95
- - application/vnd.contentful.management.v1+json
96
- Content-Length:
97
- - '0'
98
- Host:
99
- - api.contentful.com
100
- response:
101
- status:
102
- code: 200
103
- message: OK
104
- headers:
105
- Server:
106
- - nginx
107
- Date:
108
- - Wed, 30 Jul 2014 11:13:56 GMT
109
- Content-Type:
110
- - application/vnd.contentful.management.v1+json
111
- Content-Length:
112
- - '1700'
113
- Connection:
114
- - keep-alive
115
- X-Powered-By:
116
- - Express
117
- Cf-Space-Id:
118
- - yr5m0jky5hsh
119
- Etag:
120
- - '"218c882ffa02b10edf3e31f158c6ea4a"'
121
- Access-Control-Allow-Origin:
122
- - "*"
123
- Access-Control-Allow-Headers:
124
- - 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
125
- Access-Control-Allow-Methods:
126
- - DELETE,GET,HEAD,POST,PUT,OPTIONS
127
- "^access-Control-Expose-Headers":
128
- - Etag
129
- Access-Control-Max-Age:
130
- - '1728000'
131
- body:
132
- encoding: UTF-8
133
- string: |
134
- {
135
- "sys": {
136
- "type": "Array"
137
- },
138
- "total": 2,
139
- "skip": 0,
140
- "limit": 100,
141
- "items": [
142
- {
143
- "name": "TestingContentType",
144
- "description": null,
145
- "fields": [],
146
- "sys": {
147
- "id": "3Pv6UOQy9ikic4qOmmiU8i",
148
- "type": "ContentType",
149
- "createdAt": "2014-07-30T11:08:57.603Z",
150
- "createdBy": {
151
- "sys": {
152
- "type": "Link",
153
- "linkType": "User",
154
- "id": "1E7acJL8I5XUXAMHQt9Grs"
155
- }
156
- },
157
- "space": {
158
- "sys": {
159
- "type": "Link",
160
- "linkType": "Space",
161
- "id": "yr5m0jky5hsh"
162
- }
163
- },
164
- "version": 1,
165
- "updatedAt": "2014-07-30T11:08:57.606Z",
166
- "updatedBy": {
167
- "sys": {
168
- "type": "Link",
169
- "linkType": "User",
170
- "id": "1E7acJL8I5XUXAMHQt9Grs"
171
- }
172
- }
173
- }
174
- },
175
- {
176
- "name": "ContentTypeForSpace",
177
- "description": null,
178
- "fields": [],
179
- "sys": {
180
- "id": "2sdtNnLWwoIgowCM0wsW2G",
181
- "type": "ContentType",
182
- "createdAt": "2014-07-30T11:12:15.070Z",
183
- "createdBy": {
184
- "sys": {
185
- "type": "Link",
186
- "linkType": "User",
187
- "id": "1E7acJL8I5XUXAMHQt9Grs"
188
- }
189
- },
190
- "space": {
191
- "sys": {
192
- "type": "Link",
193
- "linkType": "Space",
194
- "id": "yr5m0jky5hsh"
195
- }
196
- },
197
- "version": 1,
198
- "updatedAt": "2014-07-30T11:12:15.073Z",
199
- "updatedBy": {
200
- "sys": {
201
- "type": "Link",
202
- "linkType": "User",
203
- "id": "1E7acJL8I5XUXAMHQt9Grs"
204
- }
205
- }
206
- }
207
- }
208
- ]
209
- }
210
- http_version:
211
- recorded_at: Wed, 30 Jul 2014 11:13:56 GMT
212
- - request:
213
- method: get
214
- uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
215
- body:
216
- encoding: US-ASCII
217
- string: ''
218
- headers:
219
- User-Agent:
220
- - RubyContenfulManagementGem/0.0.1
221
- Authorization:
222
- - Bearer <ACCESS_TOKEN>
223
- Content-Type:
224
- - application/vnd.contentful.management.v1+json
225
- Content-Length:
226
- - '0'
227
- Host:
228
- - api.contentful.com
229
- response:
230
- status:
231
- code: 200
232
- message: OK
233
- headers:
234
- Server:
235
- - nginx
236
- Date:
237
- - Wed, 30 Jul 2014 11:13:57 GMT
238
- Content-Type:
239
- - application/vnd.contentful.management.v1+json
240
- Content-Length:
241
- - '1700'
242
- Connection:
243
- - keep-alive
244
- X-Powered-By:
245
- - Express
246
- Cf-Space-Id:
247
- - yr5m0jky5hsh
248
- Etag:
249
- - '"218c882ffa02b10edf3e31f158c6ea4a"'
250
- Access-Control-Allow-Origin:
251
- - "*"
252
- Access-Control-Allow-Headers:
253
- - 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
254
- Access-Control-Allow-Methods:
255
- - DELETE,GET,HEAD,POST,PUT,OPTIONS
256
- "^access-Control-Expose-Headers":
257
- - Etag
258
- Access-Control-Max-Age:
259
- - '1728000'
260
- body:
261
- encoding: UTF-8
262
- string: |
263
- {
264
- "sys": {
265
- "type": "Array"
266
- },
267
- "total": 2,
268
- "skip": 0,
269
- "limit": 100,
270
- "items": [
271
- {
272
- "name": "TestingContentType",
273
- "description": null,
274
- "fields": [],
275
- "sys": {
276
- "id": "3Pv6UOQy9ikic4qOmmiU8i",
277
- "type": "ContentType",
278
- "createdAt": "2014-07-30T11:08:57.603Z",
279
- "createdBy": {
280
- "sys": {
281
- "type": "Link",
282
- "linkType": "User",
283
- "id": "1E7acJL8I5XUXAMHQt9Grs"
284
- }
285
- },
286
- "space": {
287
- "sys": {
288
- "type": "Link",
289
- "linkType": "Space",
290
- "id": "yr5m0jky5hsh"
291
- }
292
- },
293
- "version": 1,
294
- "updatedAt": "2014-07-30T11:08:57.606Z",
295
- "updatedBy": {
296
- "sys": {
297
- "type": "Link",
298
- "linkType": "User",
299
- "id": "1E7acJL8I5XUXAMHQt9Grs"
300
- }
301
- }
302
- }
303
- },
304
- {
305
- "name": "ContentTypeForSpace",
306
- "description": null,
307
- "fields": [],
308
- "sys": {
309
- "id": "2sdtNnLWwoIgowCM0wsW2G",
310
- "type": "ContentType",
311
- "createdAt": "2014-07-30T11:12:15.070Z",
312
- "createdBy": {
313
- "sys": {
314
- "type": "Link",
315
- "linkType": "User",
316
- "id": "1E7acJL8I5XUXAMHQt9Grs"
317
- }
318
- },
319
- "space": {
320
- "sys": {
321
- "type": "Link",
322
- "linkType": "Space",
323
- "id": "yr5m0jky5hsh"
324
- }
325
- },
326
- "version": 1,
327
- "updatedAt": "2014-07-30T11:12:15.073Z",
328
- "updatedBy": {
329
- "sys": {
330
- "type": "Link",
331
- "linkType": "User",
332
- "id": "1E7acJL8I5XUXAMHQt9Grs"
333
- }
334
- }
335
- }
336
- }
337
- ]
338
- }
339
- http_version:
340
- recorded_at: Wed, 30 Jul 2014 11:13:57 GMT
341
- recorded_with: VCR 2.9.2