Class: AppInfo::Macos
Overview
Constant Summary
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
#file, #logger
Instance Method Summary
collapse
Methods inherited from Apple
#archs, #build_type, #build_version, #bundle_id, #bundle_name, #contents, #device, #devices, #display_name, #distribution_name, #expired_date, #hide_developer_certificates, #identifier, #info, #ipad?, #iphone?, #manufacturer, #min_os_version, #mobileprovision, #mobileprovision?, #name, #platform, #profile_name, #release_type, #release_version, #size, #team_identifier, #team_name, #universal?
#tempdir, #unarchive
#file_to_human_size, #number_to_human_size
Methods inherited from File
#device, #format, #initialize, #manufacturer, #not_implemented_error!, #platform, #size
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#app_path ⇒ String
85
86
87
|
# File 'lib/app_info/macos.rb', line 85
def app_path
@app_path ||= Dir.glob(::File.join(contents, '*.app')).first
end
|
#binary_path ⇒ String
69
70
71
72
73
74
75
76
77
|
# File 'lib/app_info/macos.rb', line 69
def binary_path
return @binary_path if @binary_path
base_path = ::File.join(app_path, 'Contents', 'MacOS')
binary = info['CFBundleExecutable']
return ::File.join(base_path, binary) if binary
@binary_path ||= Dir.glob(::File.join(base_path, '*')).first
end
|
#clear! ⇒ Object
89
90
91
92
93
94
95
96
97
98
99
100
|
# File 'lib/app_info/macos.rb', line 89
def clear!
return unless @contents
FileUtils.rm_rf(@contents)
@contents = nil
@app_path = nil
@binary_path = nil
@info_path = nil
@info = nil
@icons = nil
end
|
#icons(convert: true) ⇒ Array<Hash{Symbol => String, Array<Integer>}>
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/app_info/macos.rb', line 41
def icons(convert: true)
return unless icon_file
data = {
name: ::File.basename(icon_file),
file: icon_file
}
convert_icns_to_png(data) if convert
data
end
|
#info_path ⇒ String
80
81
82
|
# File 'lib/app_info/macos.rb', line 80
def info_path
@info_path ||= ::File.join(app_path, 'Contents', 'Info.plist')
end
|
#min_sdk_version ⇒ Object
13
|
# File 'lib/app_info/macos.rb', line 13
def_delegators :info, :min_system_version
|
#mobileprovision_path ⇒ String
59
60
61
|
# File 'lib/app_info/macos.rb', line 59
def mobileprovision_path
@mobileprovision_path ||= ::File.join(app_path, 'Contents', 'embedded.provisionprofile')
end
|
#store_path ⇒ String
64
65
66
|
# File 'lib/app_info/macos.rb', line 64
def store_path
@store_path ||= ::File.join(app_path, 'Contents', '_MASReceipt', 'receipt')
end
|
#stored? ⇒ Boolean
54
55
56
|
# File 'lib/app_info/macos.rb', line 54
def stored?
::File.exist?(store_path)
end
|