Class: Hbc::Container::Air

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

Constant Summary

INSTALLER_PATHNAME =
Pathname("/Applications/Utilities/Adobe AIR Application Installer.app" \
"/Contents/MacOS/Adobe AIR Application Installer")

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

.installer_cmdObject

Raises:



14
15
16
17
18
19
20
21
22
# File 'Library/Homebrew/cask/lib/hbc/container/air.rb', line 14

def self.installer_cmd
  return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist?
  raise CaskError, <<~EOS
    Adobe AIR runtime not present, try installing it via

        brew cask install adobe-air

  EOS
end

.installer_exist?Boolean



24
25
26
# File 'Library/Homebrew/cask/lib/hbc/container/air.rb', line 24

def self.installer_exist?
  INSTALLER_PATHNAME.exist?
end

.me?(criteria) ⇒ Boolean



10
11
12
# File 'Library/Homebrew/cask/lib/hbc/container/air.rb', line 10

def self.me?(criteria)
  %w[.air].include?(criteria.path.extname)
end

Instance Method Details

#extractObject

Raises:



28
29
30
31
32
33
34
# File 'Library/Homebrew/cask/lib/hbc/container/air.rb', line 28

def extract
  install = @command.run(self.class.installer_cmd,
                         args: ["-silent", "-location", @cask.staged_path, Pathname.new(@path).realpath])

  return unless install.exit_status == 9
  raise CaskError, "Adobe AIR application #{@cask} already exists on the system, and cannot be reinstalled."
end