Sha256: 6abb85fc2793f70eb2b48cd7129545c316999b2f5fc8654a9fded3f47cad2530
Contents?: true
Size: 674 Bytes
Versions: 4
Compression:
Stored size: 674 Bytes
Contents
require 'albacore/albacoretask' require 'zip/zip' require 'zip/zipfilesystem' include Zip class Unzip include Albacore::Task attr_accessor :destination, :file def initialize super() update_attributes Albacore.configuration.unzip.to_hash end def execute() fail_with_message 'Zip File cannot be empty' if @file.nil? return if @file.nil? Zip::ZipFile.open(@file) do |zip_f| zip_f.each do |f| out_path = File.join(@destination, f.name) FileUtils.mkdir_p(File.dirname(out_path)) zip_f.extract(f, out_path) unless File.exist?(out_path) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
albacore-0.2.5 | lib/albacore/unzip.rb |
albacore-0.2.4 | lib/albacore/unzip.rb |
albacore-0.2.3 | lib/albacore/unzip.rb |
albacore-0.2.2 | lib/albacore/unzip.rb |