cupertino 0.9.0 → 0.9.1

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: f2fe21bc508207cbfaf9d5a89cec2ff1b4371126
4
- data.tar.gz: 87a5b6c64e5e0282986bcc0da0b47aa04dcf6d4c
3
+ metadata.gz: e6fad9af88f84e96ecd1b050a0d5a69cc99849e2
4
+ data.tar.gz: a5b03a00078657f3a24e2c283cfb1b01e09861bc
5
5
  SHA512:
6
- metadata.gz: e1cd6cc09b28b4aeee344a2727f53fc51edab09162811708614f66f64263277edca0fc958c23ef366c0a7d946e162ad70490cc377eca534d05691f16ce210193
7
- data.tar.gz: f9a84ebc0faf92930ec89ab5e08f7c8659140d1193c5d7528d0b7d2b297f146bb3dec5890f9fd2b92909fa5c83ca76fdeee5025660a607e0e3a4527c12795143
6
+ metadata.gz: 9c89c3ce10f363e396991c989b03b66b75a9555312de4d50607e758a9d619da510271e47e4c7df0b4267e9e609b81e6419cf049362db80aa5e93a6526b9e0344
7
+ data.tar.gz: e6f144b4f64217dbec2b0f8e7541069a28c32b6a9d5463a502ca759a8beb112a24b14c965549a432103da117230ac157a1cf4d70d6625943062b02a9708505fd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cupertino (0.9.0)
4
+ cupertino (0.9.1)
5
5
  certified (>= 0.1.0)
6
6
  commander (~> 4.1.2)
7
7
  mechanize (~> 2.5.1)
@@ -25,7 +25,7 @@ GEM
25
25
  faraday_middleware (0.9.0)
26
26
  faraday (>= 0.7.4, < 0.9)
27
27
  highline (1.6.19)
28
- json (1.8.0)
28
+ json (1.8.1)
29
29
  mechanize (2.5.1)
30
30
  domain_name (~> 0.5, >= 0.5.1)
31
31
  mime-types (~> 1.17, >= 1.17.2)
data/README.md CHANGED
@@ -100,7 +100,7 @@ _Removes (without an editor) a list of devices from a provisioning profile_
100
100
  - `profiles:manage:devices:remove`
101
101
  - `profiles:download`
102
102
  - `profiles:download:all`
103
- - `certificates:list [development|distribution]`
103
+ - `certificates:list`
104
104
  - `certificates:download`
105
105
  - `app_ids:list`
106
106
 
data/cupertino.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
- require "cupertino"
4
+ require "cupertino/version"
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cupertino"
@@ -2,6 +2,7 @@ require 'mechanize'
2
2
  require 'security'
3
3
  require 'uri'
4
4
  require 'json'
5
+ require 'logger'
5
6
 
6
7
  module Cupertino
7
8
  module ProvisioningPortal
@@ -12,6 +13,9 @@ module Cupertino
12
13
  super
13
14
 
14
15
  self.user_agent_alias = 'Mac Safari'
16
+
17
+ self.log ||= Logger.new(STDOUT)
18
+ self.log.level = Logger::ERROR
15
19
 
16
20
  if ENV['HTTP_PROXY']
17
21
  uri = URI.parse(ENV['HTTP_PROXY'])
@@ -291,7 +295,7 @@ module Cupertino
291
295
 
292
296
  def select_team!
293
297
  if form = page.form_with(:name => 'saveTeamSelection')
294
- team_option = form.radiobutton_with(:value => self.team)
298
+ team_option = form.radiobutton_with(:value => self.team_id)
295
299
  team_option.check
296
300
 
297
301
  button = form.button_with(:name => 'action:saveTeamSelection!save')
@@ -3,11 +3,11 @@ command :'profiles:list' do |c|
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"
6
+ c.option '--type [TYPE]', [:development, :distribution], "Type of profile (defaults to :development)"
7
7
 
8
8
  c.action do |args, options|
9
- type = options.type || :development
10
- profiles = try{agent.list_profiles(type)}
9
+ type = options.type.downcase.to_sym if options.type
10
+ profiles = try{agent.list_profiles(type || :development)}
11
11
 
12
12
  say_warning "No #{type} provisioning profiles found." and abort if profiles.empty?
13
13
 
@@ -37,11 +37,11 @@ command :'profiles:download' do |c|
37
37
  c.summary = 'Downloads the Provisioning Profiles'
38
38
  c.description = ''
39
39
 
40
- c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
40
+ c.option '--type [TYPE]', [:development, :distribution], "Type of profile (defaults to :development)"
41
41
 
42
42
  c.action do |args, options|
43
- type = options.type || :development
44
- profiles = try{agent.list_profiles(type)}
43
+ type = options.type.downcase.to_sym if options.type
44
+ profiles = try{agent.list_profiles(type || :development)}
45
45
  profiles = profiles.select{|profile| profile.status == 'Active'}
46
46
 
47
47
  say_warning "No active #{type} profiles found." and abort if profiles.empty?
@@ -64,11 +64,11 @@ command :'profiles:download:all' do |c|
64
64
  c.summary = 'Downloads all the active Provisioning Profiles'
65
65
  c.description = ''
66
66
 
67
- c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
67
+ c.option '--type [TYPE]', [:development, :distribution], "Type of profile (defaults to :development)"
68
68
 
69
69
  c.action do |args, options|
70
- type = options.type || :development
71
- profiles = try{agent.list_profiles(type)}
70
+ type = options.type.downcase.to_sym if options.type
71
+ profiles = try{agent.list_profiles(type || :development)}
72
72
  profiles = profiles.select{|profile| profile.status == 'Active'}
73
73
 
74
74
  say_warning "No active #{type} profiles found." and abort if profiles.empty?
@@ -87,11 +87,11 @@ command :'profiles:manage:devices' do |c|
87
87
  c.summary = 'Manage active devices for a development provisioning profile'
88
88
  c.description = ''
89
89
 
90
- c.option '-t', '--type [TYPE]', [:development, :distribution], "Type of profile"
90
+ c.option '--type [TYPE]', [:development, :distribution], "Type of profile (defaults to :development)"
91
91
 
92
92
  c.action do |args, options|
93
- type = options.type || :development
94
- profiles = try{agent.list_profiles(type)}
93
+ type = options.type.downcase.to_sym if options.type
94
+ profiles = try{agent.list_profiles(type || :development)}
95
95
 
96
96
  profiles.delete_if{|profile| profile.status == "Invalid"}
97
97
 
@@ -3,7 +3,9 @@ include Cupertino::ProvisioningPortal::Helpers
3
3
 
4
4
  global_option('-u', '--username USER', 'Username') { |arg| agent.username = arg unless arg.nil? }
5
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? }
6
+ global_option('--team TEAM', 'Team') { |arg| agent.team = arg unless arg.nil? }
7
+ global_option('--info', 'Set log level to INFO') { agent.log.level = Logger::INFO }
8
+ global_option('--debug', 'Set log level to DEBUG') { agent.log.level = Logger::DEBUG }
7
9
 
8
10
  require 'cupertino/provisioning_portal/commands/certificates'
9
11
  require 'cupertino/provisioning_portal/commands/devices'
@@ -23,15 +23,30 @@ module Cupertino
23
23
  @password ||= pw "Password:"
24
24
  end
25
25
 
26
- def team
26
+ def team_id
27
27
  teams = []
28
+
28
29
  page.form_with(:name => 'saveTeamSelection').radiobuttons.each do |radio|
29
- name = page.search("label[for=\"#{radio.dom_id}\"]").first.text.strip
30
+ primary = page.search(".label-primary[for=\"#{radio.dom_id}\"]").first.text.strip
31
+ secondary = page.search(".label-secondary[for=\"#{radio.dom_id}\"]").first.text.strip
32
+ team_id = radio.value
33
+ name = "#{primary}, #{secondary} (#{team_id})"
30
34
  teams << [name, radio.value]
31
35
  end
32
36
 
33
- name = choose "Select a team:", *teams.collect(&:first)
34
- @team ||= teams.detect{|e| e.first == name}.last
37
+ team_names = teams.collect(&:first)
38
+ team_ids = teams.collect(&:last)
39
+
40
+ if @team.nil?
41
+ selected_team_name = choose "Select a team:", *team_names
42
+ teams.detect { |t| t.first == selected_team_name }.last
43
+ elsif team_ids.member? @team
44
+ @team
45
+ elsif team = teams.detect { |t| t.first.start_with?(@team) }
46
+ team.last
47
+ else
48
+ say_error "Team should be a name or identifier" and abort
49
+ end
35
50
  end
36
51
  end
37
52
  end
@@ -0,0 +1,3 @@
1
+ module Cupertino
2
+ VERSION = '0.9.1'
3
+ end
data/lib/cupertino.rb CHANGED
@@ -1,3 +1 @@
1
- module Cupertino
2
- VERSION = '0.9.0'
3
- end
1
+ require 'cupertino/version'
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.9.0
4
+ version: 0.9.1
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-10-04 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -170,6 +170,7 @@ files:
170
170
  - ./lib/cupertino/provisioning_portal/commands.rb
171
171
  - ./lib/cupertino/provisioning_portal/helpers.rb
172
172
  - ./lib/cupertino/provisioning_portal.rb
173
+ - ./lib/cupertino/version.rb
173
174
  - ./lib/cupertino.rb
174
175
  - ./LICENSE
175
176
  - ./Rakefile