dato 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +6 -2
- data/dato.gemspec +1 -3
- data/lib/dato/local/field_type/file.rb +11 -4
- data/lib/dato/local/field_type/image.rb +1 -1
- data/lib/dato/local/loader.rb +4 -5
- data/lib/dato/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4f82010e5c4236d2beb18e212c367e98559107
|
4
|
+
data.tar.gz: 6329ebc7fe6eb9cdfbf6ad4f1f9930350648e3c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d9ba0e42b34cad0ffa9ec41bfd62b63bb81568f1fdaa7cf67c6ef3efd637bb417fe6715b72d851150ccfc83a6b641d142739d6ddc091992bd03d6f457a6bbfd
|
7
|
+
data.tar.gz: 7eee59d8926ab267704cafb704b0a968c80b52f1a5061cd802879e839240fd7e0a5dd28f0e76c5d9c48f81289b7d9783870f1fbf3bee95f1d5085cf7696c5e04
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.0
|
data/.travis.yml
CHANGED
data/dato.gemspec
CHANGED
@@ -20,8 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.required_ruby_version = '>= 2.1.2'
|
24
|
-
|
25
23
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
26
24
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
25
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
@@ -36,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
36
34
|
|
37
35
|
spec.add_runtime_dependency 'faraday', ['>= 0.9.0']
|
38
36
|
spec.add_runtime_dependency 'faraday_middleware', ['>= 0.9.0']
|
39
|
-
spec.add_runtime_dependency 'activesupport'
|
37
|
+
spec.add_runtime_dependency 'activesupport', ['>= 4.2.7']
|
40
38
|
spec.add_runtime_dependency 'fastimage'
|
41
39
|
spec.add_runtime_dependency 'downloadr'
|
42
40
|
spec.add_runtime_dependency 'addressable'
|
@@ -21,15 +21,15 @@ module Dato
|
|
21
21
|
@size = size
|
22
22
|
end
|
23
23
|
|
24
|
-
def file
|
24
|
+
def file(host = default_host)
|
25
25
|
Imgix::Client.new(
|
26
|
-
host:
|
26
|
+
host: host,
|
27
27
|
secure: true
|
28
28
|
).path(path)
|
29
29
|
end
|
30
30
|
|
31
|
-
def url(
|
32
|
-
file.to_url(
|
31
|
+
def url(host: default_host, **opts)
|
32
|
+
file(host).to_url(opts)
|
33
33
|
end
|
34
34
|
|
35
35
|
def to_hash
|
@@ -39,6 +39,13 @@ module Dato
|
|
39
39
|
url: url
|
40
40
|
}
|
41
41
|
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def default_host
|
46
|
+
'dato-images.imgix.net'
|
47
|
+
end
|
48
|
+
|
42
49
|
end
|
43
50
|
end
|
44
51
|
end
|
data/lib/dato/local/loader.rb
CHANGED
@@ -32,16 +32,15 @@ module Dato
|
|
32
32
|
|
33
33
|
def all_items
|
34
34
|
items_per_page = 500
|
35
|
-
base_response = client.request(:get, '/items', 'page[limit]' =>
|
35
|
+
base_response = client.request(:get, '/items', 'page[limit]' => 500)
|
36
36
|
|
37
|
-
|
38
|
-
base_response[:data] = []
|
37
|
+
extra_pages = (base_response[:meta][:total_count] / items_per_page.to_f).ceil - 1
|
39
38
|
|
40
|
-
|
39
|
+
extra_pages.times do |page|
|
41
40
|
base_response[:data] += client.request(
|
42
41
|
:get,
|
43
42
|
'/items',
|
44
|
-
'page[offset]' => items_per_page * page,
|
43
|
+
'page[offset]' => items_per_page * (page + 1),
|
45
44
|
'page[limit]' => items_per_page
|
46
45
|
)[:data]
|
47
46
|
end
|
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 4.2.7
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 4.2.7
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: fastimage
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -329,6 +329,7 @@ files:
|
|
329
329
|
- ".gitignore"
|
330
330
|
- ".rspec"
|
331
331
|
- ".rubocop.yml"
|
332
|
+
- ".ruby-version"
|
332
333
|
- ".travis.yml"
|
333
334
|
- CODE_OF_CONDUCT.md
|
334
335
|
- Gemfile
|
@@ -412,7 +413,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
412
413
|
requirements:
|
413
414
|
- - ">="
|
414
415
|
- !ruby/object:Gem::Version
|
415
|
-
version:
|
416
|
+
version: '0'
|
416
417
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
417
418
|
requirements:
|
418
419
|
- - ">="
|
@@ -420,9 +421,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
420
421
|
version: '0'
|
421
422
|
requirements: []
|
422
423
|
rubyforge_project:
|
423
|
-
rubygems_version: 2.
|
424
|
+
rubygems_version: 2.2.0
|
424
425
|
signing_key:
|
425
426
|
specification_version: 4
|
426
427
|
summary: Ruby client for DatoCMS API
|
427
428
|
test_files: []
|
428
|
-
has_rdoc:
|