contentful-management 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +37 -8
  3. data/Gemfile +0 -1
  4. data/README.md +130 -0
  5. data/Rakefile +0 -1
  6. data/contentful-management.gemspec +0 -1
  7. data/examples/blog.rb +1 -1
  8. data/lib/contentful/management.rb +0 -1
  9. data/lib/contentful/management/array.rb +0 -1
  10. data/lib/contentful/management/asset.rb +65 -26
  11. data/lib/contentful/management/client.rb +19 -9
  12. data/lib/contentful/management/content_type.rb +43 -28
  13. data/lib/contentful/management/dynamic_entry.rb +15 -15
  14. data/lib/contentful/management/entry.rb +73 -40
  15. data/lib/contentful/management/error.rb +6 -1
  16. data/lib/contentful/management/field.rb +63 -8
  17. data/lib/contentful/management/file.rb +0 -1
  18. data/lib/contentful/management/http_client.rb +0 -1
  19. data/lib/contentful/management/link.rb +0 -1
  20. data/lib/contentful/management/locale.rb +11 -3
  21. data/lib/contentful/management/location.rb +0 -1
  22. data/lib/contentful/management/request.rb +5 -7
  23. data/lib/contentful/management/resource.rb +3 -3
  24. data/lib/contentful/management/resource/array_like.rb +0 -1
  25. data/lib/contentful/management/resource/fields.rb +1 -2
  26. data/lib/contentful/management/resource/refresher.rb +3 -3
  27. data/lib/contentful/management/resource/system_properties.rb +0 -1
  28. data/lib/contentful/management/resource_builder.rb +16 -27
  29. data/lib/contentful/management/response.rb +36 -32
  30. data/lib/contentful/management/space.rb +16 -6
  31. data/lib/contentful/management/space_webhook_methods_factory.rb +0 -4
  32. data/lib/contentful/management/support.rb +0 -1
  33. data/lib/contentful/management/validation.rb +34 -0
  34. data/lib/contentful/management/version.rb +1 -2
  35. data/lib/contentful/management/webhook.rb +17 -10
  36. data/spec/fixtures/vcr_cassettes/content_type/validation/in.yml +588 -0
  37. data/spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml +620 -0
  38. data/spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml +668 -0
  39. data/spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml +749 -0
  40. data/spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml +770 -0
  41. data/spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml +766 -0
  42. data/spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml +854 -0
  43. data/spec/fixtures/vcr_cassettes/content_type/validation/present.yml +808 -0
  44. data/spec/fixtures/vcr_cassettes/content_type/validation/range.yml +683 -0
  45. data/spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml +697 -0
  46. data/spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml +720 -0
  47. data/spec/fixtures/vcr_cassettes/content_type/validation/size.yml +791 -0
  48. data/spec/fixtures/vcr_cassettes/entry/service_unavailable.yml +52 -0
  49. data/spec/fixtures/vcr_cassettes/space/webhook/create.yml +439 -0
  50. data/spec/lib/contentful/management/asset_spec.rb +16 -16
  51. data/spec/lib/contentful/management/client_spec.rb +0 -1
  52. data/spec/lib/contentful/management/content_type_spec.rb +143 -1
  53. data/spec/lib/contentful/management/entry_spec.rb +10 -4
  54. data/spec/lib/contentful/management/locale_spec.rb +0 -1
  55. data/spec/lib/contentful/management/space_spec.rb +9 -1
  56. data/spec/lib/contentful/management/webhook_spec.rb +0 -1
  57. data/spec/spec_helper.rb +0 -1
  58. data/spec/support/vcr.rb +0 -1
  59. metadata +63 -62
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
@@ -48,6 +47,7 @@ module Contentful
48
47
  vcr('asset/find_not_found') do
49
48
  result = subject.find(space_id, 'not_exist')
50
49
  expect(result).to be_kind_of Contentful::Management::NotFound
50
+ expect(result.message).to eq 'The resource could not be found.'
51
51
  end
52
52
  end
53
53
  end
@@ -91,15 +91,15 @@ module Contentful
91
91
  describe '#publish' do
92
92
  it 'returns Contentful::Management::Asset' do
93
93
  vcr('asset/publish_after_create') do
94
- file1 = Contentful::Management::File.new
95
- file1.properties[:contentType] = 'image/jpeg'
96
- file1.properties[:fileName] = 'pic1.jpg'
97
- file1.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
94
+ file = Contentful::Management::File.new
95
+ file.properties[:contentType] = 'image/jpeg'
96
+ file.properties[:fileName] = 'pic1.jpg'
97
+ file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
98
98
 
99
99
  asset = Contentful::Management::Asset.create(space_id,
100
100
  title: 'titlebyCreateAPI',
101
101
  description: 'descByAPI',
102
- file: file1)
102
+ file: file)
103
103
  expect(asset).to be_kind_of Contentful::Management::Asset
104
104
  asset.publish
105
105
  expect(asset.published?).to be_truthy
@@ -226,15 +226,15 @@ module Contentful
226
226
  describe '.create' do
227
227
  it 'creates asset ' do
228
228
  vcr('asset/create') do
229
- file1 = Contentful::Management::File.new
230
- file1.properties[:contentType] = 'image/jpeg'
231
- file1.properties[:fileName] = 'pic1.jpg'
232
- file1.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
229
+ file = Contentful::Management::File.new
230
+ file.properties[:contentType] = 'image/jpeg'
231
+ file.properties[:fileName] = 'pic1.jpg'
232
+ file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
233
233
 
234
234
  asset = Contentful::Management::Asset.create(space_id,
235
235
  title: 'titlebyCreateAPI',
236
236
  description: 'descByAPI',
237
- file: file1)
237
+ file: file)
238
238
  expect(asset).to be_kind_of Contentful::Management::Asset
239
239
  expect(asset.title).to eq 'titlebyCreateAPI'
240
240
  expect(asset.description).to eq 'descByAPI'
@@ -243,15 +243,15 @@ module Contentful
243
243
 
244
244
  it 'creates asset with specified locale ' do
245
245
  vcr('asset/create_with_locale') do
246
- file1 = Contentful::Management::File.new
247
- file1.properties[:contentType] = 'image/jpeg'
248
- file1.properties[:fileName] = 'pic1.jpg'
249
- file1.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
246
+ file = Contentful::Management::File.new
247
+ file.properties[:contentType] = 'image/jpeg'
248
+ file.properties[:fileName] = 'pic1.jpg'
249
+ file.properties[:upload] = 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Gasometer_Berlin_Sch%C3%B6neberg_2011.jpg'
250
250
 
251
251
  asset = Contentful::Management::Asset.create('bfsvtul0c41g',
252
252
  title: 'Title PL',
253
253
  description: 'Description PL',
254
- file: file1, locale: 'pl-PL')
254
+ file: file, locale: 'pl-PL')
255
255
  expect(asset).to be_kind_of Contentful::Management::Asset
256
256
  expect(asset.title).to eq 'Title PL'
257
257
  expect(asset.description).to eq 'Description PL'
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/client'
4
3
 
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
@@ -536,6 +535,149 @@ module Contentful
536
535
  end
537
536
  end
538
537
  end
538
+
539
+
540
+ describe '#validations' do
541
+ let(:space) { Contentful::Management::Space.find('v2umtz8ths9v') }
542
+ let(:content_type) { space.content_types.find('category_content_type') }
543
+
544
+ it "adds 'in validation' to a new field" do
545
+ vcr('content_type/validation/in') do
546
+ validation_in = Contentful::Management::Validation.new
547
+ validation_in.in = ['foo', 'bar', 'baz']
548
+ content_type.fields.create(id: 'valid', name: 'Valid', type: 'Text', validations: [validation_in])
549
+ expect(content_type).to be_kind_of Contentful::Management::ContentType
550
+ expect(content_type.fields.last.validations.first.properties[:in]).to eq %w( foo bar baz)
551
+ end
552
+ end
553
+ it "changes 'in validation' on an existing field" do
554
+ vcr('content_type/validation/in_update') do
555
+ validation_in = Contentful::Management::Validation.new
556
+ validation_in.in = ['foo', 'bar']
557
+ content_type.fields.create(id: 'valid', name: 'Valid', type: 'Text', validations: [validation_in])
558
+ expect(content_type).to be_kind_of Contentful::Management::ContentType
559
+ expect(content_type.fields[2].validations.first.properties[:in]).to eq %w( foo bar )
560
+ end
561
+ end
562
+ it 'adds new validation on an existing field' do
563
+ vcr('content_type/validation/in_add') do
564
+ validation_size = Contentful::Management::Validation.new
565
+ validation_size.size = {min: 2, max: 10}
566
+
567
+ content_type.fields.create(id: 'valid', name: 'Valid', type: 'Text', validations: [validation_size])
568
+ expect(content_type).to be_kind_of Contentful::Management::ContentType
569
+ expect(content_type.fields.last.validations.first.properties[:in]).to eq %w( foo bar baz)
570
+ expect(content_type.fields.last.validations.last.properties[:size]['min']).to eq 2
571
+ end
572
+ end
573
+ context 'size' do
574
+ it 'adds `size` validation to field' do
575
+ vcr('content_type/validation/size') do
576
+ validation_size = Contentful::Management::Validation.new
577
+ validation_size.size = {min: 10, max: 15}
578
+ content_type.fields.create(id: 'valid', name: 'Valid', type: 'Text', validations: [validation_size])
579
+ expect(content_type.fields[2].validations.last.properties[:size]['min']).to eq 10
580
+ expect(content_type.fields[2].validations.last.properties[:size]['max']).to eq 15
581
+ end
582
+ end
583
+ end
584
+ context 'range' do
585
+ it 'adds `range` validation to field' do
586
+ vcr('content_type/validation/range') do
587
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
588
+
589
+ validation_range = Contentful::Management::Validation.new
590
+ validation_range.range = {min: 30, max: 100}
591
+ content_type.fields.create(id: 'number', name: 'Number', type: 'Number', validations: [validation_range])
592
+ expect(content_type.fields.first.validations.first.properties[:range]['min']).to eq 30
593
+ expect(content_type.fields.first.validations.first.properties[:range]['max']).to eq 100
594
+ end
595
+ end
596
+ it 'change `range` validation to existing field' do
597
+ vcr('content_type/validation/range_update') do
598
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
599
+
600
+ validation_range = Contentful::Management::Validation.new
601
+ validation_range.range = {min: 50, max: 200}
602
+ content_type.fields.create(id: 'number', name: 'Number', type: 'Number', validations: [validation_range])
603
+ expect(content_type.fields.first.validations.first.properties[:range]['min']).to eq 50
604
+ expect(content_type.fields.first.validations.first.properties[:range]['max']).to eq 200
605
+ end
606
+ end
607
+ end
608
+ context 'present' do
609
+ it 'adds `present` validation to field' do
610
+ vcr('content_type/validation/present') do
611
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
612
+ validation_present = Contentful::Management::Validation.new
613
+ validation_present.present = true
614
+ content_type.fields.create(id: 'present', name: 'Present', type: 'Text', validations: [validation_present])
615
+ expect(content_type.fields.last.validations.last.properties[:present]).to be_truthy
616
+ end
617
+ end
618
+ end
619
+ context 'regexp' do
620
+ it 'adds `regexp` validation to field' do
621
+ vcr('content_type/validation/regexp') do
622
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
623
+ validation_regexp = Contentful::Management::Validation.new
624
+ validation_regexp.regexp = {pattern: '^such', flags: 'im'}
625
+ content_type.fields.create(id: 'text', name: 'Text', type: 'Text', validations: [validation_regexp])
626
+ expect(content_type.fields.last.validations.first.properties[:regexp]['pattern']).to eq '^such'
627
+ expect(content_type.fields.last.validations.first.properties[:regexp]['flags']).to eq 'im'
628
+ end
629
+ end
630
+ end
631
+ context 'linkContentType' do
632
+ it 'adds `linkContentType` validation to field' do
633
+ vcr('content_type/validation/link_content_type') do
634
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
635
+ validation_link_content_type = Contentful::Management::Validation.new
636
+ validation_link_content_type.link_content_type = ['post_content_type']
637
+ content_type.fields.create(id: 'entries', validations: [validation_link_content_type])
638
+ expect(content_type.fields[1].validations.first.properties[:linkContentType]).to eq %w( post_content_type )
639
+ end
640
+ end
641
+ end
642
+ context 'linkMimetypeGroup' do
643
+ it 'adds `linkMimetypeGroup` validation to field' do
644
+ vcr('content_type/validation/link_mimetype_group') do
645
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
646
+ validation_link_mimetype_group = Contentful::Management::Validation.new
647
+ validation_link_mimetype_group.link_mimetype_group = 'image'
648
+ content_type.fields.create(id: 'entries', validations: [validation_link_mimetype_group])
649
+ expect(content_type.fields[1].validations.first.properties[:linkMimetypeGroup]).to eq 'image'
650
+ end
651
+ end
652
+ end
653
+ context 'linkField' do
654
+ it 'adds `linkField` validation to field' do
655
+ vcr('content_type/validation/link_field') do
656
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
657
+ validation_link_mimetype_group = Contentful::Management::Validation.new
658
+ validation_link_mimetype_group.link_field = true
659
+ content_type.fields.create(id: 'link_field', validations: [validation_link_mimetype_group])
660
+ expect(content_type.fields.last.validations.first.properties[:linkField]).to be_truthy
661
+ end
662
+ end
663
+ end
664
+
665
+ context 'add multiple validations' do
666
+ it 'create field with multiple validations' do
667
+ vcr('content_type/validation/multiple_add') do
668
+ content_type = space.content_types.find('1JrDv4JJsYuY4KGEEgAsQU')
669
+ validation_in = Contentful::Management::Validation.new
670
+ validation_in.in = %w( foo bar baz)
671
+ validation_regexp = Contentful::Management::Validation.new
672
+ validation_regexp.regexp = {pattern: '^such', flags: 'im'}
673
+
674
+ content_type.fields.create(id: 'multi', name: 'Multi Validation', type: 'Text', validations: [validation_in, validation_regexp])
675
+ expect(content_type.fields.last.validations.first.properties[:in]).to eq %w( foo bar baz)
676
+ expect(content_type.fields.last.validations.last.properties[:regexp]['pattern']).to eq '^such'
677
+ end
678
+ end
679
+ end
680
+ end
539
681
  end
540
682
  end
541
683
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
@@ -56,6 +55,13 @@ module Contentful
56
55
  expect(result).to be_kind_of Contentful::Management::NotFound
57
56
  end
58
57
  end
58
+
59
+ it 'returns an error when service is unavailable' do
60
+ vcr('entry/service_unavailable') do
61
+ result = subject.find(space_id, 'not_exist')
62
+ expect(result).to be_kind_of Contentful::Management::ServiceUnavailable
63
+ end
64
+ end
59
65
  end
60
66
 
61
67
  describe '#destroy' do
@@ -261,12 +267,12 @@ module Contentful
261
267
  it 'with entries' do
262
268
  vcr('entry/create_with_entries') do
263
269
  entry_att = Entry.find(space_id, '1d1QDYzeiyWmgqQYysae8u')
264
- entry2 = subject.create(content_type,
270
+ new_entry = subject.create(content_type,
265
271
  name: 'EntryWithEntries',
266
272
  age: 20,
267
273
  entries: [entry_att, entry_att, entry_att])
268
- expect(entry2.name).to eq 'EntryWithEntries'
269
- expect(entry2.age).to eq 20
274
+ expect(new_entry.name).to eq 'EntryWithEntries'
275
+ expect(new_entry.age).to eq 20
270
276
  end
271
277
  end
272
278
 
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
@@ -328,6 +327,15 @@ module Contentful
328
327
  expect(webhook.url).to eql 'https://www.example2.com'
329
328
  end
330
329
  end
330
+ it 'create' do
331
+ vcr('space/webhook/create') do
332
+ space = subject.find('v2umtz8ths9v')
333
+ webhook = space.webhooks.create(url: 'https://www.example2.com', httpBasicUsername: 'username', httpBasicPassword: 'password')
334
+ expect(webhook).to be_kind_of Contentful::Management::Webhook
335
+ expect(webhook.url).to eql 'https://www.example2.com'
336
+ expect(webhook.http_basic_username).to eql 'username'
337
+ end
338
+ end
331
339
  end
332
340
  describe '#entries.all(content_type: content_type_id)' do
333
341
  it 'returns entries to specified content type' do
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'spec_helper'
3
2
  require 'contentful/management/space'
4
3
  require 'contentful/management/client'
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'simplecov'
3
2
  SimpleCov.start
4
3
 
data/spec/support/vcr.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'vcr'
3
2
 
4
3
  VCR.configure do |c|
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Piotr Protas
@@ -11,172 +10,152 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-09-17 00:00:00.000000000 Z
13
+ date: 2014-10-20 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: http
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ~>
19
+ - - "~>"
22
20
  - !ruby/object:Gem::Version
23
21
  version: '0.6'
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ~>
26
+ - - "~>"
30
27
  - !ruby/object:Gem::Version
31
28
  version: '0.6'
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: multi_json
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ~>
33
+ - - "~>"
38
34
  - !ruby/object:Gem::Version
39
35
  version: '1'
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ~>
40
+ - - "~>"
46
41
  - !ruby/object:Gem::Version
47
42
  version: '1'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: bundler
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
49
  version: '1.6'
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ~>
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
56
  version: '1.6'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: rake
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ! '>='
61
+ - - ">="
70
62
  - !ruby/object:Gem::Version
71
63
  version: '0'
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ! '>='
68
+ - - ">="
78
69
  - !ruby/object:Gem::Version
79
70
  version: '0'
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: rspec
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ~>
75
+ - - "~>"
86
76
  - !ruby/object:Gem::Version
87
77
  version: '3'
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ~>
82
+ - - "~>"
94
83
  - !ruby/object:Gem::Version
95
84
  version: '3'
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: rspec-its
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ! '>='
89
+ - - ">="
102
90
  - !ruby/object:Gem::Version
103
91
  version: '0'
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
- - - ! '>='
96
+ - - ">="
110
97
  - !ruby/object:Gem::Version
111
98
  version: '0'
112
99
  - !ruby/object:Gem::Dependency
113
100
  name: rubocop
114
101
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
- - - ! '>='
103
+ - - ">="
118
104
  - !ruby/object:Gem::Version
119
105
  version: '0'
120
106
  type: :development
121
107
  prerelease: false
122
108
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
109
  requirements:
125
- - - ! '>='
110
+ - - ">="
126
111
  - !ruby/object:Gem::Version
127
112
  version: '0'
128
113
  - !ruby/object:Gem::Dependency
129
114
  name: reek
130
115
  requirement: !ruby/object:Gem::Requirement
131
- none: false
132
116
  requirements:
133
- - - ! '>='
117
+ - - ">="
134
118
  - !ruby/object:Gem::Version
135
119
  version: '0'
136
120
  type: :development
137
121
  prerelease: false
138
122
  version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
123
  requirements:
141
- - - ! '>='
124
+ - - ">="
142
125
  - !ruby/object:Gem::Version
143
126
  version: '0'
144
127
  - !ruby/object:Gem::Dependency
145
128
  name: vcr
146
129
  requirement: !ruby/object:Gem::Requirement
147
- none: false
148
130
  requirements:
149
- - - ! '>='
131
+ - - ">="
150
132
  - !ruby/object:Gem::Version
151
133
  version: '0'
152
134
  type: :development
153
135
  prerelease: false
154
136
  version_requirements: !ruby/object:Gem::Requirement
155
- none: false
156
137
  requirements:
157
- - - ! '>='
138
+ - - ">="
158
139
  - !ruby/object:Gem::Version
159
140
  version: '0'
160
141
  - !ruby/object:Gem::Dependency
161
142
  name: webmock
162
143
  requirement: !ruby/object:Gem::Requirement
163
- none: false
164
144
  requirements:
165
- - - ~>
145
+ - - "~>"
166
146
  - !ruby/object:Gem::Version
167
147
  version: '1'
168
- - - ! '>='
148
+ - - ">="
169
149
  - !ruby/object:Gem::Version
170
150
  version: 1.17.3
171
151
  type: :development
172
152
  prerelease: false
173
153
  version_requirements: !ruby/object:Gem::Requirement
174
- none: false
175
154
  requirements:
176
- - - ~>
155
+ - - "~>"
177
156
  - !ruby/object:Gem::Version
178
157
  version: '1'
179
- - - ! '>='
158
+ - - ">="
180
159
  - !ruby/object:Gem::Version
181
160
  version: 1.17.3
182
161
  description: Ruby client for the https://www.contentful.com Content Management API
@@ -189,11 +168,11 @@ executables:
189
168
  extensions: []
190
169
  extra_rdoc_files: []
191
170
  files:
192
- - .gitignore
193
- - .reek
194
- - .rspec
195
- - .rubocop.yml
196
- - .travis.yml
171
+ - ".gitignore"
172
+ - ".reek"
173
+ - ".rspec"
174
+ - ".rubocop.yml"
175
+ - ".travis.yml"
197
176
  - CHANGELOG.md
198
177
  - Gemfile
199
178
  - LICENSE.txt
@@ -238,6 +217,7 @@ files:
238
217
  - lib/contentful/management/space_locale_methods_factory.rb
239
218
  - lib/contentful/management/space_webhook_methods_factory.rb
240
219
  - lib/contentful/management/support.rb
220
+ - lib/contentful/management/validation.rb
241
221
  - lib/contentful/management/version.rb
242
222
  - lib/contentful/management/webhook.rb
243
223
  - spec/fixtures/vcr_cassettes/array_page_1.yml
@@ -323,6 +303,18 @@ files:
323
303
  - spec/fixtures/vcr_cassettes/content_type/update_remove_field.yml
324
304
  - spec/fixtures/vcr_cassettes/content_type/update_with_fields.yml
325
305
  - spec/fixtures/vcr_cassettes/content_type/update_with_one_new_field.yml
306
+ - spec/fixtures/vcr_cassettes/content_type/validation/in.yml
307
+ - spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml
308
+ - spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml
309
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml
310
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml
311
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml
312
+ - spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml
313
+ - spec/fixtures/vcr_cassettes/content_type/validation/present.yml
314
+ - spec/fixtures/vcr_cassettes/content_type/validation/range.yml
315
+ - spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml
316
+ - spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml
317
+ - spec/fixtures/vcr_cassettes/content_type/validation/size.yml
326
318
  - spec/fixtures/vcr_cassettes/entry/all.yml
327
319
  - spec/fixtures/vcr_cassettes/entry/archive.yml
328
320
  - spec/fixtures/vcr_cassettes/entry/archive_published.yml
@@ -364,6 +356,7 @@ files:
364
356
  - spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_greater_than_or_equal.yml
365
357
  - spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_less.yml
366
358
  - spec/fixtures/vcr_cassettes/entry/search_filter/reverse_order_sys_updatedAt.yml
359
+ - spec/fixtures/vcr_cassettes/entry/service_unavailable.yml
367
360
  - spec/fixtures/vcr_cassettes/entry/unarchive.yml
368
361
  - spec/fixtures/vcr_cassettes/entry/unarchive_already_unarchived.yml
369
362
  - spec/fixtures/vcr_cassettes/entry/unpublish.yml
@@ -411,6 +404,7 @@ files:
411
404
  - spec/fixtures/vcr_cassettes/space/update.yml
412
405
  - spec/fixtures/vcr_cassettes/space/update_with_the_same_data.yml
413
406
  - spec/fixtures/vcr_cassettes/space/webhook/all.yml
407
+ - spec/fixtures/vcr_cassettes/space/webhook/create.yml
414
408
  - spec/fixtures/vcr_cassettes/space/webhook/find.yml
415
409
  - spec/fixtures/vcr_cassettes/webhook/all.yml
416
410
  - spec/fixtures/vcr_cassettes/webhook/create.yml
@@ -432,33 +426,26 @@ files:
432
426
  homepage: https://github.com/contentful/contentful-management.rb
433
427
  licenses:
434
428
  - MIT
429
+ metadata: {}
435
430
  post_install_message:
436
431
  rdoc_options: []
437
432
  require_paths:
438
433
  - lib
439
434
  required_ruby_version: !ruby/object:Gem::Requirement
440
- none: false
441
435
  requirements:
442
- - - ! '>='
436
+ - - ">="
443
437
  - !ruby/object:Gem::Version
444
438
  version: '0'
445
- segments:
446
- - 0
447
- hash: 3064200717268341167
448
439
  required_rubygems_version: !ruby/object:Gem::Requirement
449
- none: false
450
440
  requirements:
451
- - - ! '>='
441
+ - - ">="
452
442
  - !ruby/object:Gem::Version
453
443
  version: '0'
454
- segments:
455
- - 0
456
- hash: 3064200717268341167
457
444
  requirements: []
458
445
  rubyforge_project:
459
- rubygems_version: 1.8.23
446
+ rubygems_version: 2.2.2
460
447
  signing_key:
461
- specification_version: 3
448
+ specification_version: 4
462
449
  summary: contentful management api
463
450
  test_files:
464
451
  - spec/fixtures/vcr_cassettes/array_page_1.yml
@@ -544,6 +531,18 @@ test_files:
544
531
  - spec/fixtures/vcr_cassettes/content_type/update_remove_field.yml
545
532
  - spec/fixtures/vcr_cassettes/content_type/update_with_fields.yml
546
533
  - spec/fixtures/vcr_cassettes/content_type/update_with_one_new_field.yml
534
+ - spec/fixtures/vcr_cassettes/content_type/validation/in.yml
535
+ - spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml
536
+ - spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml
537
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml
538
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml
539
+ - spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml
540
+ - spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml
541
+ - spec/fixtures/vcr_cassettes/content_type/validation/present.yml
542
+ - spec/fixtures/vcr_cassettes/content_type/validation/range.yml
543
+ - spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml
544
+ - spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml
545
+ - spec/fixtures/vcr_cassettes/content_type/validation/size.yml
547
546
  - spec/fixtures/vcr_cassettes/entry/all.yml
548
547
  - spec/fixtures/vcr_cassettes/entry/archive.yml
549
548
  - spec/fixtures/vcr_cassettes/entry/archive_published.yml
@@ -585,6 +584,7 @@ test_files:
585
584
  - spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_greater_than_or_equal.yml
586
585
  - spec/fixtures/vcr_cassettes/entry/search_filter/range_operators_less.yml
587
586
  - spec/fixtures/vcr_cassettes/entry/search_filter/reverse_order_sys_updatedAt.yml
587
+ - spec/fixtures/vcr_cassettes/entry/service_unavailable.yml
588
588
  - spec/fixtures/vcr_cassettes/entry/unarchive.yml
589
589
  - spec/fixtures/vcr_cassettes/entry/unarchive_already_unarchived.yml
590
590
  - spec/fixtures/vcr_cassettes/entry/unpublish.yml
@@ -632,6 +632,7 @@ test_files:
632
632
  - spec/fixtures/vcr_cassettes/space/update.yml
633
633
  - spec/fixtures/vcr_cassettes/space/update_with_the_same_data.yml
634
634
  - spec/fixtures/vcr_cassettes/space/webhook/all.yml
635
+ - spec/fixtures/vcr_cassettes/space/webhook/create.yml
635
636
  - spec/fixtures/vcr_cassettes/space/webhook/find.yml
636
637
  - spec/fixtures/vcr_cassettes/webhook/all.yml
637
638
  - spec/fixtures/vcr_cassettes/webhook/create.yml