contentful 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +7 -0
- data/README.md +8 -0
- data/lib/contentful/array.rb +10 -1
- data/lib/contentful/asset.rb +15 -9
- data/lib/contentful/client.rb +24 -6
- data/lib/contentful/locale.rb +9 -6
- data/lib/contentful/resource_builder.rb +4 -2
- data/lib/contentful/version.rb +1 -1
- data/spec/asset_spec.rb +4 -4
- data/spec/client_class_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/array.yml +1 -1
- data/spec/fixtures/vcr_cassettes/array/marshal_custom_classes.yml +2 -2
- data/spec/fixtures/vcr_cassettes/array/nested_resources.yml +2 -2
- data/spec/fixtures/vcr_cassettes/arrayField.yml +1 -1
- data/spec/fixtures/vcr_cassettes/array_page_1.yml +1 -1
- data/spec/fixtures/vcr_cassettes/array_page_2.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/select_empty_array.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/select_no_sys.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/select_one_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/select_only_sys.yml +1 -1
- data/spec/fixtures/vcr_cassettes/assets/issues_129.yml +1 -1
- data/spec/fixtures/vcr_cassettes/assets/issues_jekyll_46.yml +1 -1
- data/spec/fixtures/vcr_cassettes/bad_request.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entries.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entries/issue_117.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entries/issue_125.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entries/unresolvable_filter.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/custom_resource.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/include_resolution.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/include_resolution_uniques.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/json_objects.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/json_objects_client.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/marshal_138.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/marshall.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/raw.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/search_link_to_asset.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/search_link_to_entry.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/search_link_to_entry_with_custom_query.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/select_empty_array.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/select_no_sys.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/select_one_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/select_one_field_proper.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/select_only_sys.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry_cache.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry_locales.yml +1 -1
- data/spec/fixtures/vcr_cassettes/field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/human.yml +1 -1
- data/spec/fixtures/vcr_cassettes/linkField.yml +1 -1
- data/spec/fixtures/vcr_cassettes/locale_from_environment.yml +121 -0
- data/spec/fixtures/vcr_cassettes/location.yml +2 -2
- data/spec/fixtures/vcr_cassettes/multi_locale_array_reference.yml +2 -2
- data/spec/fixtures/vcr_cassettes/multi_locale_reference.yml +2 -2
- data/spec/fixtures/vcr_cassettes/not_found.yml +1 -1
- data/spec/fixtures/vcr_cassettes/nyancat.yml +1 -1
- data/spec/fixtures/vcr_cassettes/ratelimit.yml +1 -1
- data/spec/fixtures/vcr_cassettes/ratelimit_retry.yml +4 -4
- data/spec/fixtures/vcr_cassettes/reloaded_entry.yml +1 -1
- data/spec/fixtures/vcr_cassettes/unauthorized.yml +1 -1
- data/spec/fixtures/vcr_cassettes/unavailable.yml +1 -1
- data/spec/locale_spec.rb +18 -0
- data/spec/sync_spec.rb +6 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ff3b16a838646c1c0c399926f04bd69663c9d6517cb9167f37ac740fc90ca9ca
|
4
|
+
data.tar.gz: eb3f1acd093e200ab5b6cc6f8ee109bfe09d75a3b9ca4fe0b197ec0fa39ec95c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232a38cd11a80e04ee4e4fb22f7d74e47591340a9209fdee88ade19267e43a791205e93516964aa1bbe02556dde9f3bd09a956d44927698e2c4e02ea062846b5
|
7
|
+
data.tar.gz: '0787ffe99edaa76e132ed2cbbfc26328fc52f28d250cff848a648b8b02a12b58eb954ff2276c2e1dd9cedb5403f7642a3e5ac1dd544c8ad0a09fe0e5ada2c89c'
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.6.0
|
6
|
+
### Changed
|
7
|
+
* Makes all routes environment aware. This change is not backwards incompatible.
|
8
|
+
|
9
|
+
### Added
|
10
|
+
* Added `locales` endpoint to retrieve locales from an environment.
|
11
|
+
|
5
12
|
## 2.5.0
|
6
13
|
### Added
|
7
14
|
* Add filtering of invalid entries from API responses.
|
data/README.md
CHANGED
@@ -169,6 +169,14 @@ Required option. The name of the space you want to access.
|
|
169
169
|
|
170
170
|
Required option. The space's secret token.
|
171
171
|
|
172
|
+
### :default_locale
|
173
|
+
|
174
|
+
Defines default locale for the client. Defaults to `en-US`.
|
175
|
+
|
176
|
+
### :environment
|
177
|
+
|
178
|
+
Defines default environment to access. Defaults to `master`.
|
179
|
+
|
172
180
|
### :secure
|
173
181
|
|
174
182
|
Whether to use https. Defaults to `true`.
|
data/lib/contentful/array.rb
CHANGED
@@ -59,9 +59,18 @@ module Contentful
|
|
59
59
|
# @return [Contentful::Array, false]
|
60
60
|
def next_page(client = nil)
|
61
61
|
return false if client.nil?
|
62
|
+
return false if items.first.nil?
|
62
63
|
|
63
64
|
new_skip = (skip || 0) + (limit || DEFAULT_LIMIT)
|
64
|
-
|
65
|
+
|
66
|
+
plurals = {
|
67
|
+
'Space' => 'spaces',
|
68
|
+
'ContentType' => 'content_types',
|
69
|
+
'Entry' => 'entries',
|
70
|
+
'Asset' => 'assets',
|
71
|
+
'Locale' => 'locales'
|
72
|
+
}
|
73
|
+
client.public_send(plurals[items.first.type], limit: limit, skip: new_skip)
|
65
74
|
end
|
66
75
|
end
|
67
76
|
end
|
data/lib/contentful/asset.rb
CHANGED
@@ -44,19 +44,12 @@ module Contentful
|
|
44
44
|
# @option options [String] :focus
|
45
45
|
# @option options [String] :fit
|
46
46
|
# @option options [String] :fl File Layering - 'progressive'
|
47
|
+
# @option options [String] :background
|
47
48
|
# @see _ https://www.contentful.com/developers/documentation/content-delivery-api/#image-asset-resizing
|
48
49
|
#
|
49
50
|
# @return [String] Image API URL
|
50
51
|
def image_url(options = {})
|
51
|
-
query =
|
52
|
-
w: options[:w] || options[:width],
|
53
|
-
h: options[:h] || options[:height],
|
54
|
-
fm: options[:fm] || options[:format],
|
55
|
-
q: options[:q] || options[:quality],
|
56
|
-
f: options[:f] || options[:focus],
|
57
|
-
fit: options[:fit],
|
58
|
-
fl: options[:fl]
|
59
|
-
}.reject { |_k, v| v.nil? }
|
52
|
+
query = build_query(options)
|
60
53
|
|
61
54
|
if query.empty?
|
62
55
|
file.url
|
@@ -69,6 +62,19 @@ module Contentful
|
|
69
62
|
|
70
63
|
private
|
71
64
|
|
65
|
+
def build_query(options)
|
66
|
+
{
|
67
|
+
w: options[:w] || options[:width],
|
68
|
+
h: options[:h] || options[:height],
|
69
|
+
fm: options[:fm] || options[:format],
|
70
|
+
q: options[:q] || options[:quality],
|
71
|
+
f: options[:f] || options[:focus],
|
72
|
+
bg: options[:bg] || options[:background],
|
73
|
+
fit: options[:fit],
|
74
|
+
fl: options[:fl]
|
75
|
+
}.reject { |_k, v| v.nil? }
|
76
|
+
end
|
77
|
+
|
72
78
|
def create_files!
|
73
79
|
file_json = raw.fetch('fields', {}).fetch('file', nil)
|
74
80
|
return if file_json.nil?
|
data/lib/contentful/client.rb
CHANGED
@@ -20,6 +20,7 @@ module Contentful
|
|
20
20
|
dynamic_entries: :manual,
|
21
21
|
api_url: 'cdn.contentful.com',
|
22
22
|
api_version: 1,
|
23
|
+
environment: 'master',
|
23
24
|
authentication_mechanism: :header,
|
24
25
|
resource_builder: ResourceBuilder,
|
25
26
|
resource_mapping: {},
|
@@ -129,7 +130,7 @@ module Contentful
|
|
129
130
|
#
|
130
131
|
# @return [Contentful::ContentType]
|
131
132
|
def content_type(id, query = {})
|
132
|
-
Request.new(self, '/content_types', query, id).get
|
133
|
+
Request.new(self, environment_url('/content_types'), query, id).get
|
133
134
|
end
|
134
135
|
|
135
136
|
# Gets a collection of content types
|
@@ -138,7 +139,7 @@ module Contentful
|
|
138
139
|
#
|
139
140
|
# @return [Contentful::Array<Contentful::ContentType>]
|
140
141
|
def content_types(query = {})
|
141
|
-
Request.new(self, '/content_types', query).get
|
142
|
+
Request.new(self, environment_url('/content_types'), query).get
|
142
143
|
end
|
143
144
|
|
144
145
|
# Gets a specific entry
|
@@ -150,7 +151,7 @@ module Contentful
|
|
150
151
|
def entry(id, query = {})
|
151
152
|
normalize_select!(query)
|
152
153
|
query['sys.id'] = id
|
153
|
-
entries = Request.new(self, '/entries', query).get
|
154
|
+
entries = Request.new(self, environment_url('/entries'), query).get
|
154
155
|
|
155
156
|
return entries if configuration[:raw_mode]
|
156
157
|
|
@@ -164,7 +165,7 @@ module Contentful
|
|
164
165
|
# @return [Contentful::Array<Contentful::Entry>]
|
165
166
|
def entries(query = {})
|
166
167
|
normalize_select!(query)
|
167
|
-
Request.new(self, '/entries', query).get
|
168
|
+
Request.new(self, environment_url('/entries'), query).get
|
168
169
|
end
|
169
170
|
|
170
171
|
# Gets a specific asset
|
@@ -174,7 +175,7 @@ module Contentful
|
|
174
175
|
#
|
175
176
|
# @return [Contentful::Asset]
|
176
177
|
def asset(id, query = {})
|
177
|
-
Request.new(self, '/assets', query, id).get
|
178
|
+
Request.new(self, environment_url('/assets'), query, id).get
|
178
179
|
end
|
179
180
|
|
180
181
|
# Gets a collection of assets
|
@@ -184,7 +185,16 @@ module Contentful
|
|
184
185
|
# @return [Contentful::Array<Contentful::Asset>]
|
185
186
|
def assets(query = {})
|
186
187
|
normalize_select!(query)
|
187
|
-
Request.new(self, '/assets', query).get
|
188
|
+
Request.new(self, environment_url('/assets'), query).get
|
189
|
+
end
|
190
|
+
|
191
|
+
# Gets a collection of locales for the current environment
|
192
|
+
#
|
193
|
+
# @param [Hash] query
|
194
|
+
#
|
195
|
+
# @return [Contentful::Array<Contentful::Locale>]
|
196
|
+
def locales(query = {})
|
197
|
+
Request.new(self, environment_url('/locales'), query).get
|
188
198
|
end
|
189
199
|
|
190
200
|
# Returns the base url for all of the client's requests
|
@@ -193,6 +203,12 @@ module Contentful
|
|
193
203
|
"http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/spaces/#{configuration[:space]}"
|
194
204
|
end
|
195
205
|
|
206
|
+
# Returns the url aware of the currently selected environment
|
207
|
+
# @private
|
208
|
+
def environment_url(path)
|
209
|
+
"/environments/#{configuration[:environment]}#{path}"
|
210
|
+
end
|
211
|
+
|
196
212
|
# Returns the formatted part of the X-Contentful-User-Agent header
|
197
213
|
# @private
|
198
214
|
def format_user_agent_header(key, values)
|
@@ -380,6 +396,8 @@ module Contentful
|
|
380
396
|
#
|
381
397
|
# @return [Contentful::Sync]
|
382
398
|
def sync(options = { initial: true })
|
399
|
+
fail ArgumentError, 'Sync is not supported for non master environments' unless configuration[:environment] == 'master'
|
400
|
+
|
383
401
|
Sync.new(self, options)
|
384
402
|
end
|
385
403
|
|
data/lib/contentful/locale.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
+
require_relative 'base_resource'
|
2
|
+
|
1
3
|
module Contentful
|
2
4
|
# A Locale definition as included in Space
|
3
5
|
# Read more about Localization at https://www.contentful.com/developers/documentation/content-delivery-api/#i18n
|
4
|
-
class Locale
|
5
|
-
attr_reader :code, :name, :default
|
6
|
+
class Locale < BaseResource
|
7
|
+
attr_reader :code, :name, :default, :fallback_code
|
6
8
|
|
7
|
-
def initialize(
|
8
|
-
@code =
|
9
|
-
@name =
|
10
|
-
@default =
|
9
|
+
def initialize(item, *)
|
10
|
+
@code = item.fetch('code', nil)
|
11
|
+
@name = item.fetch('name', nil)
|
12
|
+
@default = item.fetch('default', false)
|
13
|
+
@fallback_code = item.fetch('fallbackCode', nil)
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
@@ -7,6 +7,7 @@ require_relative 'array'
|
|
7
7
|
require_relative 'link'
|
8
8
|
require_relative 'deleted_entry'
|
9
9
|
require_relative 'deleted_asset'
|
10
|
+
require_relative 'locale'
|
10
11
|
|
11
12
|
module Contentful
|
12
13
|
# Transforms a Contentful::Response into a Contentful::Resource or a Contentful::Error
|
@@ -22,7 +23,8 @@ module Contentful
|
|
22
23
|
'Array' => Array,
|
23
24
|
'Link' => Link,
|
24
25
|
'DeletedEntry' => DeletedEntry,
|
25
|
-
'DeletedAsset' => DeletedAsset
|
26
|
+
'DeletedAsset' => DeletedAsset,
|
27
|
+
'Locale' => Locale
|
26
28
|
}
|
27
29
|
# Default Entry Mapping
|
28
30
|
# @see _ README for more information on Entry Mapping
|
@@ -73,7 +75,7 @@ module Contentful
|
|
73
75
|
end
|
74
76
|
|
75
77
|
def build_item(item, includes = [], errors = [])
|
76
|
-
buildables = %w(Entry Asset ContentType Space DeletedEntry DeletedAsset)
|
78
|
+
buildables = %w(Entry Asset ContentType Space DeletedEntry DeletedAsset Locale)
|
77
79
|
item_type = buildables.detect { |b| b.to_s == item['sys']['type'] }
|
78
80
|
fail UnparsableResource, 'Item type is not known, could not parse' if item_type.nil?
|
79
81
|
item_class = resource_class(item)
|
data/lib/contentful/version.rb
CHANGED
data/spec/asset_spec.rb
CHANGED
@@ -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, focus: 'top_right', fit: 'thumb', fl: 'progressive')
|
57
|
+
url = asset.image_url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb', fl: 'progressive', background: 'rgb:ff0000')
|
58
58
|
expect(url).to include asset.file.url
|
59
|
-
expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&fit=thumb&fl=progressive'
|
59
|
+
expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&bg=rgb%3Aff0000&fit=thumb&fl=progressive'
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -66,9 +66,9 @@ describe Contentful::Asset do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'adds image options if given' do
|
69
|
-
url = asset.url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb', fl: 'progressive')
|
69
|
+
url = asset.url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb', fl: 'progressive', background: 'rgb:ff0000')
|
70
70
|
expect(url).to include asset.file.url
|
71
|
-
expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&fit=thumb&fl=progressive'
|
71
|
+
expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&bg=rgb%3Aff0000&fit=thumb&fl=progressive'
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
data/spec/client_class_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Contentful::Client do
|
|
6
6
|
let(:proxy_client) { create_client(proxy_host: '183.207.232.194',
|
7
7
|
proxy_port: 8080,
|
8
8
|
secure: false) }
|
9
|
-
let(:request) { Contentful::Request.new(nil, '/content_types', nil, 'cat') }
|
9
|
+
let(:request) { Contentful::Request.new(nil, client.environment_url('/content_types'), nil, 'cat') }
|
10
10
|
|
11
11
|
it 'uses #base_url' do
|
12
12
|
expect(client).to receive(:base_url).and_call_original
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -80,7 +80,7 @@ http_interactions:
|
|
80
80
|
recorded_at: Thu, 17 Aug 2017 12:23:27 GMT
|
81
81
|
- request:
|
82
82
|
method: get
|
83
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/entries?content_type=parent
|
83
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/entries?content_type=parent
|
84
84
|
body:
|
85
85
|
encoding: US-ASCII
|
86
86
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -80,7 +80,7 @@ http_interactions:
|
|
80
80
|
recorded_at: Thu, 03 Aug 2017 16:22:25 GMT
|
81
81
|
- request:
|
82
82
|
method: get
|
83
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/entries?content_type=child
|
83
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/entries?content_type=child
|
84
84
|
body:
|
85
85
|
encoding: US-ASCII
|
86
86
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/wl1z0pal05vy/content_types/2PqfXUJwE8qSYKuM0U6w8M
|
5
|
+
uri: https://cdn.contentful.com/spaces/wl1z0pal05vy/environments/master/content_types/2PqfXUJwE8qSYKuM0U6w8M
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/content_types?limit=2&skip=3
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/content_types?limit=2&skip=3
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/content_types?limit=2&skip=5
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/content_types?limit=2&skip=5
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/assets?select=sys&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/assets?select=sys&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/assets?select=fields,sys&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/assets?select=fields,sys&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/assets?select=sys,fields.file
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/assets?select=sys,fields.file
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/bht13amj0fva/assets?locale=*&sys.id=14bZJKTr6AoaGyeg4kYiWq
|
5
|
+
uri: https://cdn.contentful.com/spaces/bht13amj0fva/environments/master/assets?locale=*&sys.id=14bZJKTr6AoaGyeg4kYiWq
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/bht13amj0fva/assets?locale=es&sys.id=14bZJKTr6AoaGyeg4kYiWq
|
5
|
+
uri: https://cdn.contentful.com/spaces/bht13amj0fva/environments/master/assets?locale=es&sys.id=14bZJKTr6AoaGyeg4kYiWq
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -87,7 +87,7 @@ http_interactions:
|
|
87
87
|
recorded_at: Tue, 03 Jan 2017 11:34:30 GMT
|
88
88
|
- request:
|
89
89
|
method: get
|
90
|
-
uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/entries
|
90
|
+
uri: https://cdn.contentful.com/spaces/8jbbayggj9gj/environments/master/entries
|
91
91
|
body:
|
92
92
|
encoding: US-ASCII
|
93
93
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/zui87wsu8q80/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/zui87wsu8q80/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -86,7 +86,7 @@ http_interactions:
|
|
86
86
|
recorded_at: Wed, 05 Apr 2017 15:22:28 GMT
|
87
87
|
- request:
|
88
88
|
method: get
|
89
|
-
uri: https://cdn.contentful.com/spaces/zui87wsu8q80/entries
|
89
|
+
uri: https://cdn.contentful.com/spaces/zui87wsu8q80/environments/master/entries
|
90
90
|
body:
|
91
91
|
encoding: US-ASCII
|
92
92
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/011npgaszg5o/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/011npgaszg5o/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -80,7 +80,7 @@ http_interactions:
|
|
80
80
|
recorded_at: Mon, 05 Mar 2018 15:21:05 GMT
|
81
81
|
- request:
|
82
82
|
method: get
|
83
|
-
uri: https://cdn.contentful.com/spaces/011npgaszg5o/entries?sys.id=1HR1QvURo4MoSqO0eqmUeO
|
83
|
+
uri: https://cdn.contentful.com/spaces/011npgaszg5o/environments/master/entries?sys.id=1HR1QvURo4MoSqO0eqmUeO
|
84
84
|
body:
|
85
85
|
encoding: US-ASCII
|
86
86
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/g2b4ltw00meh/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/g2b4ltw00meh/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -86,7 +86,7 @@ http_interactions:
|
|
86
86
|
recorded_at: Mon, 07 Dec 2015 17:08:37 GMT
|
87
87
|
- request:
|
88
88
|
method: get
|
89
|
-
uri: https://cdn.contentful.com/spaces/g2b4ltw00meh/entries
|
89
|
+
uri: https://cdn.contentful.com/spaces/g2b4ltw00meh/environments/master/entries
|
90
90
|
body:
|
91
91
|
encoding: US-ASCII
|
92
92
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?include=2&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?include=2&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/v7cxgyxt0w5x/entries?include=10&sys.id=1nLXjjWvk4MEeWeQCWmymc
|
5
|
+
uri: https://cdn.contentful.com/spaces/v7cxgyxt0w5x/environments/master/entries?include=10&sys.id=1nLXjjWvk4MEeWeQCWmymc
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -80,7 +80,7 @@ http_interactions:
|
|
80
80
|
recorded_at: Tue, 25 Jul 2017 20:12:57 GMT
|
81
81
|
- request:
|
82
82
|
method: get
|
83
|
-
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/entries?sys.id=5aV3O0l5jU0cwQ2OkyYsyU
|
83
|
+
uri: https://cdn.contentful.com/spaces/j8tb59fszch7/environments/master/entries?sys.id=5aV3O0l5jU0cwQ2OkyYsyU
|
84
84
|
body:
|
85
85
|
encoding: US-ASCII
|
86
86
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?include=2&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?include=2&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -101,7 +101,7 @@ http_interactions:
|
|
101
101
|
recorded_at: Tue, 20 Dec 2016 15:27:44 GMT
|
102
102
|
- request:
|
103
103
|
method: get
|
104
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?sys.id=nyancat
|
104
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?sys.id=nyancat
|
105
105
|
body:
|
106
106
|
encoding: US-ASCII
|
107
107
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?links_to_asset=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?links_to_asset=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?links_to_entry=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?links_to_entry=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?content_type=cat&links_to_entry=nyancat&select=fields.name,sys
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?content_type=cat&links_to_entry=nyancat&select=fields.name,sys
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?select=sys&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?select=sys&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?select=fields,sys&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?select=fields,sys&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?select=sys,fields.name&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?select=sys,fields.name&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?content_type=cat&select=sys,fields.name&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?content_type=cat&select=sys,fields.name&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?select=sys&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?select=sys&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?locale=*&sys.id=nyancat
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/entries?locale=*&sys.id=nyancat
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -0,0 +1,121 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cdn.contentful.com/spaces/facgnwwgj5fe/environments/testing/locales
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
X-Contentful-User-Agent:
|
11
|
+
- sdk contentful.rb/2.4.0; platform ruby/2.4.1; os macOS/16;
|
12
|
+
Authorization:
|
13
|
+
- Bearer <ACCESS_TOKEN>
|
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
|
+
User-Agent:
|
23
|
+
- http.rb/2.2.2
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Access-Control-Allow-Headers:
|
30
|
+
- 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,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature
|
31
|
+
Access-Control-Allow-Methods:
|
32
|
+
- GET,HEAD,OPTIONS
|
33
|
+
Access-Control-Allow-Origin:
|
34
|
+
- "*"
|
35
|
+
Access-Control-Expose-Headers:
|
36
|
+
- Etag
|
37
|
+
Access-Control-Max-Age:
|
38
|
+
- '86400'
|
39
|
+
Cache-Control:
|
40
|
+
- max-age=0
|
41
|
+
Content-Type:
|
42
|
+
- application/vnd.contentful.delivery.v1+json
|
43
|
+
Etag:
|
44
|
+
- '"933cd424e0bbb10faa1c119a7c478a36"'
|
45
|
+
Server:
|
46
|
+
- Contentful
|
47
|
+
X-Content-Type-Options:
|
48
|
+
- nosniff
|
49
|
+
X-Contentful-Request-Id:
|
50
|
+
- b203a8e779b889882f508d217513881c
|
51
|
+
Content-Length:
|
52
|
+
- '779'
|
53
|
+
Accept-Ranges:
|
54
|
+
- bytes
|
55
|
+
Date:
|
56
|
+
- Tue, 27 Feb 2018 10:39:00 GMT
|
57
|
+
Via:
|
58
|
+
- 1.1 varnish
|
59
|
+
Age:
|
60
|
+
- '1019'
|
61
|
+
Connection:
|
62
|
+
- close
|
63
|
+
X-Served-By:
|
64
|
+
- cache-hhn1545-HHN
|
65
|
+
X-Cache:
|
66
|
+
- HIT
|
67
|
+
X-Cache-Hits:
|
68
|
+
- '1'
|
69
|
+
X-Timer:
|
70
|
+
- S1519727940.115595,VS0,VE1
|
71
|
+
Vary:
|
72
|
+
- Accept-Encoding
|
73
|
+
body:
|
74
|
+
encoding: ASCII-8BIT
|
75
|
+
string: |
|
76
|
+
{
|
77
|
+
"sys": {
|
78
|
+
"type": "Array"
|
79
|
+
},
|
80
|
+
"total": 3,
|
81
|
+
"skip": 0,
|
82
|
+
"limit": 1000,
|
83
|
+
"items": [
|
84
|
+
{
|
85
|
+
"code": "en-US",
|
86
|
+
"name": "U.S. English",
|
87
|
+
"default": true,
|
88
|
+
"fallbackCode": null,
|
89
|
+
"sys": {
|
90
|
+
"id": "1NkEdf220AtNFVgJO9fFQ2",
|
91
|
+
"type": "Locale",
|
92
|
+
"version": 1
|
93
|
+
}
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"code": "foo",
|
97
|
+
"name": "foobar",
|
98
|
+
"default": false,
|
99
|
+
"fallbackCode": null,
|
100
|
+
"sys": {
|
101
|
+
"id": "2QKRtwD3DKOkYKXJJsYdHk",
|
102
|
+
"type": "Locale",
|
103
|
+
"version": 1
|
104
|
+
}
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"code": "foo-BB",
|
108
|
+
"name": "Foo (BarBaz)",
|
109
|
+
"default": false,
|
110
|
+
"fallbackCode": "en-US",
|
111
|
+
"sys": {
|
112
|
+
"id": "4YnLeSNLymCAZ6eYwJmhzu",
|
113
|
+
"type": "Locale",
|
114
|
+
"version": 1
|
115
|
+
}
|
116
|
+
}
|
117
|
+
]
|
118
|
+
}
|
119
|
+
http_version:
|
120
|
+
recorded_at: Tue, 27 Feb 2018 10:39:00 GMT
|
121
|
+
recorded_with: VCR 3.0.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/lzjz8hygvfgu/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/lzjz8hygvfgu/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -93,7 +93,7 @@ http_interactions:
|
|
93
93
|
recorded_at: Tue, 20 Dec 2016 16:26:49 GMT
|
94
94
|
- request:
|
95
95
|
method: get
|
96
|
-
uri: https://cdn.contentful.com/spaces/lzjz8hygvfgu/entries?sys.id=3f6fq5ylFCi4kIYAQKsAYG
|
96
|
+
uri: https://cdn.contentful.com/spaces/lzjz8hygvfgu/environments/master/entries?sys.id=3f6fq5ylFCi4kIYAQKsAYG
|
97
97
|
body:
|
98
98
|
encoding: US-ASCII
|
99
99
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cma9f9g4dxvs/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/cma9f9g4dxvs/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -89,7 +89,7 @@ http_interactions:
|
|
89
89
|
recorded_at: Thu, 05 Jan 2017 20:41:38 GMT
|
90
90
|
- request:
|
91
91
|
method: get
|
92
|
-
uri: https://cdn.contentful.com/spaces/cma9f9g4dxvs/entries?content_type=test&locale=*
|
92
|
+
uri: https://cdn.contentful.com/spaces/cma9f9g4dxvs/environments/master/entries?content_type=test&locale=*
|
93
93
|
body:
|
94
94
|
encoding: US-ASCII
|
95
95
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/1sjfpsn7l90g/content_types?limit=1000
|
5
|
+
uri: https://cdn.contentful.com/spaces/1sjfpsn7l90g/environments/master/content_types?limit=1000
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -117,7 +117,7 @@ http_interactions:
|
|
117
117
|
recorded_at: Thu, 29 Sep 2016 22:12:09 GMT
|
118
118
|
- request:
|
119
119
|
method: get
|
120
|
-
uri: https://cdn.contentful.com/spaces/1sjfpsn7l90g/entries?locale=*
|
120
|
+
uri: https://cdn.contentful.com/spaces/1sjfpsn7l90g/environments/master/entries?locale=*
|
121
121
|
body:
|
122
122
|
encoding: US-ASCII
|
123
123
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdn.contentful.com/spaces/cfexampleapi/content_types/not%20found
|
5
|
+
uri: https://cdn.contentful.com/spaces/cfexampleapi/environments/master/content_types/not%20found
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/assets
|
5
|
+
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/environments/master/assets
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -65,7 +65,7 @@ http_interactions:
|
|
65
65
|
recorded_at: Tue, 09 Aug 2016 08:46:00 GMT
|
66
66
|
- request:
|
67
67
|
method: get
|
68
|
-
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/assets
|
68
|
+
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/environments/master/assets
|
69
69
|
body:
|
70
70
|
encoding: US-ASCII
|
71
71
|
string: ''
|
@@ -141,7 +141,7 @@ http_interactions:
|
|
141
141
|
recorded_at: Tue, 09 Aug 2016 08:46:00 GMT
|
142
142
|
- request:
|
143
143
|
method: get
|
144
|
-
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/assets
|
144
|
+
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/environments/master/assets
|
145
145
|
body:
|
146
146
|
encoding: US-ASCII
|
147
147
|
string: ''
|
@@ -217,7 +217,7 @@ http_interactions:
|
|
217
217
|
recorded_at: Tue, 09 Aug 2016 08:46:00 GMT
|
218
218
|
- request:
|
219
219
|
method: get
|
220
|
-
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/assets
|
220
|
+
uri: https://cdnorigin.flinkly.com/spaces/164vhtp008kz/environments/master/assets
|
221
221
|
body:
|
222
222
|
encoding: US-ASCII
|
223
223
|
string: ''
|
data/spec/locale_spec.rb
CHANGED
@@ -16,4 +16,22 @@ describe Contentful::Locale do
|
|
16
16
|
expect(locale.default).to eq true
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
describe 'locales endpoint' do
|
21
|
+
it 'locales can be fetched from environments' do
|
22
|
+
vcr('locale_from_environment') {
|
23
|
+
client = create_client(
|
24
|
+
space: 'facgnwwgj5fe',
|
25
|
+
access_token: '<ACCESS_TOKEN>',
|
26
|
+
environment: 'testing'
|
27
|
+
)
|
28
|
+
|
29
|
+
locales = client.locales
|
30
|
+
|
31
|
+
expect(locales).to be_a ::Contentful::Array
|
32
|
+
expect(locales.first).to be_a ::Contentful::Locale
|
33
|
+
expect(locales.first.code).to eq 'en-US'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
19
37
|
end
|
data/spec/sync_spec.rb
CHANGED
@@ -19,6 +19,12 @@ describe Contentful::Sync do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
describe 'environments' do
|
23
|
+
it 'raises an error on non master environments' do
|
24
|
+
expect { create_client(environment: 'foo').sync }.to raise_exception
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
22
28
|
describe '#initialize' do
|
23
29
|
it 'takes an options hash on initialization' do
|
24
30
|
expect do
|
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: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (Jan Lelis)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-04-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|
@@ -476,6 +476,7 @@ files:
|
|
476
476
|
- spec/fixtures/vcr_cassettes/human.yml
|
477
477
|
- spec/fixtures/vcr_cassettes/linkField.yml
|
478
478
|
- spec/fixtures/vcr_cassettes/locale.yml
|
479
|
+
- spec/fixtures/vcr_cassettes/locale_from_environment.yml
|
479
480
|
- spec/fixtures/vcr_cassettes/location.yml
|
480
481
|
- spec/fixtures/vcr_cassettes/multi_locale_array_reference.yml
|
481
482
|
- spec/fixtures/vcr_cassettes/multi_locale_reference.yml
|
@@ -526,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
526
527
|
version: '0'
|
527
528
|
requirements: []
|
528
529
|
rubyforge_project:
|
529
|
-
rubygems_version: 2.6
|
530
|
+
rubygems_version: 2.7.6
|
530
531
|
signing_key:
|
531
532
|
specification_version: 4
|
532
533
|
summary: contentful
|
@@ -614,6 +615,7 @@ test_files:
|
|
614
615
|
- spec/fixtures/vcr_cassettes/human.yml
|
615
616
|
- spec/fixtures/vcr_cassettes/linkField.yml
|
616
617
|
- spec/fixtures/vcr_cassettes/locale.yml
|
618
|
+
- spec/fixtures/vcr_cassettes/locale_from_environment.yml
|
617
619
|
- spec/fixtures/vcr_cassettes/location.yml
|
618
620
|
- spec/fixtures/vcr_cassettes/multi_locale_array_reference.yml
|
619
621
|
- spec/fixtures/vcr_cassettes/multi_locale_reference.yml
|