Class: Hbc::Container::Zip

Inherits:
Base
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/container/zip.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#extract_nested_container, #extract_nested_inside, #initialize, #verbose?

Constructor Details

This class inherits a constructor from Hbc::Container::Base

Class Method Details

.me?(criteria) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'Library/Homebrew/cask/lib/hbc/container/zip.rb', line 6

def self.me?(criteria)
  criteria.magic_number(/^PK(\003\004|\005\006)/n)
end

Instance Method Details

#extractObject



10
11
12
13
14
15
16
# File 'Library/Homebrew/cask/lib/hbc/container/zip.rb', line 10

def extract
  Dir.mktmpdir do |unpack_dir|
    @command.run!("/usr/bin/ditto", args: ["-x", "-k", "--", @path, unpack_dir])

    extract_nested_inside(unpack_dir)
  end
end