fastlane_core 0.1.2 → 0.1.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: a8c47b8dc6b0651e0dfbe76c726b239d6254501d
4
- data.tar.gz: c4ed45e02c0b5c9e3f02e37b667f7d422efd6ae8
3
+ metadata.gz: 1e70b23f927fc06ec9e671423ee16022620d41dc
4
+ data.tar.gz: 278ace3ed4c4b07312e51c33e7fbe610fa2e6e78
5
5
  SHA512:
6
- metadata.gz: c568d33b18702e1744a5abee4457cc1110a482279e69af0df3abec4092fa8aa057889069fb347ad7275d92be15e6059ad4c1a81eb62e52aa7dfd5da5fc2df3b9
7
- data.tar.gz: 56e94aac0675979704d10b50c411c7a05e637dad2ac4053874ce3fd313b81b66dd4491ae1f87a2f63eda7dffe4e2113c96911c598d9656e9e60a2471a0bfeecf
6
+ metadata.gz: 8249f72041e8619df7722469f35dc77be53e1be3b7bfc2ae3d2ed09f7482bda04cb2698ac7e44be3f36593d24770e680d8d7fcc4fc8ba131fe37a33e1b561ea6
7
+ data.tar.gz: ab1c333dfca558603e945987bdbeb93866d5e6d7448361dc448d17f6749a6dac84b310644670c140743a20c5ad186f3cae443fbf89b763141619653be140b0a6
@@ -118,11 +118,13 @@ module FastlaneCore
118
118
 
119
119
 
120
120
  def select_team
121
- team_id = ENV["FASTLANE_TEAM_ID"]
122
- team_id = nil if team_id.to_s.length == 0
121
+ team_id = ENV["FASTLANE_TEAM_ID"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
123
122
 
124
- unless team_id
125
- Helper.log.info "You can store you preferred team using the environment variable `FASTLANE_TEAM_ID`".green
123
+ team_name = ENV["FASTLANE_TEAM_NAME"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_name)
124
+
125
+ if team_id == nil and team_name == nil
126
+ Helper.log.info "You can store you preferred team using the environment variable `FASTLANE_TEAM_ID` or `FASTLANE_TEAM_NAME`".green
127
+ Helper.log.info "or in your `Appfile` using `team_id 'Q2CBPJ58CA'` or `team_name 'Felix Krause'`".green # TODO
126
128
  Helper.log.info "Your ID belongs to the following teams:".green
127
129
  end
128
130
 
@@ -139,19 +141,36 @@ module FastlaneCore
139
141
  available_options << [index_text, current_team_id, team_text, description_text].join(" ")
140
142
  end
141
143
 
142
- unless team_id
143
- puts available_options.join("\n").green
144
- team_index = ask("Please select the team number you would like to access: ".green)
145
- team_id = teams[team_index.to_i - 1].find(".radio").value
146
- end
144
+ if team_name
145
+ # Search for name
146
+ found_it = false
147
+ all("label.label-primary").each do |current|
148
+ if current.text.downcase.gsub(/\s+/, "") == team_name.downcase.gsub(/\s+/, "")
149
+ current.click # select the team by name
150
+ found_it = true
151
+ end
152
+ end
147
153
 
148
- team_button = first(:xpath, "//input[@type='radio' and @value='#{team_id}']") # Select the desired team
149
- if team_button
150
- team_button.click
154
+ unless found_it
155
+ available_teams = all("label.label-primary").collect { |a| a.text }
156
+ raise DeveloperCenterLoginError.new("Could not find Team with name '#{team_name}'. Available Teams: #{available_teams}".red)
157
+ end
151
158
  else
152
- Helper.log.fatal "Could not find given Team. Available options: ".red
153
- puts available_options.join("\n").yellow
154
- raise DeveloperCenterLoginError.new("Error finding given team #{team_id}.".red)
159
+ # Search by ID/Index
160
+ unless team_id
161
+ puts available_options.join("\n").green
162
+ team_index = ask("Please select the team number you would like to access: ".green)
163
+ team_id = teams[team_index.to_i - 1].find(".radio").value
164
+ end
165
+
166
+ team_button = first(:xpath, "//input[@type='radio' and @value='#{team_id}']") # Select the desired team
167
+ if team_button
168
+ team_button.click
169
+ else
170
+ Helper.log.fatal "Could not find given Team. Available options: ".red
171
+ puts available_options.join("\n").yellow
172
+ raise DeveloperCenterLoginError.new("Error finding given team #{team_id}.".red)
173
+ end
155
174
  end
156
175
 
157
176
  all(".button.large.blue.submit").first.click
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json