2018-07-23 23:04:49 +02:00
|
|
|
module UnpackStrategy
|
|
|
|
class Air
|
|
|
|
include UnpackStrategy
|
|
|
|
|
2018-07-29 10:04:51 +02:00
|
|
|
using Magic
|
|
|
|
|
|
|
|
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)}/)
|
2018-07-23 23:04:49 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def dependencies
|
|
|
|
@dependencies ||= [Hbc::CaskLoader.load("adobe-air")]
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
|
|
|
system_command!(
|
|
|
|
"/Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer",
|
|
|
|
args: ["-silent", "-location", unpack_dir, path],
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|