Method: AppInfo.parse

Defined in:
lib/app_info.rb

.parse(file) {|parser| ... } ⇒ Object Also known as: dump

Get a new parser for automatic

Yields:

  • (parser)

Raises:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/app_info.rb', line 36

def parse(file)
  raise NotFoundError, file unless ::File.exist?(file)

  parser = case file_type(file)
           when Format::IPA then IPA.new(file)
           when Format::APK then APK.new(file)
           when Format::AAB then AAB.new(file)
           when Format::MOBILEPROVISION then MobileProvision.new(file)
           when Format::DSYM then DSYM.new(file)
           when Format::PROGUARD then Proguard.new(file)
           when Format::MACOS then Macos.new(file)
           when Format::PE then PE.new(file)
           else
             raise UnknownFormatError, "Do not detect file format: #{file}"
           end

  return parser unless block_given?

  # call block and clear!
  yield parser
  parser.clear!
end