Class: Hbc::Container::Xar

Inherits:
Base
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/container/xar.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)


8
9
10
# File 'Library/Homebrew/cask/lib/hbc/container/xar.rb', line 8

def self.me?(criteria)
  criteria.magic_number(/^xar!/n)
end

Instance Method Details

#extractObject



12
13
14
15
16
17
# File 'Library/Homebrew/cask/lib/hbc/container/xar.rb', line 12

def extract
  Dir.mktmpdir do |unpack_dir|
    @command.run!("/usr/bin/xar", args: ["-x", "-f", @path, "-C", unpack_dir])
    @command.run!("/usr/bin/ditto", args: ["--", unpack_dir, @cask.staged_path])
  end
end