chupa-text-decomposer-pdf 1.0.6 → 1.0.7
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 +4 -4
- data/chupa-text-decomposer-pdf.gemspec +1 -1
- data/doc/text/news.md +6 -0
- data/lib/chupa-text/decomposers/pdf.rb +11 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ee83b1f226af6155013057a578bc3cd281b585499a7cbb80cb205d34f35b17b
|
4
|
+
data.tar.gz: 00a86dc1c0a34244873517e89d6da0be8ea3fdac4b822e74d9767feba5d6ee45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7ae9bb6f174da2918bbfcf8bdc6488dff306a2b59bfe2e37165647e355f12f80157c207c110ef54e0c329311aedabd3e2fcd59d3cfde3c316d84a7377174115
|
7
|
+
data.tar.gz: 6aedb4a7b7e1b43b22f7c1a7ee2c8a6a93bfcf3faee023502d2cd54bde1a17c341c36d1c530e71095bdfb633e65366700ff2064b1b4a09f93a7953cbf2dcbd72
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
|
23
23
|
Gem::Specification.new do |spec|
|
24
24
|
spec.name = "chupa-text-decomposer-pdf"
|
25
|
-
spec.version = "1.0.
|
25
|
+
spec.version = "1.0.7"
|
26
26
|
spec.homepage = "https://github.com/ranguba/chupa-text-decomposer-pdf"
|
27
27
|
spec.authors = ["Kouhei Sutou"]
|
28
28
|
spec.email = ["kou@clear-code.com"]
|
data/doc/text/news.md
CHANGED
@@ -64,9 +64,17 @@ module ChupaText
|
|
64
64
|
def create_document(data)
|
65
65
|
_password = password(data)
|
66
66
|
path = data.path
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
case path
|
68
|
+
when String
|
69
|
+
path = nil unless File.exist?(path)
|
70
|
+
when Pathname
|
71
|
+
if path.exist?
|
72
|
+
path = path.to_s
|
73
|
+
else
|
74
|
+
path = nil
|
75
|
+
end
|
76
|
+
end
|
77
|
+
if path.nil?
|
70
78
|
file = Tempfile.new(["chupa-text-decomposer-pdf", ".pdf"])
|
71
79
|
file.binmode
|
72
80
|
file.write(data.body)
|