lib/docsplit.rb in docsplit-0.6.2 vs lib/docsplit.rb in docsplit-0.6.3

- old
+ new

@@ -1,9 +1,9 @@ # The Docsplit module delegates to the Java PDF extractors. module Docsplit - VERSION = '0.6.2' # Keep in sync with gemspec. + VERSION = '0.6.3' # Keep in sync with gemspec. ROOT = File.expand_path(File.dirname(__FILE__) + '/..') CLASSPATH = "#{ROOT}/build#{File::PATH_SEPARATOR}#{ROOT}/vendor/'*'" @@ -66,10 +66,10 @@ [docs].flatten.each do |doc| ext = File.extname(doc) basename = File.basename(doc, ext) escaped_doc, escaped_out, escaped_basename = [doc, out, basename].map(&ESCAPE) - if GM_FORMATS.include?(`file -b --mime #{ESCAPE[doc]]}`.strip.split(/[:;]\s+/)[0]) + if GM_FORMATS.include?(`file -b --mime #{ESCAPE[doc]}`.strip.split(/[:;]\s+/)[0]) `gm convert #{escaped_doc} #{escaped_out}/#{escaped_basename}.pdf` else options = "-jar #{ROOT}/vendor/jodconverter/jodconverter-core-3.0-beta-4.jar -r #{ROOT}/vendor/conf/document-formats.js" run "#{options} #{escaped_doc} #{escaped_out}/#{escaped_basename}.pdf", [], {} end