Sha256: e974c316cf7a189967435d5be5f28688dea1d25365f7ce3a03083fd8bb75aa13
Contents?: true
Size: 874 Bytes
Versions: 15
Compression:
Stored size: 874 Bytes
Contents
module Fontist module Import module Extractors class OleExtractor < Extractor def extract dir = Dir.mktmpdir extract_ole(@archive, dir) dir end def format "msi" end private def extract_ole(archive, dir) ole = storage.open(archive) file = the_largest_file(ole) content = ole.file.read(file) path = File.join(dir, "data.cab") File.open(path, "wb") { |f| f.write(content) } end def storage @storage ||= begin require "ole/storage" Ole::Storage end end def the_largest_file(ole) ole.dir.entries(".").max_by do |x| ole.file.size(x) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems