Class: Textractor::Extractors::DocExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/textractor/extractors/doc_extractor.rb

Constant Summary collapse

DEFAULT_WV_TEXT_PATH =
File.expand_path(File.dirname(__FILE__) + "/../../../support/wvText.xml").freeze

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.wvText_pathObject



10
11
12
# File 'lib/textractor/extractors/doc_extractor.rb', line 10

def wvText_path
  @wvText_path || DEFAULT_WV_TEXT_PATH
end

Instance Method Details

#text_from_path(path) ⇒ Object



15
16
17
18
19
# File 'lib/textractor/extractors/doc_extractor.rb', line 15

def text_from_path(path)
  command = "wvWare -c utf-8 --nographics -x #{wvText_path} #{Escape.shell_single_word(path)}"
  puts command if $DEBUG
  `#{command}`.strip
end