Class: DocRipper::Formats::DocxRipper
- Inherits:
-
Ripper::Base
- Object
- Ripper::Base
- DocRipper::Formats::DocxRipper
- Defined in:
- lib/doc_ripper/formats/docx_ripper.rb
Instance Attribute Summary
Attributes inherited from Ripper::Base
Instance Method Summary collapse
Methods inherited from Ripper::Base
Constructor Details
This class inherits a constructor from DocRipper::Ripper::Base
Instance Method Details
#rip ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/doc_ripper/formats/docx_ripper.rb', line 5 def rip @text ||= begin text = %x(unzip -p #{to_shell(file_path)} | grep '<w:t' | sed 's/<[^<]*>//g' | grep -v '^[[:space:]]*$') text.empty? ? nil : text end end |