Module: DocRipper

Defined in:
lib/doc_ripper.rb,
lib/doc_ripper/base.rb,
lib/doc_ripper/version.rb,
lib/doc_ripper/exceptions.rb,
lib/doc_ripper/formats/pdf_ripper.rb,
lib/doc_ripper/formats/docx_ripper.rb,
lib/doc_ripper/formats/text_ripper.rb,
lib/doc_ripper/formats/ms_doc_ripper.rb,
lib/doc_ripper/formats/sketch_ripper.rb

Defined Under Namespace

Modules: Formats, Ripper Classes: FileNotFound, UnsupportedFileType

Constant Summary collapse

VERSION =
"0.0.9"

Class Method Summary collapse

Class Method Details

.rip(path, options = {}) ⇒ Object



13
14
15
16
# File 'lib/doc_ripper.rb', line 13

def rip(path, options = {})
  ripper = choose_ripper(path)
  ripper.text unless ripper.nil?
end

.rip!(path) ⇒ Object



18
19
20
21
22
23
# File 'lib/doc_ripper.rb', line 18

def rip!(path)
  ripper = choose_ripper(path)
  raise(UnsupportedFileType) if ripper.nil?

  ripper.text || raise(FileNotFound)
end