pprof 0.3.5 → 0.3.6

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: 2f60b44644e56bc45b81947c9199dd4764fb662a
4
- data.tar.gz: db0e68c466cda99a9f3bf089c51d8acf6d6b9ce9
3
+ metadata.gz: 5fd5a0eb65712187cb4efb1466fba6604f71ad3d
4
+ data.tar.gz: fe722312dc8e97faf506517c22290626c3fb8ff9
5
5
  SHA512:
6
- metadata.gz: ce03ae54a596510d275de06aefa1d37bc303cb4e48be2ff64dfefa2df5105f4138f4a93c721fb5cf94fe8ff246577bf94d14d653fb7837d899c68dbd523a7c6e
7
- data.tar.gz: 86d71af33e77f24bfbe5a22ba24c06f9eeee51a346fe8f640b8a18520a37d317b6d00d07f2f9099c30b1b41aaf7def99861736010fc4a329c2fef88dca9c86ca
6
+ metadata.gz: 863ba694edf875abfc6d2f4f5c690ef459036e6f501f0cb811be7bb665c4eaca7b38712e8d9a6c55c51a74e1619295f037954008de933f339a05925718f3505b
7
+ data.tar.gz: b20580fd1146f228f87ad640d598ca454eed969755337fb5a3cbea9b20ad9cd97741f3bb4bdfffba41608f026cb4f0174fe2e8780ff6a0eba439c8d393439a03
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  `pprof` is a ruby library and binary to manipulate Provisioning Profiles.
8
8
 
9
- It can help you create ruby scripts to list, get information, find and filter Provisioning Profiles easily.
9
+ It can help you create ruby scripts to list, get information, find and filter local Provisioning Profiles easily.
10
10
 
11
11
  ## Installation
12
12
 
@@ -22,7 +22,7 @@ _(You might need to run this command with `sudo` if your gem home is a system di
22
22
 
23
23
  * Clone the repository
24
24
  * Build it using `gem build pprof.gemspec`
25
- * Install it using `gem install pprof-0.3.1.gem`
25
+ * Install it using `gem install pprof-*.gem` (replace `*` with the current version number)
26
26
 
27
27
  ## Example usages
28
28
 
@@ -166,7 +166,6 @@ PProf::Entitlements
166
166
  There's plenty of room for improvement, including:
167
167
 
168
168
  * Additional filters
169
- * Ability to change the output format
170
169
  * Parsing of additional entitlement keys
171
170
 
172
171
  Don't hesitate to contribute, either with an Issue to give ideas or additional keys that aren't parsed yet, or via a Pull Request to provide new features yourself!
data/bin/pprof CHANGED
@@ -24,7 +24,7 @@ list_options = { :mode => :table }
24
24
  parser = OptionParser.new do |opts|
25
25
  opts.banner = <<-BANNER.gsub(/^ *\|/,'')
26
26
  |Usage:
27
- | pprof [print_options] [PATH|UUID]
27
+ | pprof [print_options] (PATH|UUID)
28
28
  | pprof [list_options] [filters]
29
29
  |
30
30
  |Note: All filters expecting a string are interpreted as regular expressions if surrounded by slashes
@@ -52,7 +52,7 @@ parser = OptionParser.new do |opts|
52
52
  opts.on("-p", "--path", "Print only the paths, one per line (instead of an ASCII table)") do
53
53
  list_options[:mode] = :path
54
54
  end
55
- opts.on("-0", "--print0", "Separate each found entry by \0, to be used by `xargs -0`") do
55
+ opts.on("-0", "--print0", "Separate each found entry by \\0, to be used by `xargs -0`") do
56
56
  list_options[:zero] = true
57
57
  end
58
58
 
@@ -91,7 +91,7 @@ parser = OptionParser.new do |opts|
91
91
  filters[:all_devices] = d
92
92
  end
93
93
 
94
- opts.on("--aps [ENV]", "Only profiles having Push entitlements (on a specific aps env)") do |env|
94
+ opts.on("--aps [ENV]", "Only profiles having Push entitlements (or a specific aps env)") do |env|
95
95
  filters[:aps_env] = env.nil? ? true : matcher(env)
96
96
  end
97
97
 
@@ -142,9 +142,13 @@ if ARGV.empty?
142
142
  o.print_filtered_list(PProf::ProvisioningProfile::DEFAULT_DIR, filters, list_options)
143
143
  else
144
144
  # Print info about given profile path/UUID
145
- p = PProf::ProvisioningProfile.new(ARGV[0])
146
-
147
145
  o = PProf::OutputFormatter.new
148
- options = { :info => true } if options.empty?
149
- o.print_info(p, options)
146
+ begin
147
+ p = PProf::ProvisioningProfile.new(ARGV[0])
148
+
149
+ options = { :info => true } if options.empty?
150
+ o.print_info(p, options)
151
+ rescue Exception => e
152
+ o.print_error(e, ARGV[0])
153
+ end
150
154
  end
@@ -38,6 +38,17 @@ module PProf
38
38
  end
39
39
  end
40
40
 
41
+ # Prints an error message
42
+ #
43
+ # @param [String] message
44
+ # The error message to print
45
+ # @param [String] file
46
+ # The provisioning profile file for which the error occurred
47
+ #
48
+ def print_error(message, file)
49
+ @output.puts "\u{274c} #{file} - #{message}"
50
+ end
51
+
41
52
  # Prints the description of a Provisioning Profile
42
53
  #
43
54
  # @param [PProf::ProvisioningProfile] profile
@@ -120,6 +131,7 @@ module PProf
120
131
  #
121
132
  def print_table(dir = PProf::ProvisioningProfile::DEFAULT_DIR)
122
133
  count = 0
134
+ errors = []
123
135
 
124
136
  table = PProf::OutputFormatter::ASCIITable.new(36, 60, 45, 25, 2, 10)
125
137
  @output.puts table.separator
@@ -127,17 +139,25 @@ module PProf
127
139
  @output.puts table.separator
128
140
 
129
141
  Dir[dir + '/*.mobileprovision'].each do |file|
130
- p = PProf::ProvisioningProfile.new(file)
142
+ begin
143
+ p = PProf::ProvisioningProfile.new(file)
131
144
 
132
- next if block_given? && !yield(p)
145
+ next if block_given? && !yield(p)
133
146
 
134
- state = DateTime.now < p.expiration_date ? "\u{2705}" : "\u{274c}" # 2705=checkmark, 274C=red X
135
- @output.puts table.row(p.uuid, p.name, p.entitlements.app_id, p.expiration_date.to_time, state, p.team_name)
147
+ state = DateTime.now < p.expiration_date ? "\u{2705}" : "\u{274c}" # 2705=checkmark, 274C=red X
148
+ @output.puts table.row(p.uuid, p.name, p.entitlements.app_id, p.expiration_date.to_time, state, p.team_name)
149
+ rescue Exception => e
150
+ errors << { :message => e, :file => file }
151
+ end
136
152
  count += 1
137
153
  end
138
154
 
139
155
  @output.puts table.separator
140
156
  @output.puts "#{count} Provisioning Profiles found."
157
+
158
+ unless errors.empty?
159
+ errors.each { |e| print_error(e[:message], e[:file]) }
160
+ end
141
161
  end
142
162
 
143
163
  # Prints the filtered list of UUIDs or Paths only
@@ -151,12 +171,20 @@ module PProf
151
171
  # return true to display the row, false to filter it out
152
172
  #
153
173
  def print_list(dir = PProf::ProvisioningProfile::DEFAULT_DIR, options)
174
+ errors = []
154
175
  Dir[dir + '/*.mobileprovision'].each do |file|
155
- p = PProf::ProvisioningProfile.new(file)
156
- next if block_given? && !yield(p)
157
-
158
- @output.print options[:mode] == :uuid ? p.uuid.chomp : file.chomp
159
- @output.print options[:zero] ? "\0" : "\n"
176
+ begin
177
+ p = PProf::ProvisioningProfile.new(file)
178
+ next if block_given? && !yield(p)
179
+
180
+ @output.print options[:mode] == :uuid ? p.uuid.chomp : file.chomp
181
+ @output.print options[:zero] ? "\0" : "\n"
182
+ rescue Exception => e
183
+ errors << { :message => e, :file => file }
184
+ end
185
+ end
186
+ unless errors.empty?
187
+ errors.each { |e| print_error(e[:message], e[:file]) }
160
188
  end
161
189
  end
162
190
 
@@ -27,6 +27,7 @@ module PProf
27
27
  pkcs7 = OpenSSL::PKCS7.new(File.read(path))
28
28
  pkcs7.verify([], OpenSSL::X509::Store.new)
29
29
  @plist = Plist::parse_xml(pkcs7.data)
30
+ raise "Can'Unable to parse file #{file}." if @plist.nil?
30
31
  end
31
32
 
32
33
  # The name of the Provisioning Profile
@@ -1,4 +1,4 @@
1
1
  module PProf
2
2
  # Module version
3
- VERSION = '0.3.5'
3
+ VERSION = '0.3.6'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Halligon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-03 00:00:00.000000000 Z
11
+ date: 2017-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist
@@ -59,8 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  requirements: []
61
61
  rubyforge_project:
62
- rubygems_version: 2.6.7
62
+ rubygems_version: 2.4.7
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: A Provisioning Profiles library
66
66
  test_files: []
67
+ has_rdoc: