Module: AppInfo
- Defined in:
- lib/app_info.rb,
lib/app_info/aab.rb,
lib/app_info/apk.rb,
lib/app_info/ipa.rb,
lib/app_info/dsym.rb,
lib/app_info/error.rb,
lib/app_info/macos.rb,
lib/app_info/shell.rb,
lib/app_info/helper.rb,
lib/app_info/version.rb,
lib/app_info/proguard.rb,
lib/app_info/info_plist.rb,
lib/app_info/ipa/plugin.rb,
lib/app_info/png_uncrush.rb,
lib/app_info/ipa/framework.rb,
lib/app_info/mobile_provision.rb,
lib/app_info/protobuf/manifest.rb,
lib/app_info/protobuf/resources.rb,
lib/app_info/core_ext/object/try.rb,
lib/app_info/core_ext/string/inflector.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: AndroidDevice, Device, Helper, Inflector, Platform, Protobuf, Tryable Classes: AAB, APK, DSYM, Error, Framework, IPA, InfoPlist, Macos, MobileProvision, NotFoundError, Plugin, PngUncrush, Proguard, Shell, UnkownFileTypeError
Constant Summary collapse
- ICON_KEYS =
Icon Key
{ Device::IPHONE => ['CFBundleIcons'], Device::IPAD => ['CFBundleIcons~ipad'], Device::UNIVERSAL => ['CFBundleIcons', 'CFBundleIcons~ipad'], Device::MACOS => %w[CFBundleIconFile CFBundleIconName] }.freeze
- VERSION =
'2.8.1'
Class Method Summary collapse
-
.file_type(file) ⇒ Object
Detect file type by read file header.
-
.parse(file) ⇒ Object
(also: dump)
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 solution, if anyone knows, tell me please.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/app_info.rb', line 50 def file_type(file) header_hex = File.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 Also known as: dump
Get a new parser for automatic
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/app_info.rb', line 30 def 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 :aab then AAB.new(file) when :mobileprovision then MobileProvision.new(file) when :dsym then DSYM.new(file) when :proguard then Proguard.new(file) when :macos then Macos.new(file) else raise UnkownFileTypeError, "Do not detect file type: #{file}" end end |