Skip to content

Commit 8602b33

Browse files
committed
Merge pull request #68 from senner/patch-1
new libreoffice has --version
2 parents 99d927f + 79b75cd commit 8602b33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/docsplit/pdf_extractor.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ def linux?
1919
# The first line of the help output holds the name and version number
2020
# of the office software to be used for extraction.
2121
def version_string
22-
@@help ||= `#{office_executable} -h 2>&1`.split("\n").first
22+
versionstr = `#{office_executable} -h 2>&1`.split("\n").first
23+
if !!versionstr.match(/[0-9]*/)
24+
versionstr = `#{office_executable} --version`.split("\n").first
25+
end
26+
@@help ||= versionstr
27+
2328
end
2429
def libre_office?
2530
!!version_string.match(/^LibreOffice/)

0 commit comments

Comments
 (0)