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,498 +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 12:39:30 GMT
29
- Content-Type:
30
- - application/vnd.contentful.management.v1+json
31
- Content-Length:
32
- - '452'
33
- Connection:
34
- - keep-alive
35
- Status:
36
- - 200 OK
37
- X-Contentful-Request-Id:
38
- - 85f-1334321132
39
- Etag:
40
- - '"a964cca95dae35954c57c99f517f39e7"'
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":6,
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:56:51Z"
79
- },
80
- "name":"SaveNewName"}
81
- http_version:
82
- recorded_at: Wed, 30 Jul 2014 12:39:30 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 12:39:31 GMT
109
- Content-Type:
110
- - application/vnd.contentful.management.v1+json
111
- Content-Length:
112
- - '5304'
113
- Connection:
114
- - keep-alive
115
- X-Powered-By:
116
- - Express
117
- Cf-Space-Id:
118
- - yr5m0jky5hsh
119
- Etag:
120
- - '"71f64f6265e724180ead7eeb9ac26c07"'
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": 5,
139
- "skip": 0,
140
- "limit": 100,
141
- "items": [
142
- {
143
- "name": "ContentTypeForSpace",
144
- "description": null,
145
- "fields": [],
146
- "sys": {
147
- "id": "1AZQOWKr2I8W2ugY0KiGEU",
148
- "type": "ContentType",
149
- "createdAt": "2014-07-30T11:17:14.857Z",
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:17:14.861Z",
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
- "name": "TestingContentType",
210
- "description": null,
211
- "fields": [],
212
- "sys": {
213
- "id": "3Pv6UOQy9ikic4qOmmiU8i",
214
- "type": "ContentType",
215
- "createdAt": "2014-07-30T11:08:57.603Z",
216
- "createdBy": {
217
- "sys": {
218
- "type": "Link",
219
- "linkType": "User",
220
- "id": "1E7acJL8I5XUXAMHQt9Grs"
221
- }
222
- },
223
- "space": {
224
- "sys": {
225
- "type": "Link",
226
- "linkType": "Space",
227
- "id": "yr5m0jky5hsh"
228
- }
229
- },
230
- "version": 1,
231
- "updatedAt": "2014-07-30T11:08:57.606Z",
232
- "updatedBy": {
233
- "sys": {
234
- "type": "Link",
235
- "linkType": "User",
236
- "id": "1E7acJL8I5XUXAMHQt9Grs"
237
- }
238
- }
239
- }
240
- },
241
- {
242
- "fields": [],
243
- "name": null,
244
- "sys": {
245
- "id": "1AuXsEwaxygy0KA64OCiQK",
246
- "type": "ContentType",
247
- "createdAt": "2014-07-30T12:34:46.324Z",
248
- "createdBy": {
249
- "sys": {
250
- "type": "Link",
251
- "linkType": "User",
252
- "id": "1E7acJL8I5XUXAMHQt9Grs"
253
- }
254
- },
255
- "space": {
256
- "sys": {
257
- "type": "Link",
258
- "linkType": "Space",
259
- "id": "yr5m0jky5hsh"
260
- }
261
- },
262
- "version": 9,
263
- "updatedAt": "2014-07-30T12:34:56.139Z",
264
- "updatedBy": {
265
- "sys": {
266
- "type": "Link",
267
- "linkType": "User",
268
- "id": "1E7acJL8I5XUXAMHQt9Grs"
269
- }
270
- }
271
- }
272
- },
273
- {
274
- "fields": [
275
- {
276
- "name": "name",
277
- "id": "name",
278
- "type": "Text",
279
- "uiid": "3fflnrplhc0",
280
- "localized": true
281
- },
282
- {
283
- "name": "age",
284
- "id": "age",
285
- "uiid": "2t5blkc7u2o",
286
- "type": "Integer"
287
- },
288
- {
289
- "name": "city",
290
- "id": "city",
291
- "type": "Location",
292
- "uiid": "4fzl5jkm1a8"
293
- },
294
- {
295
- "name": "assets",
296
- "id": "assets",
297
- "uiid": "3aqrgdyesxs",
298
- "type": "Array",
299
- "items": {
300
- "type": "Link",
301
- "linkType": "Asset"
302
- }
303
- },
304
- {
305
- "name": "entries",
306
- "id": "entries",
307
- "type": "Array",
308
- "uiid": "3xi486kbchs",
309
- "items": {
310
- "type": "Link",
311
- "linkType": "Entry"
312
- }
313
- }
314
- ],
315
- "name": "Author",
316
- "sys": {
317
- "id": "5DSpuKrl04eMAGQoQckeIq",
318
- "type": "ContentType",
319
- "createdAt": "2014-07-30T12:35:01.110Z",
320
- "createdBy": {
321
- "sys": {
322
- "type": "Link",
323
- "linkType": "User",
324
- "id": "1E7acJL8I5XUXAMHQt9Grs"
325
- }
326
- },
327
- "space": {
328
- "sys": {
329
- "type": "Link",
330
- "linkType": "Space",
331
- "id": "yr5m0jky5hsh"
332
- }
333
- },
334
- "firstPublishedAt": "2014-07-30T12:37:42.035Z",
335
- "publishedCounter": 1,
336
- "publishedAt": "2014-07-30T12:37:42.035Z",
337
- "publishedBy": {
338
- "sys": {
339
- "type": "Link",
340
- "linkType": "User",
341
- "id": "1E7acJL8I5XUXAMHQt9Grs"
342
- }
343
- },
344
- "publishedVersion": 131,
345
- "version": 132,
346
- "updatedAt": "2014-07-30T12:37:42.043Z",
347
- "updatedBy": {
348
- "sys": {
349
- "type": "Link",
350
- "linkType": "User",
351
- "id": "1E7acJL8I5XUXAMHQt9Grs"
352
- }
353
- }
354
- },
355
- "description": null,
356
- "displayField": "name"
357
- }
358
- ]
359
- }
360
- http_version:
361
- recorded_at: Wed, 30 Jul 2014 12:39:31 GMT
362
- - request:
363
- method: get
364
- uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries
365
- body:
366
- encoding: US-ASCII
367
- string: ''
368
- headers:
369
- User-Agent:
370
- - RubyContenfulManagementGem/0.0.1
371
- Authorization:
372
- - Bearer <ACCESS_TOKEN>
373
- Content-Type:
374
- - application/vnd.contentful.management.v1+json
375
- Content-Length:
376
- - '0'
377
- Host:
378
- - api.contentful.com
379
- response:
380
- status:
381
- code: 200
382
- message: OK
383
- headers:
384
- Server:
385
- - nginx
386
- Date:
387
- - Wed, 30 Jul 2014 12:39:31 GMT
388
- Content-Type:
389
- - application/vnd.contentful.management.v1+json
390
- Content-Length:
391
- - '1841'
392
- Connection:
393
- - keep-alive
394
- X-Powered-By:
395
- - Express
396
- Cf-Space-Id:
397
- - yr5m0jky5hsh
398
- Etag:
399
- - '"529f9332be4d7910137275d2963c7a15"'
400
- Access-Control-Allow-Origin:
401
- - "*"
402
- Access-Control-Allow-Headers:
403
- - 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
404
- Access-Control-Allow-Methods:
405
- - DELETE,GET,HEAD,POST,PUT,OPTIONS
406
- "^access-Control-Expose-Headers":
407
- - Etag
408
- Access-Control-Max-Age:
409
- - '1728000'
410
- body:
411
- encoding: UTF-8
412
- string: |
413
- {
414
- "sys": {
415
- "type": "Array"
416
- },
417
- "total": 1,
418
- "skip": 0,
419
- "limit": 100,
420
- "items": [
421
- {
422
- "sys": {
423
- "id": "4Rouux8SoUCKwkyCq2I0E0",
424
- "type": "Entry",
425
- "createdAt": "2014-07-30T12:37:49.078Z",
426
- "createdBy": {
427
- "sys": {
428
- "type": "Link",
429
- "linkType": "User",
430
- "id": "1E7acJL8I5XUXAMHQt9Grs"
431
- }
432
- },
433
- "space": {
434
- "sys": {
435
- "type": "Link",
436
- "linkType": "Space",
437
- "id": "yr5m0jky5hsh"
438
- }
439
- },
440
- "contentType": {
441
- "sys": {
442
- "type": "Link",
443
- "linkType": "ContentType",
444
- "id": "5DSpuKrl04eMAGQoQckeIq"
445
- }
446
- },
447
- "firstPublishedAt": "2014-07-30T12:39:05.868Z",
448
- "publishedCounter": 1,
449
- "publishedAt": "2014-07-30T12:39:05.868Z",
450
- "publishedBy": {
451
- "sys": {
452
- "type": "Link",
453
- "linkType": "User",
454
- "id": "1E7acJL8I5XUXAMHQt9Grs"
455
- }
456
- },
457
- "publishedVersion": 26,
458
- "version": 27,
459
- "updatedAt": "2014-07-30T12:39:05.874Z",
460
- "updatedBy": {
461
- "sys": {
462
- "type": "Link",
463
- "linkType": "User",
464
- "id": "1E7acJL8I5XUXAMHQt9Grs"
465
- }
466
- }
467
- },
468
- "fields": {
469
- "name": {
470
- "en-US": "Tom Handy"
471
- },
472
- "age": {
473
- "en-US": 39
474
- },
475
- "city": {
476
- "en-US": {
477
- "lat": 52.1464575,
478
- "lon": 21.05050319999998
479
- }
480
- },
481
- "assets": {
482
- "en-US": [
483
- {
484
- "sys": {
485
- "type": "Link",
486
- "linkType": "Asset",
487
- "id": "4k8mYw2MzS6kYG0eGq0Yi0"
488
- }
489
- }
490
- ]
491
- }
492
- }
493
- }
494
- ]
495
- }
496
- http_version:
497
- recorded_at: Wed, 30 Jul 2014 12:39:31 GMT
498
- recorded_with: VCR 2.9.2