36 lines
880 B
Ruby
Raw Normal View History

2018-07-24 18:43:20 +02:00
# frozen_string_literal: true
module UnpackStrategy
class Air
include UnpackStrategy
using Magic
def self.extensions
[".air"]
end
def self.can_extract?(path)
2018-07-29 10:25:31 +02:00
mime_type = "application/vnd.adobe.air-application-installer-package+zip"
path.magic_number.match?(/.{59}#{Regexp.escape(mime_type)}/)
end
def dependencies
@dependencies ||= [Hbc::CaskLoader.load("adobe-air")]
end
2018-07-24 18:43:20 +02:00
AIR_APPLICATION_INSTALLER =
"/Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer"
private_constant :AIR_APPLICATION_INSTALLER
private
def extract_to_dir(unpack_dir, basename:, verbose:)
2018-07-24 18:43:20 +02:00
system_command! AIR_APPLICATION_INSTALLER,
args: ["-silent", "-location", unpack_dir, path],
verbose: verbose
end
end
end