dragonfly_pdf 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31dabd88ff1e3af14b23f0ca1312faf01b94e7c6c9ef96e8f76d766dfdf69760
4
- data.tar.gz: fcbb5962181c123ebcbf0232be065eb4bc70ee55d83909338750c6884839d37a
3
+ metadata.gz: 1b52dce882a992d8962049807ade2adb75d6adf7476f225855166694512a7c5c
4
+ data.tar.gz: 036e2e338eab9ed66e8d3747306a54a27296b229009d3f6ac0dc39836435068b
5
5
  SHA512:
6
- metadata.gz: c2e5ff96f6a72f1b4559b0e7b63a42fe14638964d6319f5cc4ab447d1da03c90fc23f33edf59a3b7a2f0066cc499e3a0431f87fa80aff5d3f5b8c2a83391bbd7
7
- data.tar.gz: 0c6abc55f4abff7cbcc88403993fdddb6810844e4b0e4d72fe26b8c33bdc7c794c565af8aa333eee4e7174af10bf7fcfd835a2ee87c8f3aa5efc940b01328816
6
+ metadata.gz: eb90c5f5f93fc1fa54328ed6b592b440fb79706275a9cefcf1a060d10850e4ecd95e54f402a4efc90bc00c1d11a042cb17594c276da2ae51893148d2b1bf531b
7
+ data.tar.gz: e2e03e69b29e3a16c8115d42788edadba9db9c860f203aed2d5fed203cf3d66c06079a8ca709f4d80b74284c21760099c6751b22f491e606792e6c1720a50237
@@ -0,0 +1 @@
1
+ ruby 2.6.3
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.2.0
4
+
5
+ * upgrade `dragonfly_libvips` to `~> 2.4.0`
6
+ * symbolize keys passed to `ruby-vips`
7
+
3
8
  ## 2.1.1
4
9
 
5
10
  * improved `SUPPORTED_FORMATS` matching that ignores case
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'dragonfly', '~> 1.0'
22
- spec.add_dependency 'dragonfly_libvips', '~> 2.3.0', '>= 2.3.1'
22
+ spec.add_dependency 'dragonfly_libvips', '~> 2.4.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.12'
25
25
  spec.add_development_dependency 'guard'
@@ -9,4 +9,14 @@ module DragonflyPdf
9
9
 
10
10
  SUPPORTED_FORMATS = %w[pdf].freeze
11
11
  SUPPORTED_OUTPUT_FORMATS = %w[png pam pbm pkm pnm pdf tga svg].uniq.sort
12
+
13
+ private
14
+
15
+ def self.stringify_keys(hash = {})
16
+ hash.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v }
17
+ end
18
+
19
+ def self.symbolize_keys(hash = {})
20
+ hash.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v }
21
+ end
12
22
  end
@@ -10,7 +10,7 @@ module DragonflyPdf
10
10
  raise UnsupportedFormat unless content.ext
11
11
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
12
12
 
13
- options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
13
+ options = DragonflyPdf.stringify_keys(options)
14
14
  format = options.fetch('format', 'png').to_s
15
15
 
16
16
  raise UnsupportedOutputFormat unless SUPPORTED_OUTPUT_FORMATS.include?(format.downcase)
@@ -38,7 +38,7 @@ module DragonflyPdf
38
38
  input_options['access'] = input_options.fetch('access', 'sequential')
39
39
  input_options['dpi'] = input_options.fetch('dpi', DPI)
40
40
 
41
- img = ::Vips::Image.new_from_file(content.path, input_options)
41
+ img = ::Vips::Image.new_from_file(content.path, DragonflyPdf.symbolize_keys(input_options))
42
42
 
43
43
  dimensions = case geometry
44
44
  when DragonflyLibvips::Processors::Thumb::RESIZE_GEOMETRY
@@ -5,7 +5,7 @@ module DragonflyPdf
5
5
  raise UnsupportedFormat unless content.ext
6
6
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
- options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
8
+ options = DragonflyPdf.stringify_keys(options)
9
9
  format = options.delete('format') { 'jpg' }.to_s
10
10
 
11
11
  convert(content, page, geometry, format)
@@ -1,3 +1,3 @@
1
1
  module DragonflyPdf
2
- VERSION = '2.1.1'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly
@@ -30,20 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.3.0
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 2.3.1
33
+ version: 2.4.0
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: 2.3.0
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 2.3.1
40
+ version: 2.4.0
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: bundler
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +144,7 @@ extensions: []
150
144
  extra_rdoc_files: []
151
145
  files:
152
146
  - ".gitignore"
147
+ - ".tool-versions"
153
148
  - ".travis.yml"
154
149
  - CHANGELOG.md
155
150
  - Gemfile
@@ -205,8 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
200
  - !ruby/object:Gem::Version
206
201
  version: '0'
207
202
  requirements: []
208
- rubyforge_project:
209
- rubygems_version: 2.7.6
203
+ rubygems_version: 3.0.3
210
204
  signing_key:
211
205
  specification_version: 4
212
206
  summary: Dragonfly PDF analysers and processors.