Sha256: f316b18e747355be066039df6597cd8adea712d4b783299198f3b591b3bd8701
Contents?: true
Size: 893 Bytes
Versions: 15
Compression:
Stored size: 893 Bytes
Contents
module Fontist module Import module Extractors class SevenZipExtractor < Extractor def extract dir = Dir.mktmpdir extract_7z(@archive, dir) dir end def try File.open(@archive, "rb") do |file| reader.open(file) end true rescue StandardError => e return false if e.message.start_with?("Invalid file format") raise end def format "seven_zip" end private def extract_7z(archive, dir) File.open(archive, "rb") do |file| reader.extract_all(file, dir) end end def reader @reader ||= begin require "seven_zip_ruby" SevenZipRuby::Reader end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems