Skip to content

Commit 9f22570

Browse files
committed
Bugfix to escape document names during file type detection.
1 parent d8c8e67 commit 9f22570

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

docsplit.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'docsplit'
3-
s.version = '0.6.1' # Keep version in sync with docsplit.rb
3+
s.version = '0.6.2' # Keep version in sync with docsplit.rb
44
s.date = '2011-11-18'
55

66
s.homepage = "http://documentcloud.github.com/docsplit/"

index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ <h2 id="internals">Internals</h2>
277277

278278
<h2 id="changes">Change Log</h2>
279279

280+
<p>
281+
<b class="header">0.6.2</b><small> &ndash; Nov. 22, 2011</small><br />
282+
Bugfix to escape document names during file type detection.
283+
</p>
284+
280285
<p>
281286
<b class="header">0.6.1</b><small> &ndash; Nov. 18, 2011</small><br />
282287
Docsplit now supports converting documents using LibreOffice

lib/docsplit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Docsplit module delegates to the Java PDF extractors.
22
module Docsplit
33

4-
VERSION = '0.6.0' # Keep in sync with gemspec.
4+
VERSION = '0.6.2' # Keep in sync with gemspec.
55

66
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
77

@@ -68,7 +68,7 @@ def self.extract_pdf(docs, opts={})
6868
basename = File.basename(doc, ext)
6969
escaped_doc, escaped_out, escaped_basename = [doc, out, basename].map(&ESCAPE)
7070

71-
if GM_FORMATS.include?(`file -b --mime #{doc}`.strip.split(/[:;]\s+/)[0])
71+
if GM_FORMATS.include?(`file -b --mime #{ESCAPE[doc]]}`.strip.split(/[:;]\s+/)[0])
7272
`gm convert #{escaped_doc} #{escaped_out}/#{escaped_basename}.pdf`
7373
else
7474
options = "-jar #{ROOT}/vendor/jodconverter/jodconverter-core-3.0-beta-4.jar -r #{ROOT}/vendor/conf/document-formats.js"

0 commit comments

Comments
 (0)