docsplit 0.7.3 → 0.7.4
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/docsplit.gemspec +1 -1
- data/lib/docsplit.rb +1 -1
- data/lib/docsplit/pdf_extractor.rb +9 -6
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA512:
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
metadata.gz: b275fe3c2adc1c24cdd0f82d443e4d435ca94b872763649519b2d30bd66a3af5b6e184d8dda521f7ae2bdb5f5e4054a16d157f97498dfbb4decbd195497153fc
|
|
4
|
+
data.tar.gz: 8630bc27e04716940919f00014e6d4cd2bfd9830a8d132c6ce6ad8b01f9068dd63579041b8d281e752e83a9b77641a0e7f53cd639d63db0699205cee77d4ae76
|
|
5
5
|
SHA1:
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
metadata.gz: a31b827c0439da61d1d38584a0c482866dca0cb0
|
|
7
|
+
data.tar.gz: 25afa3c6aabc5190c6850f4da2016494df7ef4ed
|
data/docsplit.gemspec
CHANGED
data/lib/docsplit.rb
CHANGED
|
@@ -2,7 +2,8 @@ require 'rbconfig'
|
|
|
2
2
|
|
|
3
3
|
module Docsplit
|
|
4
4
|
class PdfExtractor
|
|
5
|
-
@@executable
|
|
5
|
+
@@executable = nil
|
|
6
|
+
@@version_string = nil
|
|
6
7
|
|
|
7
8
|
# Provide a set of helper functions to determine the OS.
|
|
8
9
|
HOST_OS = (defined?("RbConfig") ? RbConfig : Config)::CONFIG['host_os']
|
|
@@ -19,12 +20,14 @@ module Docsplit
|
|
|
19
20
|
# The first line of the help output holds the name and version number
|
|
20
21
|
# of the office software to be used for extraction.
|
|
21
22
|
def version_string
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
unless @@version_string
|
|
24
|
+
null = windows? ? "NUL" : "/dev/null"
|
|
25
|
+
@@version_string = `#{office_executable} -h 2>#{null}`.split("\n").first
|
|
26
|
+
if !!@@version_string.match(/[0-9]*/)
|
|
27
|
+
@@version_string = `#{office_executable} --version`.split("\n").first
|
|
25
28
|
end
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
end
|
|
30
|
+
@@version_string
|
|
28
31
|
end
|
|
29
32
|
def libre_office?
|
|
30
33
|
!!version_string.match(/^LibreOffice/)
|