Class: Plaintext::XlsHandler
- Inherits:
-
ExternalCommandHandler
- Object
- FileHandler
- ExternalCommandHandler
- Plaintext::XlsHandler
- Defined in:
- lib/plaintext/file_handler/external_command_handler/xls_handler.rb
Constant Summary collapse
- CONTENT_TYPES =
[ 'application/vnd.ms-excel', 'application/excel' ]
- DEFAULT =
[ '/usr/bin/xls2csv', '-dutf-8', '__FILE__' ]
Constants inherited from ExternalCommandHandler
ExternalCommandHandler::DEFAULT_STREAM_ENCODING, ExternalCommandHandler::FILE_PLACEHOLDER
Instance Method Summary collapse
-
#initialize ⇒ XlsHandler
constructor
A new instance of XlsHandler.
- #text(*_) ⇒ Object
Methods inherited from ExternalCommandHandler
#accept?, #available?, available?, #shellout
Methods inherited from FileHandler
Constructor Details
#initialize ⇒ XlsHandler
Returns a new instance of XlsHandler.
12 13 14 15 |
# File 'lib/plaintext/file_handler/external_command_handler/xls_handler.rb', line 12 def initialize @content_types = CONTENT_TYPES @command = Plaintext::Configuration['xls2csv'] || DEFAULT end |
Instance Method Details
#text(*_) ⇒ Object
16 17 18 19 20 |
# File 'lib/plaintext/file_handler/external_command_handler/xls_handler.rb', line 16 def text(*_) if str = super str.delete('"').gsub /,+/, ' ' end end |