Class: Plaintext::DocHandler

Inherits:
ExternalCommandHandler show all
Defined in:
lib/plaintext/file_handler/external_command_handler/doc_handler.rb

Constant Summary collapse

CONTENT_TYPES =
[
    'application/vnd.ms-word',
    'application/msword'
]
DEFAULT =
[
    '/usr/bin/catdoc', '-dutf-8', '__FILE__'
]

Constants inherited from ExternalCommandHandler

ExternalCommandHandler::DEFAULT_STREAM_ENCODING, ExternalCommandHandler::FILE_PLACEHOLDER

Instance Method Summary collapse

Methods inherited from ExternalCommandHandler

#accept?, available?, #available?, #shellout, #text

Methods inherited from FileHandler

#accept?, #set

Constructor Details

#initializeDocHandler

Returns a new instance of DocHandler.



12
13
14
15
# File 'lib/plaintext/file_handler/external_command_handler/doc_handler.rb', line 12

def initialize
  @content_types = CONTENT_TYPES
  @command = Plaintext::Configuration['catdoc'] || DEFAULT
end