Permalink
Browse files

Fixing errors on reading files with compound names

  • Loading branch information...
1 parent 2b7e22f commit 4f62f365efce1c18f8e035f491fc66f0c4cebc0e Andrew Korzhuev committed Dec 25, 2012
View
@@ -16,14 +16,13 @@ def initialize status
end
def initialize(document)
-
- @document = document
+ @document = "file://#{document}"
java_cmd = 'java'
java_args = '-server -Djava.awt.headless=true'
tika_path = "#{File.join(File.dirname(__FILE__))}/../ext/tika-app-1.2.jar"
- @tika_cmd = "#{java_cmd} #{java_args} -jar #{tika_path}"
+ @tika_cmd = "#{java_cmd} #{java_args} -jar '#{tika_path}'"
end
def to_xml
@@ -54,7 +53,7 @@ def to_metadata
def run_tika(option)
- final_cmd = "#{@tika_cmd} #{option} #{@document}"
+ final_cmd = "#{@tika_cmd} #{option} '#{@document}'"
result = []
@@ -3,7 +3,7 @@
describe RubyTikaApp do
before(:each) do
- @test_file = "#{File.join(File.dirname(__FILE__))}/docs/graph_sampling_simplex11.pdf"
+ @test_file = "#{File.join(File.dirname(__FILE__))}/docs/graph sampling simplex - 11.pdf"
end
describe "#to_xml" do
@@ -18,7 +18,7 @@
xml_size = xml.size / 2
- xml[xml_size..(xml_size + 100)].should == "(Section IV). Besides,\nMHRW performs better in well connected graphs than in\nloosely connected graphs"
+ xml[xml_size..(xml_size + 100)].should == "sides,\nMHRW performs better in well connected graphs than in\nloosely connected graphs, as it was orig"
end
end
@@ -30,7 +30,7 @@
it "middle" do
rta = RubyTikaApp.new(@test_file)
- rta.to_html[1000 ... 1100].should == "rceName\" content=\"graph_sampling_simplex11.pdf\"/>\n<meta name=\"Last-Save-Date\" content=\"2011-03-29T13"
+ rta.to_html[1000 ... 1100].should == "rceName\" content=\"graph sampling simplex - 11.pdf\"/>\n<meta name=\"Last-Save-Date\" content=\"2011-03-29"
end
end
@@ -80,7 +80,6 @@
rta = RubyTikaApp.new(@test_file)
rta.to_metadata[100 ... 150].should == "Type: application/pdf\nCreation-Date: 2011-03-29T12"
end
-
end
end

0 comments on commit 4f62f36

Please sign in to comment.