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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8911d925c9122207b1b12804415839e1a60c6f42212523f8a9d8590a0ac3b609
4
- data.tar.gz: fcb4dfbed9102fd7c037c635bb0a436ea8c5671964e51e7dcf1c9b7345f25471
3
+ metadata.gz: ffe0429654722ca0165930dc29c1a0350bb386cd73b6c824d2d43cc0af8bb13f
4
+ data.tar.gz: fc124f52acef1d95d507dce6a9c45fa7556b9c5a018b9f630fbd688282015eb7
5
5
  SHA512:
6
- metadata.gz: 127d2b647b57bbf530f3def61fefd302f763ec0ead035dc0f7a3d53cb6d6646948a994a75c5b6f22533e815e35a1a27a1d1f6cb0b85f2eedb86e8985971bbc87
7
- data.tar.gz: 9709363be3b119354890d3d1de8a16bd8a020faf3e58692022e50de1ba25dcd4af6c49f1962e03cd8e8b82f35334140efa61cd7ff9f3f9835b39c5901b3e904b
6
+ metadata.gz: 7981652ff2a86c8f6081bbb3b7c4fa3d148ba2b159009e5528df476f3ee0517f95c98f7bb8f035c0d09e694f562b06d50a3df44910930a478df3676940508f77
7
+ data.tar.gz: 396828391163788c25f77da2d01c576d6c4cbad8993dda40d97b7700cb1896c7426897613dc9cc40c99177d7cdc8846a382d8ca9e2f37f0152abf3ff82636efe
data/Rakefile CHANGED
@@ -3,5 +3,8 @@
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
6
+ RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.rspec_opts = "-b"
8
+ end
9
+
7
10
  task default: :spec
@@ -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', ['>= 0.3.1']
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
- host: @imgix_host,
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,
@@ -43,7 +43,7 @@ module Dato
43
43
 
44
44
  def file
45
45
  Imgix::Client.new(
46
- host: @imgix_host,
46
+ domain: @imgix_host,
47
47
  secure: true,
48
48
  include_library_param: false
49
49
  ).path(path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dato
4
- VERSION = '0.7.13'
4
+ VERSION = '0.7.14'
5
5
  end
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.13
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-05-26 00:00:00.000000000 Z
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: 0.3.1
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: 0.3.1
264
+ version: '4'
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: toml
253
267
  requirement: !ruby/object:Gem::Requirement