Module: AppInfo
- Defined in:
- lib/app_info.rb,
lib/app_info/apk.rb,
lib/app_info/ipa.rb,
lib/app_info/dsym.rb,
lib/app_info/util.rb,
lib/app_info/version.rb,
lib/app_info/proguard.rb,
lib/app_info/ipa/plugin.rb,
lib/app_info/ipa/framework.rb,
lib/app_info/ipa/info_plist.rb,
lib/app_info/core_ext/object/try.rb,
lib/app_info/ipa/mobile_provision.rb
Overview
Copyrights rails Copy from github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb
Defined Under Namespace
Modules: Platform, Tryable, Util Classes: APK, DSYM, Error, Framework, IPA, InfoPlist, MobileProvision, NotFoundError, Plugin, Proguard, UnkownFileTypeError
Constant Summary collapse
- VERSION =
'2.4.2'
Class Method Summary collapse
-
.file_type(file) ⇒ Object
Detect file type by read file header.
-
.parse(file) ⇒ Object
Get a new parser for automatic.
Class Method Details
.file_type(file) ⇒ Object
Detect file type by read file header
TODO: This can be better way to solvt, if anyone knows, tell me please.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/app_info.rb', line 47 def self.file_type(file) header_hex = IO.read(file, 100) type = if header_hex =~ /^\x50\x4b\x03\x04/ detect_zip_file(file) else detect_mobileprovision(header_hex) end type || :unkown end |
.parse(file) ⇒ Object
Get a new parser for automatic
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/app_info.rb', line 29 def self.parse(file) raise NotFoundError, file unless File.exist?(file) case file_type(file) when :ipa then IPA.new(file) when :apk then APK.new(file) when :mobileprovision then MobileProvision.new(file) when :dsym then DSYM.new(file) when :proguard then Proguard.new(file) else raise UnkownFileTypeError, "Sorry, AppInfo can not detect file type: #{file}" end end |