Sha256: a9951319c7f537300430a99d1d20cc0b9307861759a632a8c330d1eec60702b1

Contents?: true

Size: 673 Bytes

Versions: 12

Compression:

Stored size: 673 Bytes

Contents

module Warbler
  class ZipSupportRubyZip0_9
    def self.create(filename, &blk)
      Zip::ZipFile.open(filename, Zip::ZipFile::CREATE, &blk)
    end

    def self.open(filename, &blk)
      Zip::ZipFile.open(filename, &blk)
    end
  end

  class ZipSupportRubyZip1_0
    def self.create(filename, &blk)
      Zip::File.open(filename, Zip::File::CREATE, &blk)
    end

    def self.open(filename, &blk)
      Zip::File.open(filename, &blk)
    end
  end
end

begin
  require 'zip/zip'
  Warbler::ZipSupport = Warbler::ZipSupportRubyZip0_9
rescue LoadError => e
  raise e unless e.message =~ /zip/

  require 'zip'
  Warbler::ZipSupport = Warbler::ZipSupportRubyZip1_0
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
warbler-1.4.10 lib/warbler/zip_support.rb
warbler-1.4.9 lib/warbler/zip_support.rb
warbler-1.4.8 lib/warbler/zip_support.rb
warbler-1.4.7 lib/warbler/zip_support.rb
warbler-1.4.6 lib/warbler/zip_support.rb
warbler-1.4.5 lib/warbler/zip_support.rb
warbler-1.4.4 lib/warbler/zip_support.rb
warbler-1.4.3 lib/warbler/zip_support.rb
warbler-1.4.2 lib/warbler/zip_support.rb
warbler-1.4.1 lib/warbler/zip_support.rb
warbler-1.4.0 lib/warbler/zip_support.rb
warbler-1.4.0.beta2 lib/warbler/zip_support.rb