spaceship 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6a3c818e30dc1104176737eb6b122347a533a4d
4
- data.tar.gz: 0cdad36a2f668ea79dff96eb82c40d9a2a8e31f8
3
+ metadata.gz: 86c6e8217bad88bfdb0c32ab0e02fd732a95ca36
4
+ data.tar.gz: 606504429db1051598fd6e7b0bcfeab99c477ab2
5
5
  SHA512:
6
- metadata.gz: bc714965c65ca0e17be95cd9a9825cedef4c3708100b05862db1ff60be617426efdc0d4e9943566c90c5a6913ccc5e8ed692105463eb0df814f646418f4f9b3c
7
- data.tar.gz: 7c30613baa1293ccba3a33e744c952e2e05b24eb05d3cb42ab8937cd68a006e5711e7b3e9c7e61b4677809cd1467f8f140a6f47ca9186214ae64f8f31641b156
6
+ metadata.gz: d3f690107bdde045e9db60a376260adfe6b78e11a06483ca08022971e3aa523d1cb7f1399683f4cd6f60164bce86a8c3edf95ef7e391709c96c9df6d8e84769a
7
+ data.tar.gz: b59835d27eeb8024631863ac30891bbf60a451e4a419573ffb74224249cb8cb22ac373d878b71e7f3cc39170326b7a5da41fb1c99d19a7752b5158b10fd7c056
@@ -366,7 +366,7 @@ module Spaceship
366
366
 
367
367
  return @client.send(method, url_or_path, params, headers, &block)
368
368
 
369
- rescue Faraday::TimeoutError => ex
369
+ rescue Faraday::Error::TimeoutError => ex # New Farday version: Faraday::TimeoutError => ex
370
370
  unless (tries -= 1).zero?
371
371
  sleep 3
372
372
  retry
@@ -36,14 +36,24 @@ module Spaceship
36
36
 
37
37
  raise "Your account is in no teams" if teams.count == 0
38
38
 
39
- user_team = (ENV['FASTLANE_TEAM_ID'] || '').strip
40
- if user_team
39
+ team_id = (ENV['FASTLANE_TEAM_ID'] || '').strip
40
+ team_name = (ENV['FASTLANE_TEAM_NAME'] || '').strip
41
+
42
+ if team_id.length > 0
43
+ # User provided a value, let's see if it's valid
44
+ teams.each_with_index do |team, i|
45
+ return team_id if (team['teamId'].strip == team_id)
46
+ return team_id if (team['currentTeamMember']['teamMemberId'].to_s.strip == team_id)
47
+ end
48
+ puts "Couldn't find team with ID '#{team_id}'"
49
+ end
50
+
51
+ if team_name.length > 0
41
52
  # User provided a value, let's see if it's valid
42
- puts "Looking for team with ID '#{user_team}'"
43
53
  teams.each_with_index do |team, i|
44
- return user_team if (team['teamId'].strip == user_team)
54
+ return team['teamId'] if (team['name'].strip == team_name)
45
55
  end
46
- puts "Couldn't find team with ID '#{user_team}'"
56
+ puts "Couldn't find team with Name '#{team_name}'"
47
57
  end
48
58
 
49
59
 
@@ -58,7 +68,7 @@ module Spaceship
58
68
  puts "#{i + 1}) #{team['teamId']} #{team['name']} (#{team['type']})"
59
69
  end
60
70
 
61
- selected = $stdin.gets.strip.to_i - 1
71
+ selected = ($stdin.gets || '').strip.to_i - 1
62
72
  team_to_use = teams[selected] if selected >= 0
63
73
 
64
74
  return team_to_use['teamId'] if team_to_use
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-27 00:00:00.000000000 Z
12
+ date: 2015-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager