lib/app_info/ipa.rb in app-info-2.0.0 vs lib/app_info/ipa.rb in app-info-2.1.0
- old
+ new
@@ -1,16 +1,19 @@
# frozen_string_literal: true
require 'macho'
require 'pngdefry'
require 'fileutils'
+require 'forwardable'
require 'cfpropertylist'
require 'app_info/util'
module AppInfo
# IPA parser
class IPA
+ extend Forwardable
+
attr_reader :file
# iOS Export types
module ExportType
DEBUG = 'Debug'
@@ -31,81 +34,17 @@
def os
AppInfo::Platform::IOS
end
alias file_type os
- def iphone?
- info.iphone?
- end
+ def_delegators :info, :iphone?, :ipad?, :universal?, :build_version, :name,
+ :release_version, :identifier, :bundle_id, :display_name,
+ :bundle_name, :icons, :min_sdk_version, :device_type
- def ipad?
- info.ipad?
- end
+ def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
+ :profile_name, :expired_date
- def universal?
- info.universal?
- end
-
- def build_version
- info.build_version
- end
-
- def release_version
- info.release_version
- end
-
- def identifier
- info.identifier
- end
-
- def name
- display_name || bundle_name
- end
-
- def display_name
- info.display_name
- end
-
- def bundle_name
- info.bundle_name
- end
-
- def icons
- info.icons
- end
-
- #
- # Return the minimum OS version for the given application
- #
- def min_sdk_version
- info.min_sdk_version
- end
-
- def device_type
- info.device_type
- end
-
- def devices
- mobileprovision.devices
- end
-
- def team_name
- mobileprovision.team_name
- end
-
- def team_identifier
- mobileprovision.team_identifier
- end
-
- def profile_name
- mobileprovision.profile_name
- end
-
- def expired_date
- mobileprovision.expired_date
- end
-
def distribution_name
"#{profile_name} - #{team_name}" if profile_name && team_name
end
def release_type
@@ -208,11 +147,9 @@
@app_path = nil
@metadata = nil
@metadata_path = nil
@info = nil
end
-
- alias bundle_id identifier
private
def contents
@contents ||= Util.unarchive(@file, path: 'ios')