mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 14:26:45 -06:00
* part of DSL 1.0 review * `destination_path` was always a bit vague (it refers to Cask-specific, version-specific location under `/opt/homebrew-cask/Caskroom`) * here renamed `staged_path` to match upcoming command verb `brew cask stage` * rename also intended to reduce confusion when we implement copying as a configurable alternative to symlinking * transitional `destination_path` methods to remain while Casks are converted (this was documented as a part of the DSL, and used by 39 Casks in main repo) * unrelated variables containing "stage" recast for clarity
31 lines
833 B
Ruby
31 lines
833 B
Ruby
class Cask::Container::Air < Cask::Container::Base
|
|
def self.me?(criteria)
|
|
%w[.air].include?(criteria.path.extname)
|
|
end
|
|
|
|
def self.installer_cmd
|
|
@installer_cmd ||= if installer_exist?
|
|
_installer_pathname
|
|
else
|
|
raise CaskError.new <<-ERRMSG.undent
|
|
Adobe AIR runtime not present, try installing it via
|
|
|
|
brew cask install adobe-air
|
|
|
|
ERRMSG
|
|
end
|
|
end
|
|
|
|
def self.installer_exist?
|
|
_installer_pathname.exist?
|
|
end
|
|
|
|
def self._installer_pathname
|
|
@_installer_pathname ||= Pathname.new('/Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer')
|
|
end
|
|
|
|
def extract
|
|
@command.run!(self.class.installer_cmd,
|
|
:args => ['-silent', '-location', @cask.staged_path, Pathname.new(@path).realpath])
|
|
end
|
|
end
|