ipa 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source :gemcutter
2
+
3
+ # Specify your gem's dependencies in ipa.gemspec
4
+ gemspec
5
+
6
+ gem 'rake'
7
+ gem 'plist', '~> 3.1.7', :git => 'https://github.com/sjmulder/plist.git'
@@ -0,0 +1,27 @@
1
+ GIT
2
+ remote: https://github.com/sjmulder/plist.git
3
+ revision: 19146cdab122374fece2c49678c7ab425612be83
4
+ specs:
5
+ plist (3.1.7)
6
+
7
+ PATH
8
+ remote: .
9
+ specs:
10
+ ipa (0.1.1)
11
+ plist (~> 3.1.7)
12
+ rubyzip (~> 0.9.4)
13
+
14
+ GEM
15
+ remote: http://rubygems.org/
16
+ specs:
17
+ rake (0.9.2)
18
+ rubyzip (0.9.4)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ bundler (>= 1.0.0)
25
+ ipa!
26
+ plist (~> 3.1.7)!
27
+ rake
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/ipa/version', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'ipa'
6
+ s.version = IPA::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Sijmen J. Mulder']
9
+ s.email = ['sjmulder@gmail.com']
10
+ s.homepage = 'https://github.com/sjmulder/ipa'
11
+ s.summary = 'Reads metadata from IPA files'
12
+ s.description = 'Reads metadata from iPhone/iPad IPA files, such as title, version, and icon files.'
13
+
14
+ s.required_rubygems_version = '>= 1.3.6'
15
+ s.rubyforge_project = 'ipa'
16
+
17
+ s.add_dependency 'rubyzip', '~> 0.9.4'
18
+ s.add_dependency 'plist', '~> 3.1.7'
19
+ s.add_development_dependency 'bundler', '>= 1.0.0'
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
23
+ s.require_path = 'lib'
24
+ end
@@ -0,0 +1,69 @@
1
+ require 'zip/zip'
2
+ require 'zip/zipfilesystem'
3
+ require 'plist'
4
+ require 'plist/binary'
5
+
6
+ module IPA
7
+ class IPAFile
8
+ MAPPED_INFO_KEYS = {
9
+ :name => 'CFBundleName',
10
+ :display_name => 'CFBundleDisplayName',
11
+ :identifier => 'CFBundleIdentifier',
12
+ :icon_path => 'CFBundleIconFile',
13
+ :icon_paths => 'CFBundleIconFiles',
14
+ :is_iphone => 'LSRequiresIPhoneOS',
15
+ :app_category => 'LSApplicationCategoryType',
16
+ :version => 'CFBundleVersion',
17
+ :version_string => 'CFBundleShortVersionString'
18
+ }
19
+
20
+ MAPPED_INFO_KEYS.each do |method_name, key_name|
21
+ define_method method_name do
22
+ info[key_name]
23
+ end
24
+ end
25
+
26
+ def self.open(filename, &block)
27
+ IPAFile.new(filename, &block)
28
+ end
29
+
30
+ def initialize(filename, &block)
31
+ @zipfile = Zip::ZipFile.open(filename)
32
+ unless block.nil?
33
+ yield self
34
+ close
35
+ end
36
+ end
37
+
38
+ def close
39
+ @zipfile.close
40
+ end
41
+
42
+ def payload_path(filename = nil)
43
+ @payload_path ||= File.join('Payload',
44
+ @zipfile.dir.entries('Payload').
45
+ first{ |name| name =~ /\.app$/ })
46
+
47
+ filename.nil? ? @payload_path : File.join(@payload_path, filename)
48
+ end
49
+
50
+ def payload_file(filename, &block)
51
+ data = @zipfile.read(payload_path(filename))
52
+ yield data unless block.nil?
53
+ data
54
+ end
55
+
56
+ def info
57
+ @info_plist ||= Plist::Binary::decode_binary_plist(
58
+ payload_file('Info.plist'))
59
+ end
60
+
61
+ def icon
62
+ payload_file('Icon.png')
63
+ end
64
+
65
+ def artwork
66
+ payload_file('iTunesArtwork')
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,3 @@
1
+ module IPA
2
+ VERSION = "0.1.1"
3
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ipa
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
10
+ platform: ruby
11
+ authors:
12
+ - Sijmen J. Mulder
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-08-12 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ~>
24
+ - !ruby/object:Gem::Version
25
+ segments:
26
+ - 0
27
+ - 9
28
+ - 4
29
+ version: 0.9.4
30
+ requirement: *id001
31
+ name: rubyzip
32
+ prerelease: false
33
+ type: :runtime
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 3
41
+ - 1
42
+ - 7
43
+ version: 3.1.7
44
+ requirement: *id002
45
+ name: plist
46
+ prerelease: false
47
+ type: :runtime
48
+ - !ruby/object:Gem::Dependency
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 1
55
+ - 0
56
+ - 0
57
+ version: 1.0.0
58
+ requirement: *id003
59
+ name: bundler
60
+ prerelease: false
61
+ type: :development
62
+ description: Reads metadata from iPhone/iPad IPA files, such as title, version, and icon files.
63
+ email:
64
+ - sjmulder@gmail.com
65
+ executables: []
66
+
67
+ extensions: []
68
+
69
+ extra_rdoc_files: []
70
+
71
+ files:
72
+ - .gitignore
73
+ - Gemfile
74
+ - Gemfile.lock
75
+ - Rakefile
76
+ - ipa.gemspec
77
+ - lib/ipa.rb
78
+ - lib/ipa/version.rb
79
+ has_rdoc: true
80
+ homepage: https://github.com/sjmulder/ipa
81
+ licenses: []
82
+
83
+ post_install_message:
84
+ rdoc_options: []
85
+
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ segments:
100
+ - 1
101
+ - 3
102
+ - 6
103
+ version: 1.3.6
104
+ requirements: []
105
+
106
+ rubyforge_project: ipa
107
+ rubygems_version: 1.3.6
108
+ signing_key:
109
+ specification_version: 3
110
+ summary: Reads metadata from IPA files
111
+ test_files: []
112
+