lib/rtesseract/pdf.rb in rtesseract-3.0.0 vs lib/rtesseract/pdf.rb in rtesseract-3.0.1
- old
+ new
@@ -1,18 +1,13 @@
-require 'tmpdir'
-
class RTesseract
module Pdf
- def self.temp_dir
- @file_path = Pathname.new(Dir.tmpdir)
- end
+ extend Base
def self.run(source, options)
- name = "rtesseract_#{SecureRandom.uuid}"
options.tessedit_create_pdf = 1
- RTesseract::Command.new(source, temp_dir.join(name).to_s, options).run
+ RTesseract::Command.new(source, temp_file, options).run
- File.open(temp_dir.join("#{name}.pdf").to_s, 'r')
+ File.open(temp_file('.pdf'), 'r')
end
end
end
\ No newline at end of file