cupertino 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -20
- data/README.md +6 -2
- data/cupertino.gemspec +2 -0
- data/lib/cupertino/provisioning_portal/agent.rb +32 -19
- data/lib/cupertino/provisioning_portal/commands/devices.rb +8 -5
- data/lib/cupertino/provisioning_portal/commands/profiles.rb +58 -29
- data/lib/cupertino/provisioning_portal/commands.rb +4 -0
- data/lib/cupertino/provisioning_portal/helpers.rb +4 -4
- data/lib/cupertino/provisioning_portal.rb +2 -2
- data/lib/cupertino.rb +1 -1
- metadata +26 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2fe21bc508207cbfaf9d5a89cec2ff1b4371126
|
|
4
|
+
data.tar.gz: 87a5b6c64e5e0282986bcc0da0b47aa04dcf6d4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1cd6cc09b28b4aeee344a2727f53fc51edab09162811708614f66f64263277edca0fc958c23ef366c0a7d946e162ad70490cc377eca534d05691f16ce210193
|
|
7
|
+
data.tar.gz: f9a84ebc0faf92930ec89ab5e08f7c8659140d1193c5d7528d0b7d2b297f146bb3dec5890f9fd2b92909fa5c83ca76fdeee5025660a607e0e3a4527c12795143
|
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cupertino (0.
|
|
4
|
+
cupertino (0.9.0)
|
|
5
5
|
certified (>= 0.1.0)
|
|
6
6
|
commander (~> 4.1.2)
|
|
7
7
|
mechanize (~> 2.5.1)
|
|
8
|
+
nokogiri (~> 1.5.9)
|
|
8
9
|
security (~> 0.1.2)
|
|
9
10
|
shenzhen (>= 0.0.1)
|
|
10
11
|
term-ansicolor (~> 1.0.7)
|
|
@@ -14,16 +15,17 @@ GEM
|
|
|
14
15
|
remote: https://rubygems.org/
|
|
15
16
|
specs:
|
|
16
17
|
certified (0.1.1)
|
|
17
|
-
commander (4.1.
|
|
18
|
+
commander (4.1.5)
|
|
18
19
|
highline (~> 1.6.11)
|
|
19
|
-
domain_name (0.5.
|
|
20
|
-
unf (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
domain_name (0.5.12)
|
|
21
|
+
unf (>= 0.0.5, < 1.0.0)
|
|
22
|
+
dotenv (0.9.0)
|
|
23
|
+
faraday (0.8.8)
|
|
24
|
+
multipart-post (~> 1.2.0)
|
|
25
|
+
faraday_middleware (0.9.0)
|
|
24
26
|
faraday (>= 0.7.4, < 0.9)
|
|
25
|
-
highline (1.6.
|
|
26
|
-
json (1.
|
|
27
|
+
highline (1.6.19)
|
|
28
|
+
json (1.8.0)
|
|
27
29
|
mechanize (2.5.1)
|
|
28
30
|
domain_name (~> 0.5, >= 0.5.1)
|
|
29
31
|
mime-types (~> 1.17, >= 1.17.2)
|
|
@@ -32,26 +34,27 @@ GEM
|
|
|
32
34
|
nokogiri (~> 1.4)
|
|
33
35
|
ntlm-http (~> 0.1, >= 0.1.1)
|
|
34
36
|
webrobots (~> 0.0, >= 0.0.9)
|
|
35
|
-
mime-types (1.
|
|
37
|
+
mime-types (1.25)
|
|
36
38
|
multipart-post (1.2.0)
|
|
37
|
-
net-http-digest_auth (1.
|
|
39
|
+
net-http-digest_auth (1.3)
|
|
38
40
|
net-http-persistent (2.8)
|
|
39
|
-
nokogiri (1.5.
|
|
41
|
+
nokogiri (1.5.10)
|
|
40
42
|
ntlm-http (0.1.1)
|
|
41
43
|
rake (0.9.2.2)
|
|
42
44
|
rspec (0.6.4)
|
|
43
45
|
security (0.1.2)
|
|
44
|
-
shenzhen (0.
|
|
45
|
-
commander (~> 4.1
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
shenzhen (0.4.0)
|
|
47
|
+
commander (~> 4.1)
|
|
48
|
+
dotenv (~> 0.7)
|
|
49
|
+
faraday (~> 0.8)
|
|
50
|
+
faraday_middleware (~> 0.9)
|
|
51
|
+
json (~> 1.8)
|
|
49
52
|
term-ansicolor (1.0.7)
|
|
50
53
|
terminal-table (1.4.5)
|
|
51
|
-
unf (0.
|
|
54
|
+
unf (0.1.1)
|
|
52
55
|
unf_ext
|
|
53
|
-
unf_ext (0.0.
|
|
54
|
-
webrobots (0.
|
|
56
|
+
unf_ext (0.0.6)
|
|
57
|
+
webrobots (0.1.1)
|
|
55
58
|
|
|
56
59
|
PLATFORMS
|
|
57
60
|
ruby
|
data/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
**CLI for the Apple Dev Center**
|
|
1
|
+

|
|
3
2
|
|
|
4
3
|
Automate administrative tasks that you would normally have to do through the Apple Dev Center websites. Life's too short to manage device identifiers by hand!
|
|
5
4
|
|
|
@@ -100,6 +99,7 @@ _Removes (without an editor) a list of devices from a provisioning profile_
|
|
|
100
99
|
- `profiles:manage:devices:add`
|
|
101
100
|
- `profiles:manage:devices:remove`
|
|
102
101
|
- `profiles:download`
|
|
102
|
+
- `profiles:download:all`
|
|
103
103
|
- `certificates:list [development|distribution]`
|
|
104
104
|
- `certificates:download`
|
|
105
105
|
- `app_ids:list`
|
|
@@ -114,6 +114,10 @@ _Removes (without an editor) a list of devices from a provisioning profile_
|
|
|
114
114
|
- `pass_type_ids:certificates:add`
|
|
115
115
|
- `pass_type_ids:certificates:download`
|
|
116
116
|
|
|
117
|
+
## Proxies
|
|
118
|
+
|
|
119
|
+
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`.
|
|
120
|
+
|
|
117
121
|
## Contact
|
|
118
122
|
|
|
119
123
|
Mattt Thompson
|
data/cupertino.gemspec
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
|
|
3
4
|
require "cupertino"
|
|
4
5
|
|
|
5
6
|
Gem::Specification.new do |s|
|
|
@@ -17,6 +18,7 @@ Gem::Specification.new do |s|
|
|
|
17
18
|
s.add_dependency "terminal-table", "~> 1.4.5"
|
|
18
19
|
s.add_dependency "term-ansicolor", "~> 1.0.7"
|
|
19
20
|
s.add_dependency "mechanize", "~> 2.5.1"
|
|
21
|
+
s.add_dependency "nokogiri", "~> 1.5.9"
|
|
20
22
|
s.add_dependency "security", "~> 0.1.2"
|
|
21
23
|
s.add_dependency "shenzhen", ">= 0.0.1"
|
|
22
24
|
s.add_dependency "certified", ">= 0.1.0"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'mechanize'
|
|
2
2
|
require 'security'
|
|
3
|
+
require 'uri'
|
|
3
4
|
require 'json'
|
|
4
5
|
|
|
5
6
|
module Cupertino
|
|
@@ -9,8 +10,17 @@ module Cupertino
|
|
|
9
10
|
|
|
10
11
|
def initialize
|
|
11
12
|
super
|
|
13
|
+
|
|
12
14
|
self.user_agent_alias = 'Mac Safari'
|
|
13
15
|
|
|
16
|
+
if ENV['HTTP_PROXY']
|
|
17
|
+
uri = URI.parse(ENV['HTTP_PROXY'])
|
|
18
|
+
user = ENV['HTTP_PROXY_USER'] if ENV['HTTP_PROXY_USER']
|
|
19
|
+
password = ENV['HTTP_PROXY_PASSWORD'] if ENV['HTTP_PROXY_PASSWORD']
|
|
20
|
+
|
|
21
|
+
set_proxy(uri.host, uri.port, user || uri.user, password || uri.password)
|
|
22
|
+
end
|
|
23
|
+
|
|
14
24
|
pw = Security::InternetPassword.find(:server => Cupertino::ProvisioningPortal::HOST)
|
|
15
25
|
@username, @password = pw.attributes['acct'], pw.password if pw
|
|
16
26
|
end
|
|
@@ -24,12 +34,12 @@ module Cupertino
|
|
|
24
34
|
return page unless page.respond_to?(:title)
|
|
25
35
|
|
|
26
36
|
case page.title
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
when /Sign in with your Apple ID/
|
|
38
|
+
login! and redo
|
|
39
|
+
when /Select Team/
|
|
40
|
+
select_team! and redo
|
|
41
|
+
else
|
|
42
|
+
return page
|
|
33
43
|
end
|
|
34
44
|
end
|
|
35
45
|
|
|
@@ -38,13 +48,13 @@ module Cupertino
|
|
|
38
48
|
|
|
39
49
|
def list_certificates(type = :development)
|
|
40
50
|
url = case type
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
when :development
|
|
52
|
+
"https://developer.apple.com/account/ios/certificate/certificateList.action?type=development"
|
|
53
|
+
when :distribution
|
|
54
|
+
"https://developer.apple.com/account/ios/certificate/certificateList.action?type=distribution"
|
|
55
|
+
else
|
|
56
|
+
raise ArgumentError, "Certificate type must be :development or :distribution"
|
|
57
|
+
end
|
|
48
58
|
|
|
49
59
|
get(url)
|
|
50
60
|
|
|
@@ -59,7 +69,7 @@ module Cupertino
|
|
|
59
69
|
|
|
60
70
|
certificate_data_url += certificate_request_types + certificate_statuses
|
|
61
71
|
|
|
62
|
-
|
|
72
|
+
post(certificate_data_url)
|
|
63
73
|
certificate_data = page.content
|
|
64
74
|
parsed_certificate_data = JSON.parse(certificate_data)
|
|
65
75
|
|
|
@@ -81,7 +91,7 @@ module Cupertino
|
|
|
81
91
|
list_certificates(certificate.type)
|
|
82
92
|
|
|
83
93
|
self.pluggable_parser.default = Mechanize::Download
|
|
84
|
-
download =
|
|
94
|
+
download = post(certificate.download_url)
|
|
85
95
|
download.save
|
|
86
96
|
download.filename
|
|
87
97
|
end
|
|
@@ -92,7 +102,8 @@ module Cupertino
|
|
|
92
102
|
regex = /deviceDataURL = "([^"]*)"/
|
|
93
103
|
device_data_url = (page.body.match regex or raise UnexpectedContentError)[1]
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
post(device_data_url)
|
|
106
|
+
|
|
96
107
|
device_data = page.content
|
|
97
108
|
parsed_device_data = JSON.parse(device_data)
|
|
98
109
|
|
|
@@ -101,6 +112,7 @@ module Cupertino
|
|
|
101
112
|
device = Device.new
|
|
102
113
|
device.name = row['name']
|
|
103
114
|
device.udid = row['deviceNumber'] # Apple doesn't provide the UDID on this page anymore
|
|
115
|
+
device.enabled = (row['status'] == 'c' ? 'Y' : 'N')
|
|
104
116
|
devices << device
|
|
105
117
|
end
|
|
106
118
|
|
|
@@ -153,6 +165,7 @@ module Cupertino
|
|
|
153
165
|
raise ArgumentError, 'Provisioning profile type must be :development or :distribution'
|
|
154
166
|
end
|
|
155
167
|
|
|
168
|
+
self.pluggable_parser.default = Mechanize::File
|
|
156
169
|
get(url)
|
|
157
170
|
|
|
158
171
|
regex = /profileDataURL = "([^"]*)"/
|
|
@@ -165,7 +178,8 @@ module Cupertino
|
|
|
165
178
|
'&type=production'
|
|
166
179
|
end
|
|
167
180
|
|
|
168
|
-
|
|
181
|
+
post(profile_data_url)
|
|
182
|
+
|
|
169
183
|
profile_data = page.content
|
|
170
184
|
parsed_profile_data = JSON.parse(profile_data)
|
|
171
185
|
|
|
@@ -236,7 +250,7 @@ module Cupertino
|
|
|
236
250
|
regex = /bundleDataURL = "([^"]*)"/
|
|
237
251
|
bundle_data_url = (page.body.match regex or raise UnexpectedContentError)[1]
|
|
238
252
|
|
|
239
|
-
|
|
253
|
+
post(bundle_data_url)
|
|
240
254
|
bundle_data = page.content
|
|
241
255
|
parsed_bundle_data = JSON.parse(bundle_data)
|
|
242
256
|
|
|
@@ -277,7 +291,6 @@ module Cupertino
|
|
|
277
291
|
|
|
278
292
|
def select_team!
|
|
279
293
|
if form = page.form_with(:name => 'saveTeamSelection')
|
|
280
|
-
# self.team now stores team ID, not name
|
|
281
294
|
team_option = form.radiobutton_with(:value => self.team)
|
|
282
295
|
team_option.check
|
|
283
296
|
|
|
@@ -9,17 +9,19 @@ command :'devices:list' do |c|
|
|
|
9
9
|
number_of_devices = devices.compact.length
|
|
10
10
|
number_of_additional_devices = devices.length - number_of_devices
|
|
11
11
|
|
|
12
|
-
title = "Listing #{pluralize(number_of_devices, 'device')}
|
|
13
|
-
title += "You can register #{pluralize(number_of_additional_devices, 'additional device')}
|
|
12
|
+
title = "Listing #{pluralize(number_of_devices, 'device')} "
|
|
13
|
+
title += "(You can register #{pluralize(number_of_additional_devices, 'additional device')})" if number_of_additional_devices > 0
|
|
14
14
|
|
|
15
15
|
table = Terminal::Table.new :title => title do |t|
|
|
16
|
-
t << ["Device Name", "Device Identifier"]
|
|
16
|
+
t << ["Device Name", "Device Identifier", "Enabled"]
|
|
17
17
|
t.add_separator
|
|
18
18
|
devices.compact.each do |device|
|
|
19
|
-
t << [device.name, device.udid]
|
|
19
|
+
t << [device.name, device.udid, device.enabled]
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
table.align_column 2, :center
|
|
24
|
+
|
|
23
25
|
puts table
|
|
24
26
|
end
|
|
25
27
|
end
|
|
@@ -40,11 +42,12 @@ command :'devices:add' do |c|
|
|
|
40
42
|
device = Device.new
|
|
41
43
|
device.name = components.first
|
|
42
44
|
device.udid = components.last
|
|
45
|
+
say_warning "Invalid UDID: #{device.udid}" and next unless /\h{40}/ === device.udid
|
|
43
46
|
devices << device
|
|
44
47
|
end
|
|
45
48
|
|
|
46
49
|
agent.add_devices(*devices)
|
|
47
50
|
|
|
48
|
-
say_ok "Added #{devices.length
|
|
51
|
+
say_ok "Added #{pluralize(devices.length, 'device')}"
|
|
49
52
|
end
|
|
50
53
|
end
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
command :'profiles:list' do |c|
|
|
2
|
-
c.syntax = 'ios profiles:list
|
|
2
|
+
c.syntax = 'ios profiles:list'
|
|
3
3
|
c.summary = 'Lists the Provisioning Profiles'
|
|
4
4
|
c.description = ''
|
|
5
5
|
|
|
6
|
+
c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
|
|
7
|
+
|
|
6
8
|
c.action do |args, options|
|
|
7
|
-
type =
|
|
8
|
-
profiles = try{agent.list_profiles(type
|
|
9
|
+
type = options.type || :development
|
|
10
|
+
profiles = try{agent.list_profiles(type)}
|
|
9
11
|
|
|
10
12
|
say_warning "No #{type} provisioning profiles found." and abort if profiles.empty?
|
|
11
13
|
|
|
@@ -31,17 +33,24 @@ end
|
|
|
31
33
|
alias_command :profiles, :'profiles:list'
|
|
32
34
|
|
|
33
35
|
command :'profiles:download' do |c|
|
|
34
|
-
c.syntax = 'ios profiles:download'
|
|
36
|
+
c.syntax = 'ios profiles:download [PROFILE_NAME]'
|
|
35
37
|
c.summary = 'Downloads the Provisioning Profiles'
|
|
36
38
|
c.description = ''
|
|
37
39
|
|
|
40
|
+
c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
|
|
41
|
+
|
|
38
42
|
c.action do |args, options|
|
|
39
|
-
type =
|
|
40
|
-
profiles = try{agent.list_profiles(type
|
|
41
|
-
profiles = profiles.
|
|
43
|
+
type = options.type || :development
|
|
44
|
+
profiles = try{agent.list_profiles(type)}
|
|
45
|
+
profiles = profiles.select{|profile| profile.status == 'Active'}
|
|
42
46
|
|
|
43
47
|
say_warning "No active #{type} profiles found." and abort if profiles.empty?
|
|
44
|
-
|
|
48
|
+
|
|
49
|
+
name = args.join(" ")
|
|
50
|
+
unless profile = profiles.detect{|p| p.name == name}
|
|
51
|
+
profile = choose "Select a profile to download:", *profiles
|
|
52
|
+
end
|
|
53
|
+
|
|
45
54
|
if filename = agent.download_profile(profile)
|
|
46
55
|
say_ok "Successfully downloaded: '#{filename}'"
|
|
47
56
|
else
|
|
@@ -50,16 +59,43 @@ command :'profiles:download' do |c|
|
|
|
50
59
|
end
|
|
51
60
|
end
|
|
52
61
|
|
|
62
|
+
command :'profiles:download:all' do |c|
|
|
63
|
+
c.syntax = 'ios profiles:download:all'
|
|
64
|
+
c.summary = 'Downloads all the active Provisioning Profiles'
|
|
65
|
+
c.description = ''
|
|
66
|
+
|
|
67
|
+
c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
|
|
68
|
+
|
|
69
|
+
c.action do |args, options|
|
|
70
|
+
type = options.type || :development
|
|
71
|
+
profiles = try{agent.list_profiles(type)}
|
|
72
|
+
profiles = profiles.select{|profile| profile.status == 'Active'}
|
|
73
|
+
|
|
74
|
+
say_warning "No active #{type} profiles found." and abort if profiles.empty?
|
|
75
|
+
profiles.each do |profile|
|
|
76
|
+
if filename = agent.download_profile(profile)
|
|
77
|
+
say_ok "Successfully downloaded: '#{filename}'"
|
|
78
|
+
else
|
|
79
|
+
say_error "Could not download profile: '#{profile.name}'"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
53
85
|
command :'profiles:manage:devices' do |c|
|
|
54
86
|
c.syntax = 'ios profiles:manage:devices'
|
|
55
87
|
c.summary = 'Manage active devices for a development provisioning profile'
|
|
56
88
|
c.description = ''
|
|
57
89
|
|
|
90
|
+
c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
|
|
91
|
+
|
|
58
92
|
c.action do |args, options|
|
|
59
|
-
type =
|
|
60
|
-
profiles = try{agent.list_profiles(type
|
|
93
|
+
type = options.type || :development
|
|
94
|
+
profiles = try{agent.list_profiles(type)}
|
|
61
95
|
|
|
62
|
-
|
|
96
|
+
profiles.delete_if{|profile| profile.status == "Invalid"}
|
|
97
|
+
|
|
98
|
+
say_warning "No valid #{type} provisioning profiles found." and abort if profiles.empty?
|
|
63
99
|
|
|
64
100
|
profile = choose "Select a provisioning profile to manage:", *profiles
|
|
65
101
|
|
|
@@ -99,16 +135,16 @@ command :'profiles:manage:devices:add' do |c|
|
|
|
99
135
|
|
|
100
136
|
say_warning "No provisioning profiles named #{args.first} were found." and abort unless profile
|
|
101
137
|
|
|
102
|
-
devices = []
|
|
103
|
-
args[1..-1].each do |arg|
|
|
104
|
-
components = arg.strip.gsub(/\"/, '').split(/\=/)
|
|
105
|
-
device = Device.new
|
|
106
|
-
device.name = components.first
|
|
107
|
-
device.udid = components.last
|
|
108
|
-
devices << device
|
|
109
|
-
end
|
|
110
|
-
|
|
111
138
|
agent.manage_devices_for_profile(profile) do |on, off|
|
|
139
|
+
names = args[1..-1].collect{|arg| arg.sub /\=.*/, ''}
|
|
140
|
+
devices = []
|
|
141
|
+
|
|
142
|
+
names.each do |name|
|
|
143
|
+
device = (on + off).detect{|d| d.name === name}
|
|
144
|
+
say_warning "No device named #{name} was found." and abort unless device
|
|
145
|
+
devices << Device.new(name, device.udid)
|
|
146
|
+
end
|
|
147
|
+
|
|
112
148
|
on + devices
|
|
113
149
|
end
|
|
114
150
|
|
|
@@ -129,17 +165,10 @@ command :'profiles:manage:devices:remove' do |c|
|
|
|
129
165
|
|
|
130
166
|
say_warning "No provisioning profiles named #{args.first} were found." and abort unless profile
|
|
131
167
|
|
|
132
|
-
|
|
133
|
-
args[1..-1].each do |arg|
|
|
134
|
-
components = arg.strip.gsub(/\"/, '').split(/\=/)
|
|
135
|
-
device = Device.new
|
|
136
|
-
device.name = components.first
|
|
137
|
-
device.udid = components.last
|
|
138
|
-
devices << device
|
|
139
|
-
end
|
|
168
|
+
names = args[1..-1].collect{|arg| arg.gsub /\=.*/, ''}
|
|
140
169
|
|
|
141
170
|
agent.manage_devices_for_profile(profile) do |on, off|
|
|
142
|
-
on.delete_if
|
|
171
|
+
on.delete_if{|active| names.include?(active.name)}
|
|
143
172
|
end
|
|
144
173
|
|
|
145
174
|
say_ok "Successfully removed devices from #{args.first}."
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
include Cupertino::ProvisioningPortal
|
|
2
2
|
include Cupertino::ProvisioningPortal::Helpers
|
|
3
3
|
|
|
4
|
+
global_option('-u', '--username USER', 'Username') { |arg| agent.username = arg unless arg.nil? }
|
|
5
|
+
global_option('-p', '--password PASSWORD', 'Password') { |arg| agent.password = arg unless arg.nil? }
|
|
6
|
+
global_option('-tm', '--team TEAM', 'Team') { |arg| agent.team = arg unless arg.nil? }
|
|
7
|
+
|
|
4
8
|
require 'cupertino/provisioning_portal/commands/certificates'
|
|
5
9
|
require 'cupertino/provisioning_portal/commands/devices'
|
|
6
10
|
require 'cupertino/provisioning_portal/commands/profiles'
|
|
@@ -24,14 +24,14 @@ module Cupertino
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def team
|
|
27
|
-
|
|
27
|
+
teams = []
|
|
28
28
|
page.form_with(:name => 'saveTeamSelection').radiobuttons.each do |radio|
|
|
29
29
|
name = page.search("label[for=\"#{radio.dom_id}\"]").first.text.strip
|
|
30
|
-
|
|
30
|
+
teams << [name, radio.value]
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
name = choose "Select a team:", *
|
|
34
|
-
@team ||=
|
|
33
|
+
name = choose "Select a team:", *teams.collect(&:first)
|
|
34
|
+
@team ||= teams.detect{|e| e.first == name}.last
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -8,9 +8,9 @@ module Cupertino
|
|
|
8
8
|
class UnsuccessfulAuthenticationError < RuntimeError; end
|
|
9
9
|
class UnexpectedContentError < RuntimeError; end
|
|
10
10
|
|
|
11
|
-
class Device < Struct.new(:name, :udid)
|
|
11
|
+
class Device < Struct.new(:name, :udid, :enabled)
|
|
12
12
|
def to_s
|
|
13
|
-
"#{self.name} #{self.udid}"
|
|
13
|
+
"#{self.name} #{self.udid} #{self.enabled}"
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
data/lib/cupertino.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cupertino
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mattt Thompson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: commander
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - ~>
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 2.5.1
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: nokogiri
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ~>
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 1.5.9
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ~>
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 1.5.9
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: security
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -84,56 +98,56 @@ dependencies:
|
|
|
84
98
|
name: shenzhen
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
86
100
|
requirements:
|
|
87
|
-
- -
|
|
101
|
+
- - '>='
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
103
|
version: 0.0.1
|
|
90
104
|
type: :runtime
|
|
91
105
|
prerelease: false
|
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
107
|
requirements:
|
|
94
|
-
- -
|
|
108
|
+
- - '>='
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
110
|
version: 0.0.1
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: certified
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
|
-
- -
|
|
115
|
+
- - '>='
|
|
102
116
|
- !ruby/object:Gem::Version
|
|
103
117
|
version: 0.1.0
|
|
104
118
|
type: :runtime
|
|
105
119
|
prerelease: false
|
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
121
|
requirements:
|
|
108
|
-
- -
|
|
122
|
+
- - '>='
|
|
109
123
|
- !ruby/object:Gem::Version
|
|
110
124
|
version: 0.1.0
|
|
111
125
|
- !ruby/object:Gem::Dependency
|
|
112
126
|
name: rspec
|
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
|
114
128
|
requirements:
|
|
115
|
-
- -
|
|
129
|
+
- - '>='
|
|
116
130
|
- !ruby/object:Gem::Version
|
|
117
131
|
version: '0'
|
|
118
132
|
type: :development
|
|
119
133
|
prerelease: false
|
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
135
|
requirements:
|
|
122
|
-
- -
|
|
136
|
+
- - '>='
|
|
123
137
|
- !ruby/object:Gem::Version
|
|
124
138
|
version: '0'
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
140
|
name: rake
|
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
|
128
142
|
requirements:
|
|
129
|
-
- -
|
|
143
|
+
- - '>='
|
|
130
144
|
- !ruby/object:Gem::Version
|
|
131
145
|
version: '0'
|
|
132
146
|
type: :development
|
|
133
147
|
prerelease: false
|
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
149
|
requirements:
|
|
136
|
-
- -
|
|
150
|
+
- - '>='
|
|
137
151
|
- !ruby/object:Gem::Version
|
|
138
152
|
version: '0'
|
|
139
153
|
description: A command-line interface for the iOS Provisioning Portal
|
|
@@ -171,12 +185,12 @@ require_paths:
|
|
|
171
185
|
- lib
|
|
172
186
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
187
|
requirements:
|
|
174
|
-
- -
|
|
188
|
+
- - '>='
|
|
175
189
|
- !ruby/object:Gem::Version
|
|
176
190
|
version: '0'
|
|
177
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
192
|
requirements:
|
|
179
|
-
- -
|
|
193
|
+
- - '>='
|
|
180
194
|
- !ruby/object:Gem::Version
|
|
181
195
|
version: '0'
|
|
182
196
|
requirements: []
|