pludoni_pdfutils 0.5.0 → 0.5.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df026740cef0b57d7a3a0600603981bd5d85e254cceb239a992f39716643b99e
|
|
4
|
+
data.tar.gz: 4e71317574b64dabbaa497c7e91f10ee3d8d91866f29769da4cbbeca82f742aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2113c3f566578e3fc057a9063b320b1d9dffe5709be5662d8982605f6546daf1777245fb0cb345db4647fa321350db77db36b3f4362b745635007ebad20c72d5
|
|
7
|
+
data.tar.gz: 1b89aa521d37921cec31e7d123fb00af4811d92f635fb83ab00a88266dfd6d69a3082602c4f271906f8ea31322c8a991ee75020537107b66f3c530694ccf2e22
|
|
@@ -22,11 +22,11 @@ module Pludoni::Pdfutils
|
|
|
22
22
|
command << source.path
|
|
23
23
|
stdout, stderr, status = Open3.capture3(*command)
|
|
24
24
|
unless status.success?
|
|
25
|
-
raise ConversionFailedError, "PDF conversion failed: Command: #{
|
|
25
|
+
raise ConversionFailedError, "PDF conversion failed: Command: #{command}\nStdout: #{stdout}\nStderr: #{stderr}"
|
|
26
26
|
end
|
|
27
27
|
pdf_path = source.path.sub(/\.[a-z0-9]+$/i, '.pdf')
|
|
28
28
|
unless File.exist?(pdf_path)
|
|
29
|
-
raise ConversionFailedError, "PDF conversion failed: Command: #{
|
|
29
|
+
raise ConversionFailedError, "PDF conversion failed: Command: #{command}\nStdout: #{stdout}\nStderr: #{stderr}"
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
FileUtils.move(pdf_path, tf.path)
|
|
@@ -2,12 +2,16 @@ require 'open3'
|
|
|
2
2
|
|
|
3
3
|
module Pludoni::Pdfutils
|
|
4
4
|
class Joiner
|
|
5
|
+
MAX_LENGTH = 200
|
|
5
6
|
def initialize(blobs)
|
|
6
7
|
@blobs = blobs.map { |i| FileWrapper.make(i) }
|
|
7
8
|
end
|
|
8
9
|
|
|
9
10
|
def run
|
|
10
11
|
fname = @blobs.map(&:filename).map { |i| i.split('.').first[0..20] }.join('-')
|
|
12
|
+
if fname.length > MAX_LENGTH
|
|
13
|
+
fname = fname[0..MAX_LENGTH]
|
|
14
|
+
end
|
|
11
15
|
|
|
12
16
|
tf = Tempfile.new([fname, '.pdf'])
|
|
13
17
|
tf.binmode
|
data/pludoni_pdfutils.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pludoni_pdfutils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Wienert
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage
|