dragonfly_pdf 2.1.0 → 2.1.1

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: 76f9364c0e260943bd144490065c03b31df16566dfc5edfbdfb8a43a201a5bd7
4
- data.tar.gz: 9d632fb7d1f1d52bae8f2be9b1aabc850d6f2581fdb0ef3502bb1d408df200f1
3
+ metadata.gz: 31dabd88ff1e3af14b23f0ca1312faf01b94e7c6c9ef96e8f76d766dfdf69760
4
+ data.tar.gz: fcbb5962181c123ebcbf0232be065eb4bc70ee55d83909338750c6884839d37a
5
5
  SHA512:
6
- metadata.gz: 40d25571ea32a0b72e253cfd3db2efed9fa22d4e1d7cfc06a5d53101887f3cb058ecc28d9c2445561842a89c062434b9b632d3d075667b7c2cdeb17d089eab73
7
- data.tar.gz: a7c119532f70acbd4b0dad5e329aacc9ab0cfb5ae5750f21742837b98d799225904c33017c03ac81c80fee0f6c3e3fdb0c989c1086ce72af3558bf0495c7fa6c
6
+ metadata.gz: c2e5ff96f6a72f1b4559b0e7b63a42fe14638964d6319f5cc4ab447d1da03c90fc23f33edf59a3b7a2f0066cc499e3a0431f87fa80aff5d3f5b8c2a83391bbd7
7
+ data.tar.gz: 0c6abc55f4abff7cbcc88403993fdddb6810844e4b0e4d72fe26b8c33bdc7c794c565af8aa333eee4e7174af10bf7fcfd835a2ee87c8f3aa5efc940b01328816
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.1.1
4
+
5
+ * improved `SUPPORTED_FORMATS` matching that ignores case
6
+
3
7
  ## 2.1.0
4
8
 
5
9
  * add `SUPPORTED_FORMATS` and `SUPPORTED_OUTPUT_FORMATS` and raise errors when formats are not matching
@@ -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.2.0'
22
+ spec.add_dependency 'dragonfly_libvips', '~> 2.3.0', '>= 2.3.1'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.12'
25
25
  spec.add_development_dependency 'guard'
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Analysers
3
3
  class PdfProperties
4
4
  def call(content, options = {})
5
- return {} unless SUPPORTED_FORMATS.include?(content.ext)
5
+ return {} unless content.ext
6
+ return {} unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  data = `pdftk #{content.path} dump_data`
8
9
 
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class Append
4
4
  def call(content, pdfs_to_append, options = {})
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
8
9
  "#{pdftk_command} #{old_path} #{pdfs_to_append.map(&:path).join(' ')} cat output #{new_path}"
@@ -7,12 +7,13 @@ module DragonflyPdf
7
7
  DPI = 600
8
8
 
9
9
  def call(content, page, geometry = nil, options = {})
10
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
10
+ raise UnsupportedFormat unless content.ext
11
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
11
12
 
12
13
  options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
13
14
  format = options.fetch('format', 'png').to_s
14
15
 
15
- raise UnsupportedOutputFormat unless SUPPORTED_OUTPUT_FORMATS.include?(format)
16
+ raise UnsupportedOutputFormat unless SUPPORTED_OUTPUT_FORMATS.include?(format.downcase)
16
17
 
17
18
  case format
18
19
  when 'pdf'
@@ -4,7 +4,8 @@ module DragonflyPdf
4
4
  module Processors
5
5
  class Page
6
6
  def call(content, page_number = 1, _opts = {})
7
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
7
+ raise UnsupportedFormat unless content.ext
8
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
8
9
 
9
10
  pdf_properties = DragonflyPdf::Analysers::PdfProperties.new.call(content)
10
11
  raise DragonflyPdf::PageNotFound unless pdf_properties['page_numbers'].include?(page_number)
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class PageThumb
4
4
  def call(content, page, geometry = nil, options = {})
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
8
9
  format = options.delete('format') { 'jpg' }.to_s
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class RemovePassword
4
4
  def call(content, _options = {})
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
8
9
  "#{gs_command} -q -sOutputFile=#{new_path} -c .setpdfwrite -f #{old_path}"
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class Rotate
4
4
  def call(content, arg)
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  rotate_args = case arg
8
9
  when String, Symbol
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class Stamp
4
4
  def call(content, stamp_pdf, _options = {})
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
8
9
  "#{pdftk_command} #{old_path} stamp #{stamp_pdf.path} output #{new_path}"
@@ -2,7 +2,8 @@ module DragonflyPdf
2
2
  module Processors
3
3
  class SubsetFonts
4
4
  def call(content, _opts = {})
5
- raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext)
5
+ raise UnsupportedFormat unless content.ext
6
+ raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
6
7
 
7
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
8
9
  "#{gs_command} -o #{new_path} -f #{old_path}"
@@ -1,3 +1,3 @@
1
1
  module DragonflyPdf
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.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.0
4
+ version: 2.1.1
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-07-14 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly
@@ -30,14 +30,20 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.0
33
+ version: 2.3.0
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.3.1
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
- version: 2.2.0
43
+ version: 2.3.0
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.3.1
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement