grover 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grover.rb +13 -4
  3. data/lib/grover/version.rb +1 -1
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9febdb704dde64f97be4f3b61421ddc55b08c9ef0b2db6486ec4bb7167e39763
4
- data.tar.gz: 5fdcc0100966e5069556699e6f2885c350382cc08f7596472f9b1c1340ff377a
3
+ metadata.gz: 49891589eac94bdb0602aefdeaf488bd7df1c40c69c75da1eee473016cb6eefc
4
+ data.tar.gz: 14b8fd25ee3eafaa76f5b5da6f0591c9cfe8af077ff042f6e2b804e1c12b7e70
5
5
  SHA512:
6
- metadata.gz: 4a900a5a102861d9a24fb3c14cfdeb077e977ddd6b9cd08a115119751aeacbab5983c7cf46d7f93f5fec8f2860737d89178ca33ca709613fe655aba68a5d3178
7
- data.tar.gz: 65d5c5dfdcfb88dfba72b9995ff708dc16915a708c5324438b7c25f90e56a78d57da2024e959a8f086e45ea24985848a95b36669c64ff3efe7b407509ce429c9
6
+ metadata.gz: e140285264c56edc46390938f72ff0cd402285a81040c011fac94a2b019753357b238b7a0bc869c0d1e3e741857f21bb5446b51de1fe5f920aba722f23ecb3bc
7
+ data.tar.gz: 6db55a620a3099e945d31fe0da78ca4d73396c2d2544e0985d836595f4d63620e9856388fa8525b328322125b820738a76931cd348d562974f3e0e1fa82c3b3c
@@ -264,7 +264,8 @@ class Grover
264
264
  Utils.deep_merge! combined, meta_options unless url_source?
265
265
 
266
266
  fix_boolean_options! combined
267
- fix_numeric_options! combined
267
+ fix_integer_options! combined
268
+ fix_float_options! combined
268
269
  fix_array_options! combined
269
270
 
270
271
  combined
@@ -304,10 +305,18 @@ class Grover
304
305
 
305
306
  FALSE_VALUES = [nil, false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF'].freeze
306
307
 
307
- def fix_numeric_options!(options)
308
- return unless options.key? 'scale'
308
+ def fix_integer_options!(options)
309
+ ['viewport.width', 'viewport.height'].each do |opt|
310
+ keys = opt.split('.')
311
+ Utils.deep_assign(options, keys, options.dig(*keys).to_i) if options.dig(*keys)
312
+ end
313
+ end
309
314
 
310
- options['scale'] = options['scale'].to_f
315
+ def fix_float_options!(options)
316
+ ['viewport.device_scale_factor', 'scale'].each do |opt|
317
+ keys = opt.split('.')
318
+ Utils.deep_assign(options, keys, options.dig(*keys).to_f) if options.dig(*keys)
319
+ end
311
320
  end
312
321
 
313
322
  def fix_array_options!(options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Grover
4
- VERSION = '0.11.1'
4
+ VERSION = '0.11.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bromwich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-16 00:00:00.000000000 Z
11
+ date: 2020-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: combine_pdf
@@ -198,7 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []
201
- rubygems_version: 3.0.6
201
+ rubyforge_project:
202
+ rubygems_version: 2.7.6.2
202
203
  signing_key:
203
204
  specification_version: 4
204
205
  summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS