Sha256: 26f68d10a05647a30ce40b992c949e1406db38a8043bbdc57cd57a30d60369c2

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

Stored size: 547 Bytes

Contents

module Fontist
  module Import
    module Extractors
      class GzipExtractor < Extractor
        def extract
          dir = Dir.mktmpdir
          extract_gzip(@archive, dir)
          dir
        end

        def format
          "gzip"
        end

        private

        def extract_gzip(archive, dir)
          Zlib::GzipReader.open(archive) do |gz|
            basename = File.basename(archive, ".*")
            path = File.join(dir, basename)
            File.write(path, gz.read)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fontist-1.8.7 lib/fontist/import/extractors/gzip_extractor.rb
fontist-1.8.6 lib/fontist/import/extractors/gzip_extractor.rb
fontist-1.8.5 lib/fontist/import/extractors/gzip_extractor.rb
fontist-1.8.4 lib/fontist/import/extractors/gzip_extractor.rb