Module: IpaAccountCheck

Defined in:
lib/ipa_account_check.rb,
lib/ipa_account_check/version.rb

Constant Summary collapse

METADATA_FILENAME =
"iTunesMetadata.plist"
VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.extract_metadata(filename) ⇒ Object



26
27
28
29
30
# File 'lib/ipa_account_check.rb', line 26

def self.(filename)
  Zip::ZipFile.open(filename) do |zipfile|
    zipfile.read(METADATA_FILENAME)
  end
end

.fetch_account_from_xml(xml) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/ipa_account_check.rb', line 18

def self.(xml)
  # Format:
  # 	<key>appleId</key>
  #   <string>[email protected]</string>
  regexp = /<key>appleId<\/key>\s*<string>([^>]*)<\/string>/im
  xml.match(regexp)[1]
end

.proccess(file) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/ipa_account_check.rb', line 7

def self.proccess(file)
  unless File.file?(file)
    puts "No such file - #{file}"
    return
  end
  
  xml = (file)
   = (xml)
  puts "#{file} | #{}"
end