cupertino 1.2.4 → 1.3.0

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: b6c000e726d18071863159320768af80da7e55de
4
- data.tar.gz: 1653b571d2571e4eef7be5cd0a9e91b78da6f237
3
+ metadata.gz: 564497e96b96972b59f3aa641eb7ba834e4fd4ce
4
+ data.tar.gz: e130a2842a126f0a3a142beea86ac428f5f8f32c
5
5
  SHA512:
6
- metadata.gz: 67af2535179d4cab89f10e314bd6f3a5d35009e870249864d8fe977802883532a108d884a81bf75d182925e856cbd351233e5c6410afb4bb08e8155a02e21f5c
7
- data.tar.gz: eeb0494c55f8f650a146e33079ff21c8f3a6a437f9448cfa355bc3dd2d6d5c38f4a4e37b7a0bf7b419a213f49c2ce36593903ad8059d406d39614355e54ea46b
6
+ metadata.gz: 2a12c15e3a122bd363c139dc836fede7ba3bc397d62f4062c34adc4f5a981159099097064241eb1fdbd60a3ec863c144be47582b94265af1d514c362f45bd976
7
+ data.tar.gz: ef3244eac9b14c4ad643a973a5528bd77c0806e6e72fc57a38a416d6d31fef2cf0fb2708a22e97c80338489f06b74c2dbda4e2189cf3c6916c173f3c9d6f4540
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cupertino (1.2.4)
4
+ cupertino (1.3.0)
5
5
  certified (>= 0.1.0)
6
6
  commander (~> 4.2.0)
7
7
  mechanize (~> 2.5.1)
data/README.md CHANGED
@@ -139,6 +139,15 @@ $ ios certificates:download --type distribution
139
139
  $ ios certificates:download NAME
140
140
  ```
141
141
 
142
+ ## CSV Output
143
+
144
+ The following commands will format their output as [comma-separated values](http://en.wikipedia.org/wiki/Comma-separated_values) when the `--format csv` argument is passed:
145
+
146
+ - `app_ids:list`
147
+ - `devices:list`
148
+ - `profiles:list`
149
+ - `profiles:manage:devices:list`
150
+
142
151
  ## Commands
143
152
 
144
153
  - `login`
@@ -156,16 +165,6 @@ $ ios certificates:download NAME
156
165
  - `certificates:download`
157
166
  - `app_ids:list`
158
167
 
159
- ### Disabled Commands
160
-
161
- > With the latest updates to the Apple Developer Portal, the following functionality has been removed.
162
-
163
- - `pass_type_ids:list`
164
- - `pass_type_ids:add`
165
- - `pass_type_ids:certificates:list`
166
- - `pass_type_ids:certificates:add`
167
- - `pass_type_ids:certificates:download`
168
-
169
168
  ## Proxies
170
169
 
171
170
  Cupertino will access the provisioning portal through a proxy if the `HTTP_PROXY` environment variable is set, with optional credentials `HTTP_PROXY_USER` and `HTTP_PROXY_PASSWORD`.
data/bin/ios CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'commander/import'
4
4
  require 'terminal-table'
5
5
  require 'term/ansicolor'
6
+ require 'csv'
6
7
 
7
8
  require 'cupertino'
8
9
 
Binary file
@@ -9,7 +9,7 @@ require 'logger'
9
9
  module Cupertino
10
10
  module ProvisioningPortal
11
11
  class Agent < ::Mechanize
12
- attr_accessor :username, :password, :team
12
+ attr_accessor :username, :password, :team, :team_id
13
13
 
14
14
  def initialize
15
15
  super
@@ -11,26 +11,37 @@ command :'app_ids:list' do |c|
11
11
  c.action do |args, options|
12
12
  app_ids = try{agent.list_app_ids}
13
13
 
14
- title = "Legend: #{COLORS_BY_PROPERTY_VALUES.collect{|k, v| k.send(v)}.join(', ')}"
15
- table = Terminal::Table.new :title => title do |t|
16
- t << ["Bundle Seed ID", "Description", "Development", "Distribution"]
17
- app_ids.each do |app_id|
18
- t << :separator
19
-
20
- row = [app_id.bundle_seed_id, app_id.description]
21
- [app_id.development_properties, app_id.distribution_properties].each do |properties|
22
- values = []
23
- properties.each do |key, value|
24
- color = COLORS_BY_PROPERTY_VALUES[value] || :reset
25
- values << key.sub(/\:$/, "").send(color)
26
- end
27
- row << values.join("\n")
28
- end
29
- t << row
30
- end
31
- end
14
+ say_warning "No App IDs found" and abort if app_ids.empty?
15
+
16
+ output = case options.format
17
+ when :csv
18
+ CSV.generate do |csv|
19
+ csv << ["Bundle Seed ID", "Description"]
20
+ app_ids.each do |app_id|
21
+ csv << [app_id.bundle_seed_id, app_id.description]
22
+ end
23
+ end
24
+ else
25
+ title = "Legend: #{COLORS_BY_PROPERTY_VALUES.collect{|k, v| k.send(v)}.join(', ')}"
26
+ Terminal::Table.new :title => title do |t|
27
+ t << ["Bundle Seed ID", "Description", "Development", "Distribution"]
28
+ app_ids.each do |app_id|
29
+ t << :separator
30
+ row = [app_id.bundle_seed_id, app_id.description]
31
+ [app_id.development_properties, app_id.distribution_properties].each do |properties|
32
+ values = []
33
+ properties.each do |key, value|
34
+ color = COLORS_BY_PROPERTY_VALUES[value] || :reset
35
+ values << key.sub(/\:$/, "").send(color)
36
+ end
37
+ row << values.join("\n")
38
+ end
39
+ t << row
40
+ end
41
+ end
42
+ end
32
43
 
33
- puts table
44
+ puts output
34
45
  end
35
46
  end
36
47
 
@@ -8,22 +8,33 @@ command :'certificates:list' do |c|
8
8
 
9
9
  say_warning "No #{type} certificates found." and abort if certificates.empty?
10
10
 
11
- table = Terminal::Table.new do |t|
12
- t << ["Name", "Type", "Expiration Date", "Status"]
13
- t.add_separator
14
- certificates.each do |certificate|
15
- status = case certificate.status
16
- when "Issued"
17
- certificate.status.green
18
- else
19
- certificate.status.red
20
- end
11
+ output = case options.format
12
+ when :csv
13
+ CSV.generate do |csv|
14
+ csv << ["Name", "Type", "Expiration Date", "Status"]
21
15
 
22
- t << [certificate.name, certificate.type, certificate.expiration, status]
23
- end
24
- end
16
+ certificates.each do |certificate|
17
+ csv << [certificate.name, certificate.type, certificate.expiration, certificate.status]
18
+ end
19
+ end
20
+ else
21
+ Terminal::Table.new do |t|
22
+ t << ["Name", "Type", "Expiration Date", "Status"]
23
+ t.add_separator
24
+ certificates.each do |certificate|
25
+ status = case certificate.status
26
+ when "Issued"
27
+ certificate.status.green
28
+ else
29
+ certificate.status.red
30
+ end
31
+
32
+ t << [certificate.name, certificate.type, certificate.expiration, status]
33
+ end
34
+ end
35
+ end
25
36
 
26
- puts table
37
+ puts output
27
38
  end
28
39
  end
29
40
 
@@ -5,23 +5,36 @@ command :'devices:list' do |c|
5
5
  c.action do |args, options|
6
6
  devices = try{agent.list_devices}
7
7
 
8
- number_of_devices = devices.compact.length
9
- number_of_additional_devices = devices.length - number_of_devices
10
-
11
- title = "Listing #{pluralize(number_of_devices, 'device')} "
12
- title += "(You can register #{pluralize(number_of_additional_devices, 'additional device')})" if number_of_additional_devices > 0
13
-
14
- table = Terminal::Table.new :title => title do |t|
15
- t << ["Device Name", "Device Identifier", "Enabled"]
16
- t.add_separator
17
- devices.compact.each do |device|
18
- t << [device.name, device.udid, device.enabled]
19
- end
20
- end
8
+ say_warning "No devices found" and abort if devices.empty?
9
+
10
+ output = case options.format
11
+ when :csv
12
+ CSV.generate do |csv|
13
+ csv << ["Device Name", "Device Identifier", "Enabled"]
14
+
15
+ devices.compact.each do |device|
16
+ csv << [device.name, device.udid, device.enabled]
17
+ end
18
+ end
19
+ else
20
+ number_of_devices = devices.compact.length
21
+ number_of_additional_devices = devices.length - number_of_devices
22
+
23
+ title = "Listing #{pluralize(number_of_devices, 'device')} "
24
+ title += "(You can register #{pluralize(number_of_additional_devices, 'additional device')})" if number_of_additional_devices > 0
25
+
26
+ Terminal::Table.new :title => title do |t|
27
+ t << ["Device Name", "Device Identifier", "Enabled"]
28
+ t.add_separator
29
+ devices.compact.each do |device|
30
+ t << [device.name, device.udid, device.enabled]
31
+ end
21
32
 
22
- table.align_column 2, :center
33
+ t.align_column 2, :center
34
+ end
35
+ end
23
36
 
24
- puts table
37
+ puts output
25
38
  end
26
39
  end
27
40
 
@@ -10,22 +10,33 @@ command :'profiles:list' do |c|
10
10
 
11
11
  say_warning "No #{type} provisioning profiles found." and abort if profiles.empty?
12
12
 
13
- table = Terminal::Table.new do |t|
14
- t << ["Profile", "App ID", "Expiration", "Status"]
15
- t.add_separator
16
- profiles.each do |profile|
17
- status = case profile.status
18
- when "Invalid"
19
- profile.status.red
20
- else
21
- profile.status.green
22
- end
13
+ output = case options.format
14
+ when :csv
15
+ CSV.generate do |csv|
16
+ csv << ["Profile", "App ID", "UUID", "Expiration", "Status"]
23
17
 
24
- t << [profile.name, profile.app_id, profile.expiration, status]
25
- end
26
- end
18
+ profiles.each do |profile|
19
+ csv << [profile.name, profile.app_id, profile.identifier, profile.expiration, profile.status]
20
+ end
21
+ end
22
+ else
23
+ Terminal::Table.new do |t|
24
+ t << ["Profile", "App ID", "UUID", "Expiration", "Status"]
25
+ t.add_separator
26
+ profiles.each do |profile|
27
+ status = case profile.status
28
+ when "Invalid"
29
+ profile.status.red
30
+ else
31
+ profile.status.green
32
+ end
33
+
34
+ t << [profile.name, profile.app_id, profile.identifier, profile.expiration, status]
35
+ end
36
+ end
37
+ end
27
38
 
28
- puts table
39
+ puts output
29
40
  end
30
41
  end
31
42
 
@@ -196,22 +207,34 @@ command :'profiles:manage:devices:list' do |c|
196
207
 
197
208
  list = agent.list_devices_for_profile(profile)
198
209
 
199
- title = "Listing devices for provisioning profile #{profile.name}"
210
+ output = case options.format
211
+ when :csv
212
+ CSV.generate do |csv|
213
+ csv << ["Device Name", "Device Identifier", "Active"]
200
214
 
201
- table = Terminal::Table.new :title => title do |t|
202
- t << ["Device Name", "Device Identifier", "Active"]
203
- t.add_separator
204
- list[:on].each do |device|
205
- t << [device.name, device.udid, "Y"]
206
- end
207
- list[:off].each do |device|
208
- t << [device.name, device.udid, "N"]
209
- end
210
- end
211
-
212
- table.align_column 2, :center
213
-
214
- puts table
215
+ list.values.each do |devices|
216
+ devices.each do |device|
217
+ csv << [device.name, device.udid, "Y"]
218
+ end
219
+ end
220
+ end
221
+ else
222
+ title = "Listing devices for provisioning profile #{profile.name}"
223
+ Terminal::Table.new :title => title do |t|
224
+ t << ["Device Name", "Device Identifier", "Active"]
225
+ t.add_separator
226
+ list[:on].each do |device|
227
+ t << [device.name, device.udid, "Y"]
228
+ end
229
+ list[:off].each do |device|
230
+ t << [device.name, device.udid, "N"]
231
+ end
232
+
233
+ t.align_column 2, :center
234
+ end
235
+ end
236
+
237
+ puts output
215
238
  end
216
239
  end
217
240
 
@@ -8,6 +8,7 @@ global_option('-p', '--password PASSWORD', 'Password') { |arg| agent.password =
8
8
  global_option('--team TEAM', 'Team') { |arg| agent.team = arg if arg }
9
9
  global_option('--info', 'Set log level to INFO') { agent.log.level = Logger::INFO }
10
10
  global_option('--debug', 'Set log level to DEBUG') { agent.log.level = Logger::DEBUG }
11
+ global_option('--format FORMAT', [:table, :csv], "Set output format (default: table)")
11
12
 
12
13
  require 'cupertino/provisioning_portal/commands/certificates'
13
14
  require 'cupertino/provisioning_portal/commands/devices'
@@ -1,3 +1,3 @@
1
1
  module Cupertino
2
- VERSION = '1.2.4'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cupertino
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
@@ -146,6 +146,7 @@ files:
146
146
  - ./cupertino-1.2.1.gem
147
147
  - ./cupertino-1.2.2.gem
148
148
  - ./cupertino-1.2.3.gem
149
+ - ./cupertino-1.2.4.gem
149
150
  - ./cupertino.gemspec
150
151
  - ./Gemfile
151
152
  - ./Gemfile.lock