dato 0.7.13 → 0.7.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -1
- data/dato.gemspec +2 -1
- data/lib/dato/local/field_type/file.rb +12 -1
- data/lib/dato/local/field_type/upload_id.rb +1 -1
- data/lib/dato/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffe0429654722ca0165930dc29c1a0350bb386cd73b6c824d2d43cc0af8bb13f
|
4
|
+
data.tar.gz: fc124f52acef1d95d507dce6a9c45fa7556b9c5a018b9f630fbd688282015eb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7981652ff2a86c8f6081bbb3b7c4fa3d148ba2b159009e5528df476f3ee0517f95c98f7bb8f035c0d09e694f562b06d50a3df44910930a478df3676940508f77
|
7
|
+
data.tar.gz: 396828391163788c25f77da2d01c576d6c4cbad8993dda40d97b7700cb1896c7426897613dc9cc40c99177d7cdc8846a382d8ca9e2f37f0152abf3ff82636efe
|
data/Rakefile
CHANGED
data/dato.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'rubocop'
|
31
31
|
spec.add_development_dependency 'coveralls'
|
32
32
|
spec.add_development_dependency 'pry'
|
33
|
+
spec.add_development_dependency 'pry-byebug'
|
33
34
|
spec.add_development_dependency 'front_matter_parser'
|
34
35
|
|
35
36
|
spec.add_runtime_dependency 'faraday', ['>= 0.9.0']
|
@@ -37,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
37
38
|
spec.add_runtime_dependency 'activesupport', ['>= 4.2.7']
|
38
39
|
spec.add_runtime_dependency 'addressable'
|
39
40
|
spec.add_runtime_dependency 'thor'
|
40
|
-
spec.add_runtime_dependency 'imgix', ['
|
41
|
+
spec.add_runtime_dependency 'imgix', ['~> 4']
|
41
42
|
spec.add_runtime_dependency 'toml'
|
42
43
|
spec.add_runtime_dependency 'cacert'
|
43
44
|
spec.add_runtime_dependency 'dotenv'
|
@@ -210,7 +210,7 @@ module Dato
|
|
210
210
|
|
211
211
|
def file
|
212
212
|
Imgix::Client.new(
|
213
|
-
|
213
|
+
domain: @imgix_host,
|
214
214
|
secure: true,
|
215
215
|
include_library_param: false
|
216
216
|
).path(path)
|
@@ -220,6 +220,17 @@ module Dato
|
|
220
220
|
file.to_url(opts)
|
221
221
|
end
|
222
222
|
|
223
|
+
def lqip_data_url(opts = {})
|
224
|
+
@imgix_host != "www.datocms-assets.com" and
|
225
|
+
raise "#lqip_data_url can only be used with www.datocms-assets.com domain"
|
226
|
+
|
227
|
+
response = Faraday.get(file.to_url(opts.merge(lqip: "blurhash")))
|
228
|
+
|
229
|
+
if response.status == 200
|
230
|
+
"data:image/jpeg;base64,#{Base64.strict_encode64(response.body)}"
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
223
234
|
def to_hash(*_args)
|
224
235
|
{
|
225
236
|
id: id,
|
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.7.
|
4
|
+
version: 0.7.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry-byebug
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: front_matter_parser
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,16 +252,16 @@ dependencies:
|
|
238
252
|
name: imgix
|
239
253
|
requirement: !ruby/object:Gem::Requirement
|
240
254
|
requirements:
|
241
|
-
- - "
|
255
|
+
- - "~>"
|
242
256
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
257
|
+
version: '4'
|
244
258
|
type: :runtime
|
245
259
|
prerelease: false
|
246
260
|
version_requirements: !ruby/object:Gem::Requirement
|
247
261
|
requirements:
|
248
|
-
- - "
|
262
|
+
- - "~>"
|
249
263
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
264
|
+
version: '4'
|
251
265
|
- !ruby/object:Gem::Dependency
|
252
266
|
name: toml
|
253
267
|
requirement: !ruby/object:Gem::Requirement
|