dragonfly_pdf 2.2.0 → 2.2.1

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: 1b52dce882a992d8962049807ade2adb75d6adf7476f225855166694512a7c5c
4
- data.tar.gz: 036e2e338eab9ed66e8d3747306a54a27296b229009d3f6ac0dc39836435068b
3
+ metadata.gz: 7c3befda2f4836c64afe15ce4f326e59f2de98d07c1d6ebfe40537d06a86068a
4
+ data.tar.gz: 074a8cb3cde1158b8729cbf6545f43ad81734b9d2b7dc3e7dd44b70ac94a624d
5
5
  SHA512:
6
- metadata.gz: eb90c5f5f93fc1fa54328ed6b592b440fb79706275a9cefcf1a060d10850e4ecd95e54f402a4efc90bc00c1d11a042cb17594c276da2ae51893148d2b1bf531b
7
- data.tar.gz: e2e03e69b29e3a16c8115d42788edadba9db9c860f203aed2d5fed203cf3d66c06079a8ca709f4d80b74284c21760099c6751b22f491e606792e6c1720a50237
6
+ metadata.gz: d79bd5c7f0e5f9607659b23524e68048b81bc2bb9577b8423fe3886ad2bb82d93e212259940da23e2610d7ebd4919cfc2f7e25f3709a9e05cc0bb182ed3a729e
7
+ data.tar.gz: 0a3e896ecb9bb5c6c2001f4c59587274f16595130c52dea6c24e166d0688d1d05c5ffe2366dbcac5e2b850c2ebf1aaa8f4a01938a057310a589a18d060b7fd0f
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.2.1
4
+
5
+ * all paths in quotes
6
+
3
7
  ## 2.2.0
4
8
 
5
9
  * upgrade `dragonfly_libvips` to `~> 2.4.0`
@@ -5,7 +5,7 @@ module DragonflyPdf
5
5
  return {} unless content.ext
6
6
  return {} unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
- data = `pdftk #{content.path} dump_data`
8
+ data = `pdftk "#{content.path}" dump_data`
9
9
 
10
10
  page_count = data.scan(/NumberOfPages: (\d+)/).flatten.first.to_i
11
11
  page_numbers = data.scan(/PageMediaNumber: (\d+)/).flatten.map(&:to_i)
@@ -6,7 +6,7 @@ module DragonflyPdf
6
6
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
9
- "#{pdftk_command} #{old_path} #{pdfs_to_append.map(&:path).join(' ')} cat output #{new_path}"
9
+ "#{pdftk_command} \"#{old_path}\" #{pdfs_to_append.map(&:path).join(' ')} cat output \"#{new_path}\""
10
10
  end
11
11
  end
12
12
 
@@ -20,14 +20,14 @@ module DragonflyPdf
20
20
  pdf_options = options.fetch('pdf_options', 'compress,compress-fonts,compress-images,linearize,sanitize,garbage=deduplicate')
21
21
 
22
22
  content.shell_update(ext: format) do |old_path, new_path|
23
- "#{convert_command} -o #{new_path} -F #{format} -O #{pdf_options} #{old_path} #{page}"
23
+ "#{convert_command} -o \"#{new_path}\" -F #{format} -O #{pdf_options} \"#{old_path}\" #{page}"
24
24
  end
25
25
 
26
26
  when 'svg'
27
27
  text = options.fetch('text', 'path')
28
28
 
29
29
  content.shell_update(ext: format) do |old_path, new_path|
30
- "#{convert_command} -o #{new_path} -F #{format} -O text=#{text} #{old_path} #{page}"
30
+ "#{convert_command} -o \"#{new_path}\" -F #{format} -O text=#{text} \"#{old_path}\" #{page}"
31
31
  end
32
32
 
33
33
  # MuPDF appends 1 at the end of the filename, we need to rename it back
@@ -50,11 +50,11 @@ module DragonflyPdf
50
50
  width = dimensions.width.ceil
51
51
 
52
52
  content.shell_update(ext: format) do |old_path, new_path|
53
- "#{convert_command} -o #{new_path} -F #{format} -O width=#{width},colorspace=rgb #{old_path} #{page}"
53
+ "#{convert_command} -o \"#{new_path}\" -F #{format} -O width=#{width},colorspace=rgb \"#{old_path}\" #{page}"
54
54
  end
55
55
 
56
56
  # MuPDF appends 1 at the end of the filename, we need to rename it back
57
- `mv #{content.path.sub(".#{format}", "1.#{format}")} #{content.path}`
57
+ `mv \"#{content.path.sub(".#{format}", "1.#{format}")}\" \"#{content.path}\"`
58
58
  end
59
59
 
60
60
  content.meta['format'] = format
@@ -11,7 +11,7 @@ module DragonflyPdf
11
11
  raise DragonflyPdf::PageNotFound unless pdf_properties['page_numbers'].include?(page_number)
12
12
 
13
13
  content.shell_update(ext: 'pdf') do |old_path, new_path|
14
- "#{gs_command} -dFirstPage=#{page_number} -dLastPage=#{page_number} -o #{new_path} -f #{old_path}"
14
+ "#{gs_command} -dFirstPage=#{page_number} -dLastPage=#{page_number} -o \"#{new_path}\" -f \"#{old_path}\""
15
15
  end
16
16
  end
17
17
 
@@ -6,7 +6,7 @@ module DragonflyPdf
6
6
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
9
- "#{gs_command} -q -sOutputFile=#{new_path} -c .setpdfwrite -f #{old_path}"
9
+ "#{gs_command} -q -sOutputFile=\"#{new_path}\" -c .setpdfwrite -f \"#{old_path}\""
10
10
  end
11
11
  end
12
12
 
@@ -15,7 +15,7 @@ module DragonflyPdf
15
15
  end
16
16
 
17
17
  content.shell_update(ext: 'pdf') do |old_path, new_path|
18
- "#{pdftk_command} #{old_path} cat #{rotate_args} output #{new_path}"
18
+ "#{pdftk_command} \"#{old_path}\" cat #{rotate_args} output #{new_path}"
19
19
  end
20
20
  end
21
21
 
@@ -6,7 +6,7 @@ module DragonflyPdf
6
6
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
9
- "#{pdftk_command} #{old_path} stamp #{stamp_pdf.path} output #{new_path}"
9
+ "#{pdftk_command} \"#{old_path}\" stamp \"#{stamp_pdf.path}\" output \"#{new_path}\""
10
10
  end
11
11
  end
12
12
 
@@ -6,7 +6,7 @@ module DragonflyPdf
6
6
  raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
7
7
 
8
8
  content.shell_update(ext: 'pdf') do |old_path, new_path|
9
- "#{gs_command} -o #{new_path} -f #{old_path}"
9
+ "#{gs_command} -o \"#{new_path}\" -f \"#{old_path}\""
10
10
  end
11
11
  end
12
12
 
@@ -1,3 +1,3 @@
1
1
  module DragonflyPdf
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.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.2.0
4
+ version: 2.2.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: 2020-01-03 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly