class Keynote::Extractor::ArchiveExtractor

Public Class Methods

extract(file) click to toggle source
# File lib/keynote/extractor/archive_extractor.rb, line 7
def self.extract(file)
  archive = Zip::File.open(file) 
end
return_files(file) click to toggle source
# File lib/keynote/extractor/archive_extractor.rb, line 11
def self.return_files(file)
  archive = extract(file)

  iwa_files = []
  archive.each do |item|
    if item.name == 'index.apxl'
      return item.get_input_stream.read
    end
    iwa_files << item.get_input_stream.read if item.name.split('.').last == 'iwa'
  end
  
  iwa_files
end