app-info 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 223887d0f8f212116e95c94ad9c7719821b087ce
4
- data.tar.gz: 2f5bd1d0bbcfcd1ef1b686d87cba545f5be2d005
3
+ metadata.gz: bf857c2c3bd200c345b20018226ba6e110a1333e
4
+ data.tar.gz: 952b70193619d07dd8dd94c6b580017d393a2efa
5
5
  SHA512:
6
- metadata.gz: 87f81624016cfbc221a7a24f0494998749ee2d5c5c8cfc49c42c50af256268e7f0614b8b5212f06aaa531b3da2a42cc6e6d828f9ce25af010ff93298c31b1883
7
- data.tar.gz: 0c426700c7e15ec6784635a9125e726e50eee6dbebf7de10676f8aaa7ecbe8259e5ddb89278f9460be07ad26eeb69a7fa20b0649d5c199d7abd951667444bae6
6
+ metadata.gz: b569637dbf441d2e4d823408f922c0aed502a75a791cf89a32d31200e3843e651352d6a547cc1267d7173d7b71886df6ca57cfff2290f4a3598b32af02fa45fa
7
+ data.tar.gz: a3dfe2c7e4045611369b958c08901d6ee626703a4f71650a165a9d812f30b8350a55e7de750bf95d9bd80775228afbf5291d430073670e32764523eb47ff6a3e
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'pngdefry', '~> 0.1.2'
22
22
  spec.add_dependency 'ruby_android', '~> 0.7.7'
23
23
  spec.add_dependency 'image_size', '~> 1.5.0'
24
- spec.add_dependency 'os', '~> 0.9.6'
25
24
 
26
25
  spec.add_development_dependency 'bundler', '~> 1.12'
27
26
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -10,5 +10,9 @@ module AppInfo
10
10
  IOS = 'iOS'.freeze
11
11
  ANDROID = 'Android'.freeze
12
12
  end
13
+
14
+ def self.mac?
15
+ RbConfig::CONFIG['host_os'] =~ /darwin/ ? true : false
16
+ end
13
17
  end
14
18
  end
@@ -1,4 +1,3 @@
1
- require 'os'
2
1
  require 'pngdefry'
3
2
  require 'fileutils'
4
3
  require 'securerandom'
@@ -17,6 +16,7 @@ module AppInfo
17
16
  ADHOC = 'AdHoc'.freeze
18
17
  INHOUSE = 'inHouse'.freeze
19
18
  RELEASE = 'Release'.freeze
19
+ UNKOWN = nil
20
20
  end
21
21
 
22
22
  def initialize(file)
@@ -28,6 +28,18 @@ module AppInfo
28
28
  Parser::Platform::IOS
29
29
  end
30
30
 
31
+ def iphone?
32
+ info.iphone?
33
+ end
34
+
35
+ def ipad?
36
+ info.ipad?
37
+ end
38
+
39
+ def universal?
40
+ info.universal?
41
+ end
42
+
31
43
  def build_version
32
44
  info.build_version
33
45
  end
@@ -56,6 +68,10 @@ module AppInfo
56
68
  info.icons
57
69
  end
58
70
 
71
+ def device_type
72
+ info.device_type
73
+ end
74
+
59
75
  def devices
60
76
  mobileprovision.devices
61
77
  end
@@ -80,22 +96,6 @@ module AppInfo
80
96
  "#{profile_name} - #{team_name}" if profile_name && team_name
81
97
  end
82
98
 
83
- def device_type
84
- info.device_type
85
- end
86
-
87
- def iphone?
88
- info.iphone?
89
- end
90
-
91
- def ipad?
92
- info.ipad?
93
- end
94
-
95
- def universal?
96
- info.universal?
97
- end
98
-
99
99
  def release_type
100
100
  if stored?
101
101
  ExportType::RELEASE
@@ -105,6 +105,8 @@ module AppInfo
105
105
  end
106
106
 
107
107
  def build_type
108
+ return ExportType::UNKOWN unless AppInfo::Parser.mac?
109
+
108
110
  if mobileprovision?
109
111
  if devices
110
112
  ExportType::ADHOC
@@ -124,25 +126,13 @@ module AppInfo
124
126
  mobileprovision.delete('DeveloperCertificates') if mobileprovision?
125
127
  end
126
128
 
127
- def cleanup!
128
- return unless @contents
129
- FileUtils.rm_rf(@contents)
130
-
131
- @contents = nil
132
- @icons = nil
133
- @app_path = nil
134
- @metadata = nil
135
- @metadata_path = nil
136
- @info = nil
137
- end
138
-
139
129
  def mobileprovision
140
130
  return unless mobileprovision?
141
131
  return @mobileprovision if @mobileprovision
142
132
 
143
- return MobileProvision.new(nil) unless OS.mac?
133
+ file = AppInfo::Parser.mac? ? mobileprovision_path : nil
144
134
 
145
- @mobileprovision = MobileProvision.new(mobileprovision_path)
135
+ @mobileprovision = MobileProvision.new(file)
146
136
  end
147
137
 
148
138
  def mobileprovision?
@@ -180,6 +170,18 @@ module AppInfo
180
170
  @app_path ||= Dir.glob(File.join(contents, 'Payload', '*.app')).first
181
171
  end
182
172
 
173
+ def cleanup!
174
+ return unless @contents
175
+ FileUtils.rm_rf(@contents)
176
+
177
+ @contents = nil
178
+ @icons = nil
179
+ @app_path = nil
180
+ @metadata = nil
181
+ @metadata_path = nil
182
+ @info = nil
183
+ end
184
+
183
185
  alias bundle_id identifier
184
186
 
185
187
  private
@@ -59,6 +59,8 @@ module AppInfo
59
59
  end
60
60
 
61
61
  def mobileprovision
62
+ return @mobileprovision = nil if @path.nil? or @path.empty? or !File.exist?(@path)
63
+
62
64
  data = `security cms -D -i "#{@path}"`
63
65
  @mobileprovision = CFPropertyList.native_types(CFPropertyList::List.new(data: data).value)
64
66
  rescue CFFormatError
@@ -1,3 +1,3 @@
1
1
  module AppInfo
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-info
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2016-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.5.0
69
- - !ruby/object:Gem::Dependency
70
- name: os
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.9.6
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.9.6
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: bundler
85
71
  requirement: !ruby/object:Gem::Requirement