mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-16 22:06:43 -06:00
and corresponding testing_env.rb. * recast HOMEBREW_BREW_FILE as Hbc.homebrew_executable, defined in Hbc::Locations * recast HOMEBREW_REPOSITORY as Hbc.homebrew_repository * recast HOMEBREW_PREFIX as Hbc.homebrew_prefix * remove HOMEBREW_LIBRARY * recast existing Hbc.tapspath as Hbc.homebrew_tapspath to match new methods fixes #8705
19 lines
627 B
Ruby
19 lines
627 B
Ruby
require 'tmpdir'
|
|
|
|
class Hbc::Container::GenericUnar < Hbc::Container::Base
|
|
def self.me?(criteria)
|
|
! criteria.lsar.nil? and
|
|
criteria.lsar.include? 'passed, 0 failed'
|
|
end
|
|
|
|
def extract
|
|
unar = Hbc.homebrew_prefix.join('bin/unar')
|
|
if ! Pathname.new(unar).exist?
|
|
raise Hbc::CaskError.new "Expected to find unar executable. Cask #{@cask} must add: depends_on :formula => 'unar'"
|
|
end
|
|
Dir.mktmpdir do |unpack_dir|
|
|
@command.run!(unar, :args => ['-q', '-D', '-o', unpack_dir, '--', @path])
|
|
@command.run!('/usr/bin/ditto', :args => ['--', unpack_dir, @cask.staged_path])
|
|
end
|
|
end
|
|
end
|