contentful 0.4.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca7aa5d86409ba09e10e10ad5056804799157b03
4
- data.tar.gz: e8a7314fea96f4053656adaa1c88b1a0264f203d
3
+ metadata.gz: 7db63bec4505f15a7698a8a0a122429abbb5c06c
4
+ data.tar.gz: cd8c4030d47bfb4b63929e3dcf70f9cbb2326860
5
5
  SHA512:
6
- metadata.gz: 2f36a0f4e0bdef6bc0740a697f6b055eb4df6846af106695daf7dc9f54f47b9cdf914ed4ea0a5037591804920a81202c616b358779ff45826edfef168ffed596
7
- data.tar.gz: d019ae9b609ae364304b4057dabab58e736e3233c90ba2685e97ebbb39d371097d68fea725f8b485d5974519ec8ef6ff6a679ed765ac340e8d58c1e46aba95e4
6
+ metadata.gz: 1af685dcbe8e195a48c27d0c5c3ff7b4b3f4faed20dd636d899cec8c71e9c3f1790116fbb00bc65be89f917ee99806a87636458a1db1ffa3921d32fd710c9611
7
+ data.tar.gz: 55b018b32477efa92e8878f58ffb17bcf1eaa97618e4b3634f2e443f16eb7c39f11bd1cd5c5d9a9a00a901b69ca76bd058ab76a3dd2def95e51ff30b40694d99
@@ -1,4 +1,12 @@
1
1
  # Change Log
2
+ ## Unreleased
3
+ ### Fixed
4
+ * Better handling of 503 responses from the API [#48](https://github.com/contentful/contentful-management.rb/pull/48)
5
+ * Better handling of 429 responses from the API [#51](https://github.com/contentful/contentful-management.rb/pull/51)
6
+
7
+ ### Added
8
+ * `focus` and `fit` to image handling parameters [#44](https://github.com/contentful/contentful.rb/pull/44)
9
+
2
10
  ## 0.4.0
3
11
  ### Added
4
12
  * Proxy support
data/README.md CHANGED
@@ -24,6 +24,16 @@ client = Contentful::Client.new(
24
24
  )
25
25
  ```
26
26
 
27
+ If you plan on using the [Preview API](https://www.contentful.com/developers/documentation/content-delivery-api/ruby/#preview-api-usage) you need to specify the `api_url`:
28
+
29
+ ```ruby
30
+ client = Contentful::Client.new(
31
+ access_token: 'b4c0n73n7fu1',
32
+ space: 'cfexampleapi',
33
+ api_url: 'preview.contentful.com'
34
+ )
35
+ ```
36
+
27
37
  You can query for entries, assets, etc. very similar as described in the
28
38
  [Delivery API Documentation](https://www.contentful.com/developers/documentation/content-delivery-api/). Please note, that **all methods of the Ruby client library are snake_cased, instead of JavaScript's camelCase**:
29
39
 
@@ -18,10 +18,12 @@ module Contentful
18
18
  # See https://www.contentful.com/developers/documentation/content-delivery-api/#image-asset-resizing
19
19
  def image_url(options = {})
20
20
  query = {
21
- w: options[:w] || options[:width],
22
- h: options[:h] || options[:height],
23
- fm: options[:fm] || options[:format],
24
- q: options[:q] || options[:quality]
21
+ w: options[:w] || options[:width],
22
+ h: options[:h] || options[:height],
23
+ fm: options[:fm] || options[:format],
24
+ q: options[:q] || options[:quality],
25
+ f: options[:f] || options[:focus],
26
+ fit: options[:fit]
25
27
  }.reject { |_k, v| v.nil? }
26
28
 
27
29
  if query.empty?
@@ -12,24 +12,24 @@ module Contentful
12
12
  # See README for details
13
13
  class Client
14
14
  DEFAULT_CONFIGURATION = {
15
- secure: true,
16
- raise_errors: true,
17
- dynamic_entries: :manual,
18
- api_url: 'cdn.contentful.com',
19
- api_version: 1,
20
- authentication_mechanism: :header,
21
- resource_builder: ResourceBuilder,
22
- resource_mapping: {},
23
- entry_mapping: {},
24
- default_locale: 'en-US',
25
- raw_mode: false,
26
- gzip_encoded: false,
27
- logger: false,
28
- log_level: Logger::INFO,
29
- proxy_host: nil,
30
- proxy_username: nil,
31
- proxy_password: nil,
32
- proxy_port: nil
15
+ secure: true,
16
+ raise_errors: true,
17
+ dynamic_entries: :manual,
18
+ api_url: 'cdn.contentful.com',
19
+ api_version: 1,
20
+ authentication_mechanism: :header,
21
+ resource_builder: ResourceBuilder,
22
+ resource_mapping: {},
23
+ entry_mapping: {},
24
+ default_locale: 'en-US',
25
+ raw_mode: false,
26
+ gzip_encoded: false,
27
+ logger: false,
28
+ log_level: Logger::INFO,
29
+ proxy_host: nil,
30
+ proxy_username: nil,
31
+ proxy_password: nil,
32
+ proxy_port: nil
33
33
  }
34
34
 
35
35
  attr_reader :configuration, :dynamic_entry_cache, :logger, :proxy
@@ -63,10 +63,10 @@ module Contentful
63
63
 
64
64
  def proxy_params
65
65
  {
66
- host: configuration[:proxy_host],
67
- port: configuration[:proxy_port],
68
- username: configuration[:proxy_username],
69
- password: configuration[:proxy_password]
66
+ host: configuration[:proxy_host],
67
+ port: configuration[:proxy_port],
68
+ username: configuration[:proxy_username],
69
+ password: configuration[:proxy_password]
70
70
  }
71
71
  end
72
72
 
@@ -131,7 +131,7 @@ module Contentful
131
131
 
132
132
  # Returns the headers used for the HTTP requests
133
133
  def request_headers
134
- headers = {'User-Agent' => "RubyContentfulGem/#{Contentful::VERSION}"}
134
+ headers = { 'User-Agent' => "RubyContentfulGem/#{Contentful::VERSION}" }
135
135
  headers['Authorization'] = "Bearer #{configuration[:access_token]}" if configuration[:authentication_mechanism] == :header
136
136
  headers['Content-Type'] = "application/vnd.contentful.delivery.v#{configuration[:api_version].to_i}+json" if configuration[:api_version]
137
137
  headers['Accept-Encoding'] = 'gzip' if configuration[:gzip_encoded]
@@ -151,7 +151,7 @@ module Contentful
151
151
  # return Response objects instead
152
152
  def get(request, build_resource = true)
153
153
  url = request.absolute? ? request.url : base_url + request.url
154
- logger.info(request: {url: url, query: request.query, header: request_headers}) if logger
154
+ logger.info(request: { url: url, query: request.query, header: request_headers }) if logger
155
155
  response = Response.new(
156
156
  self.class.get_http(
157
157
  url,
@@ -179,12 +179,12 @@ module Contentful
179
179
  # See README for details.
180
180
  def update_dynamic_entry_cache!
181
181
  @dynamic_entry_cache = Hash[
182
- content_types(limit: 1000).map do |ct|
183
- [
184
- ct.id.to_sym,
185
- DynamicEntry.create(ct)
186
- ]
187
- end
182
+ content_types(limit: 1000).map do |ct|
183
+ [
184
+ ct.id.to_sym,
185
+ DynamicEntry.create(ct)
186
+ ]
187
+ end
188
188
  ]
189
189
  end
190
190
 
@@ -197,7 +197,7 @@ module Contentful
197
197
  # Create a new synchronisation object
198
198
  # Takes sync options or a sync_url
199
199
  # You will need to call #each_page or #first_page on it
200
- def sync(options = {initial: true})
200
+ def sync(options = { initial: true })
201
201
  Sync.new(self, options)
202
202
  end
203
203
 
@@ -21,9 +21,9 @@ module Contentful
21
21
  end
22
22
 
23
23
  fields_coercions = Hash[
24
- content_type.fields.map do |field|
25
- [field.id.to_sym, KNOWN_TYPES[field.type]]
26
- end
24
+ content_type.fields.map do |field|
25
+ [field.id.to_sym, KNOWN_TYPES[field.type]]
26
+ end
27
27
  ]
28
28
 
29
29
  Class.new DynamicEntry do
@@ -21,6 +21,8 @@ module Contentful
21
21
  AccessDenied
22
22
  when 401
23
23
  Unauthorized
24
+ when 429
25
+ RateLimitExceeded
24
26
  when 500
25
27
  ServerError
26
28
  when 503
@@ -43,6 +45,9 @@ module Contentful
43
45
  # 401
44
46
  class Unauthorized < Error; end
45
47
 
48
+ # 429
49
+ class RateLimitExceeded < Error; end
50
+
46
51
  # 500
47
52
  class ServerError < Error; end
48
53
 
@@ -9,7 +9,7 @@ module Contentful
9
9
  FIELDS_COERCIONS = {
10
10
  title: :string,
11
11
  description: :string,
12
- file: File,
12
+ file: File
13
13
  }
14
14
 
15
15
  def fields
@@ -39,11 +39,11 @@ module Contentful
39
39
  def self.included(base)
40
40
  base.extend(ClassMethods)
41
41
 
42
- base.fields_coercions.keys.each{ |name|
42
+ base.fields_coercions.keys.each do |name|
43
43
  base.send :define_method, Contentful::Support.snakify(name) do
44
44
  fields[name.to_sym]
45
45
  end
46
- }
46
+ end
47
47
  end
48
48
  end
49
49
  end
@@ -11,7 +11,7 @@ module Contentful
11
11
  revision: :integer,
12
12
  createdAt: :date,
13
13
  updatedAt: :date,
14
- locale: :string,
14
+ locale: :string
15
15
  }
16
16
  attr_reader :sys
17
17
 
@@ -37,11 +37,11 @@ module Contentful
37
37
  def self.included(base)
38
38
  base.extend(ClassMethods)
39
39
 
40
- base.sys_coercions.keys.each{ |name|
40
+ base.sys_coercions.keys.each do |name|
41
41
  base.send :define_method, Contentful::Support.snakify(name) do
42
42
  sys[name.to_sym]
43
43
  end
44
- }
44
+ end
45
45
  end
46
46
  end
47
47
  end
@@ -12,7 +12,7 @@ require_relative 'deleted_asset'
12
12
 
13
13
  module Contentful
14
14
  # Transforms a Contentful::Response into a Contentful::Resource or a Contentful::Error
15
- # See example/resource_mapping.rb for avanced usage
15
+ # See example/resource_mapping.rb for advanced usage
16
16
  class ResourceBuilder
17
17
  DEFAULT_RESOURCE_MAPPING = {
18
18
  'Space' => Space,
@@ -22,7 +22,7 @@ module Contentful
22
22
  'Array' => :array_or_sync_page,
23
23
  'Link' => Link,
24
24
  'DeletedEntry' => DeletedEntry,
25
- 'DeletedAsset' => DeletedAsset,
25
+ 'DeletedAsset' => DeletedAsset
26
26
  }
27
27
  DEFAULT_ENTRY_MAPPING = {}
28
28
 
@@ -103,9 +103,9 @@ module Contentful
103
103
  # Returns the id of the related ContentType, if there is one
104
104
  def content_type_id_for_entry(object)
105
105
  object['sys'] &&
106
- object['sys']['contentType'] &&
107
- object['sys']['contentType']['sys'] &&
108
- object['sys']['contentType']['sys']['id']
106
+ object['sys']['contentType'] &&
107
+ object['sys']['contentType']['sys'] &&
108
+ object['sys']['contentType']['sys']['id']
109
109
  end
110
110
 
111
111
  # Detects if a resource is an Contentful::Array or a SyncPage
@@ -163,9 +163,9 @@ module Contentful
163
163
  if object.is_a? Hash
164
164
  object.select do |_, v|
165
165
  v.is_a?(::Array) &&
166
- v.first &&
167
- v.first.is_a?(Hash) &&
168
- v.first.key?('sys')
166
+ v.first &&
167
+ v.first.is_a?(Hash) &&
168
+ v.first.key?('sys')
169
169
  end
170
170
  else
171
171
  {}
@@ -196,10 +196,10 @@ module Contentful
196
196
  if included_objects
197
197
  included_objects.each do |type, objects|
198
198
  @included_resources[type] = Hash[
199
- objects.map do |object|
200
- res = create_resource(object)
201
- [res.id, res]
202
- end
199
+ objects.map do |object|
200
+ res = create_resource(object)
201
+ [res.id, res]
202
+ end
203
203
  ]
204
204
  end
205
205
  end
@@ -31,8 +31,10 @@ module Contentful
31
31
  parse_json!
32
32
  elsif no_content_response?
33
33
  @status = :no_content
34
- elsif no_resource_or_bad_request?
34
+ elsif invalid_response?
35
35
  parse_contentful_error
36
+ elsif service_unavailable_response?
37
+ service_unavailable_error
36
38
  else
37
39
  parse_http_error
38
40
  end
@@ -54,12 +56,22 @@ module Contentful
54
56
  [200, 201].include?(raw.status)
55
57
  end
56
58
 
59
+ def service_unavailable_response?
60
+ @raw.status == 503
61
+ end
62
+
63
+ def service_unavailable_error
64
+ @status = :error
65
+ @error_message = 'Service Unavailable, contenful.com API seems to be down'
66
+ @object = Error[@raw.status].new(self)
67
+ end
68
+
57
69
  def parse_http_error
58
70
  @status = :error
59
71
  @object = Error[raw.status].new(self)
60
72
  end
61
73
 
62
- def no_resource_or_bad_request?
74
+ def invalid_response?
63
75
  [400, 404].include?(raw.status)
64
76
  end
65
77
 
@@ -1,3 +1,3 @@
1
1
  module Contentful
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -63,7 +63,7 @@ describe Contentful::Array do
63
63
  end
64
64
 
65
65
  it 'will return false if #request not available' do
66
- expect(Contentful::Array.new({}).reload).to be_false
66
+ expect(Contentful::Array.new({}).reload).to be_falsey
67
67
  end
68
68
  end
69
69
  end
@@ -54,9 +54,9 @@ describe Contentful::Asset do
54
54
  end
55
55
 
56
56
  it 'adds image options if given' do
57
- url = asset.image_url(width: 100, format: 'jpg', quality: 50)
57
+ url = asset.image_url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb')
58
58
  expect(url).to include asset.file.url
59
- expect(url).to include '?w=100&fm=jpg&q=50'
59
+ expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&fit=thumb'
60
60
  end
61
61
  end
62
62
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Contentful::Error do
4
- let(:r) { Contentful::Response.new raw_fixture('not_found',404) }
4
+ let(:r) { Contentful::Response.new raw_fixture('not_found', 404) }
5
5
 
6
6
  describe '#response' do
7
7
  it 'returns the response the error has been initialized with' do
@@ -28,26 +28,31 @@ describe Contentful::Error do
28
28
  end
29
29
 
30
30
  describe '.[]' do
31
- it 'returns NotFound error class for 404' do
32
- expect(Contentful::Error[404]).to eq Contentful::NotFound
33
- end
34
31
 
35
32
  it 'returns BadRequest error class for 400' do
36
33
  expect(Contentful::Error[400]).to eq Contentful::BadRequest
37
34
  end
38
35
 
36
+ it 'returns Unauthorized error class for 401' do
37
+ expect(Contentful::Error[401]).to eq Contentful::Unauthorized
38
+ end
39
+
39
40
  it 'returns AccessDenied error class for 403' do
40
41
  expect(Contentful::Error[403]).to eq Contentful::AccessDenied
41
42
  end
42
43
 
43
- it 'returns Unauthorized error class for 401' do
44
- expect(Contentful::Error[401]).to eq Contentful::Unauthorized
44
+ it 'returns NotFound error class for 404' do
45
+ expect(Contentful::Error[404]).to eq Contentful::NotFound
45
46
  end
46
47
 
47
48
  it 'returns ServerError error class for 500' do
48
49
  expect(Contentful::Error[500]).to eq Contentful::ServerError
49
50
  end
50
51
 
52
+ it 'returns ServiceUnavailable error class for 503' do
53
+ expect(Contentful::Error[503]).to eq Contentful::ServiceUnavailable
54
+ end
55
+
51
56
  it 'returns generic error class for any other value' do
52
57
  expect(Contentful::Error[nil]).to eq Contentful::Error
53
58
  expect(Contentful::Error[200]).to eq Contentful::Error
@@ -14,18 +14,33 @@ describe 'Error Requests' do
14
14
  end
15
15
 
16
16
  it 'will return 403 (AccessDenied) if ...' do
17
- pending
17
+ skip
18
18
  end
19
19
 
20
20
  it 'will return 401 (Unauthorized) if wrong credentials given' do
21
21
  client = Contentful::Client.new(space: 'wrong', access_token: 'credentials')
22
22
 
23
23
  expect_vcr('unauthorized'){
24
- client.entry 'nyancat'
24
+ client.entry('nyancat')
25
25
  }.to raise_error(Contentful::Unauthorized)
26
26
  end
27
27
 
28
28
  it 'will return 500 (ServerError) if ...' do
29
- pending
29
+ skip
30
+ end
31
+
32
+ it 'will return a 429 if the ratelimit is hit' do
33
+ client = Contentful::Client.new(space: 'wrong', access_token: 'credentials')
34
+ expect_vcr('ratelimit') {
35
+ client.entry('nyancat')
36
+ }.to raise_error(Contentful::RateLimitExceeded)
37
+ end
38
+
39
+ it 'will return 503 (ServiceUnavailable) if connection time out' do
40
+ client = Contentful::Client.new(space: 'wrong', access_token: 'credentials')
41
+
42
+ expect_vcr('unavailable'){
43
+ client.entry('nyancat')
44
+ }.to raise_error(Contentful::ServiceUnavailable)
30
45
  end
31
46
  end
@@ -26,11 +26,11 @@ describe Contentful::Field do
26
26
  end
27
27
 
28
28
  it 'has #required' do
29
- expect(field.required).to be_true
29
+ expect(field.required).to be_truthy
30
30
  end
31
31
 
32
32
  it 'has #localized' do
33
- expect(field.required).to be_true
33
+ expect(field.required).to be_truthy
34
34
  end
35
35
  end
36
36
  end
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/wrong/entries/nyancat
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulGem/0.1.1
12
+ Authorization:
13
+ - Bearer credentials
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Host:
17
+ - cdn.contentful.com
18
+ response:
19
+ status:
20
+ code: 429
21
+ message: ServiceUnavailable
22
+ headers:
23
+ Date:
24
+ - Wed, 16 Apr 2014 09:00:24 GMT
25
+ Server:
26
+ - nginx/1.1.19
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
29
+ Access-Control-Allow-Methods:
30
+ - GET,HEAD,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Max-Age:
34
+ - '86400'
35
+ Cache-Control:
36
+ - max-age=0
37
+ Content-Type:
38
+ - application/vnd.contentful.delivery.v1+json
39
+ Content-Length:
40
+ - '179'
41
+ Accept-Ranges:
42
+ - bytes
43
+ Via:
44
+ - 1.1 varnish
45
+ X-Served-By:
46
+ - cache-am72-AMS
47
+ X-Cache:
48
+ - MISS
49
+ X-Cache-Hits:
50
+ - '0'
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ {
55
+ "sys": {
56
+ "type": "Error",
57
+ "id": "RateLimitExceeded"
58
+ },
59
+ "message": "Ratelimit Exceeded",
60
+ "requestId": "85f-649640521"
61
+ }
62
+ http_version:
63
+ recorded_at: Wed, 16 Apr 2014 09:00:24 GMT
64
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/wrong/entries/nyancat
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulGem/0.1.1
12
+ Authorization:
13
+ - Bearer credentials
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Host:
17
+ - cdn.contentful.com
18
+ response:
19
+ status:
20
+ code: 503
21
+ message: ServiceUnavailable
22
+ headers:
23
+ Date:
24
+ - Wed, 16 Apr 2014 09:00:24 GMT
25
+ Server:
26
+ - nginx/1.1.19
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
29
+ Access-Control-Allow-Methods:
30
+ - GET,HEAD,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Max-Age:
34
+ - '86400'
35
+ Cache-Control:
36
+ - max-age=0
37
+ Content-Type:
38
+ - application/vnd.contentful.delivery.v1+json
39
+ Content-Length:
40
+ - '179'
41
+ Accept-Ranges:
42
+ - bytes
43
+ Via:
44
+ - 1.1 varnish
45
+ X-Served-By:
46
+ - cache-am72-AMS
47
+ X-Cache:
48
+ - MISS
49
+ X-Cache-Hits:
50
+ - '0'
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ {
55
+ "sys": {
56
+ "type": "Error",
57
+ "id": "ServiceUnavailable"
58
+ },
59
+ "message": "Service Unavailable, contenful.com API seems to be down",
60
+ "requestId": "85f-649640521"
61
+ }
62
+ http_version:
63
+ recorded_at: Wed, 16 Apr 2014 09:00:24 GMT
64
+ recorded_with: VCR 2.9.0
@@ -46,7 +46,7 @@ describe Contentful::Resource do
46
46
  end
47
47
 
48
48
  it 'will return false if #request not available' do
49
- expect(Contentful::ContentType.new({}).reload).to be_false
49
+ expect(Contentful::ContentType.new({}).reload).to be_falsey
50
50
  end
51
51
  end
52
52
  end
@@ -82,21 +82,21 @@ describe Contentful::SyncPage do
82
82
 
83
83
  describe '#next_page?' do
84
84
  it 'will return true if there is a next page' do
85
- expect(page_with_more.next_page?).to be_true
85
+ expect(page_with_more.next_page?).to be_truthy
86
86
  end
87
87
 
88
88
  it 'will return false if last page' do
89
- expect(page.next_page?).to be_false
89
+ expect(page.next_page?).to be_falsey
90
90
  end
91
91
  end
92
92
 
93
93
  describe '#last_page?' do
94
94
  it 'will return true if no more pages available' do
95
- expect(page.last_page?).to be_true
95
+ expect(page.last_page?).to be_truthy
96
96
  end
97
97
 
98
98
  it 'will return false if more pages available' do
99
- expect(page_with_more.last_page?).to be_false
99
+ expect(page_with_more.last_page?).to be_falsey
100
100
  end
101
101
  end
102
102
 
@@ -63,11 +63,11 @@ describe Contentful::Sync do
63
63
 
64
64
  describe '#completed?' do
65
65
  it 'will return true if no more pages to request in the current sync' do
66
- expect(first_page.next_sync_url).to be_false
66
+ expect(first_page.next_sync_url).to be_falsey
67
67
  end
68
68
 
69
69
  it 'will return true if not all pages requested, yet' do
70
- expect(last_page.next_sync_url).to be_true
70
+ expect(last_page.next_sync_url).to be_truthy
71
71
  end
72
72
  end
73
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (Jan Lelis)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-21 00:00:00.000000000 Z
12
+ date: 2015-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
@@ -234,6 +234,7 @@ files:
234
234
  - spec/fixtures/vcr_cassettes/location.yml
235
235
  - spec/fixtures/vcr_cassettes/not_found.yml
236
236
  - spec/fixtures/vcr_cassettes/nyancat.yml
237
+ - spec/fixtures/vcr_cassettes/ratelimit.yml
237
238
  - spec/fixtures/vcr_cassettes/reloaded_entry.yml
238
239
  - spec/fixtures/vcr_cassettes/space.yml
239
240
  - spec/fixtures/vcr_cassettes/sync_deleted_asset.yml
@@ -242,6 +243,7 @@ files:
242
243
  - spec/fixtures/vcr_cassettes/sync_page.yml
243
244
  - spec/fixtures/vcr_cassettes/sync_page_2.yml
244
245
  - spec/fixtures/vcr_cassettes/unauthorized.yml
246
+ - spec/fixtures/vcr_cassettes/unavailable.yml
245
247
  - spec/link_spec.rb
246
248
  - spec/locale_spec.rb
247
249
  - spec/location_spec.rb
@@ -318,6 +320,7 @@ test_files:
318
320
  - spec/fixtures/vcr_cassettes/location.yml
319
321
  - spec/fixtures/vcr_cassettes/not_found.yml
320
322
  - spec/fixtures/vcr_cassettes/nyancat.yml
323
+ - spec/fixtures/vcr_cassettes/ratelimit.yml
321
324
  - spec/fixtures/vcr_cassettes/reloaded_entry.yml
322
325
  - spec/fixtures/vcr_cassettes/space.yml
323
326
  - spec/fixtures/vcr_cassettes/sync_deleted_asset.yml
@@ -326,6 +329,7 @@ test_files:
326
329
  - spec/fixtures/vcr_cassettes/sync_page.yml
327
330
  - spec/fixtures/vcr_cassettes/sync_page_2.yml
328
331
  - spec/fixtures/vcr_cassettes/unauthorized.yml
332
+ - spec/fixtures/vcr_cassettes/unavailable.yml
329
333
  - spec/link_spec.rb
330
334
  - spec/locale_spec.rb
331
335
  - spec/location_spec.rb