Class: Parser::IPA

Inherits:
Object show all
Defined in:
lib/fir/patches/parser_patch.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ IPA

Returns a new instance of IPA.



22
23
24
# File 'lib/fir/patches/parser_patch.rb', line 22

def initialize(path)
  @path = path
end

Instance Method Details

#appObject



26
27
28
# File 'lib/fir/patches/parser_patch.rb', line 26

def app
  @app ||= App.new(app_path)
end

#app_pathObject



30
31
32
# File 'lib/fir/patches/parser_patch.rb', line 30

def app_path
  @app_path ||= Dir.glob(File.join(contents, 'Payload', '*.app')).first
end

#cleanupObject



34
35
36
37
38
# File 'lib/fir/patches/parser_patch.rb', line 34

def cleanup
  return unless @contents
  FileUtils.rm_rf(@contents)
  @contents = nil
end

#has_metadata?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/fir/patches/parser_patch.rb', line 45

def has_metadata?
  File.file? 
end

#metadataObject



40
41
42
43
# File 'lib/fir/patches/parser_patch.rb', line 40

def 
  return unless has_metadata?
  @metadata ||= CFPropertyList.native_types(CFPropertyList::List.new(file: ).value)
end

#metadata_pathObject



49
50
51
# File 'lib/fir/patches/parser_patch.rb', line 49

def 
  @metadata_path ||= File.join(@contents, 'iTunesMetadata.plist')
end

#release_typeObject



53
54
55
# File 'lib/fir/patches/parser_patch.rb', line 53

def release_type
  has_metadata? ? 'store' : 'adhoc'
end