Sha256: ae88c6a324e8c6382ad45201ab6e14ba1806b68d1c8d7683db2350108b6ca840

Contents?: true

Size: 495 Bytes

Versions: 1

Compression:

Stored size: 495 Bytes

Contents

require "zip_dir/dir"
require "zip_dir/zip"

module ZipDir
  class Zipper < Dir
    attr_reader :filename

    DEFAULT_FILENAME = "zipper.zip".freeze

    def initialize(filename=DEFAULT_FILENAME)
      @filename = filename
    end

    def generate(source_path=nil, root_directory: false)
      super
      @file = ZipDir::Zip.new(copy_path, filename).file
    end

    def cleanup
      super
      @file = nil
    end

    def file
      return unless generated?
      @file
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zip_dir-0.1.5 lib/zip_dir/zipper.rb