Sha256: 0080fdd7197f7daffe02b63ae7fee6be2984ce23ad3ad07c5f7ce954e562d088

Contents?: true

Size: 379 Bytes

Versions: 16

Compression:

Stored size: 379 Bytes

Contents

require "zip"

module Excavate
  module Extractors
    class ZipExtractor < Extractor
      def extract(target)
        Zip::File.open(@archive) do |zip_file|
          zip_file.each do |entry|
            path = File.join(target, entry.name)
            FileUtils.mkdir_p(File.dirname(path))
            entry.extract(path)
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
excavate-0.3.7 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.6 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.5 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.4 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.3 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.2 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.1 lib/excavate/extractors/zip_extractor.rb
excavate-0.3.0 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.5 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.4 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.3 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.2 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.1 lib/excavate/extractors/zip_extractor.rb
excavate-0.2.0 lib/excavate/extractors/zip_extractor.rb
excavate-0.1.1 lib/excavate/extractors/zip_extractor.rb
excavate-0.1.0 lib/excavate/extractors/zip_extractor.rb