aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/github.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-09-25 21:29:03 +0100
committerGitHub2017-09-25 21:29:03 +0100
commita5893036166b9708d705a5060aa85002d5a6be16 (patch)
tree03a254a34d12926540a0be677ffc8c9b9f32d5d0 /Library/Homebrew/utils/github.rb
parentac8b58537fe3dd71098a43afcc6a1785dcde1d39 (diff)
parentcf5fdeef1d8e9fd053121145882835b87eec2a43 (diff)
downloadbrew-a5893036166b9708d705a5060aa85002d5a6be16.tar.bz2
Merge pull request #3183 from MikeMcQuaid/rubocop-upgrade
Rubocop: 0.50.0 and Ruby 2.3
Diffstat (limited to 'Library/Homebrew/utils/github.rb')
-rw-r--r--Library/Homebrew/utils/github.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb
index a50d6d8e5..df0811e95 100644
--- a/Library/Homebrew/utils/github.rb
+++ b/Library/Homebrew/utils/github.rb
@@ -86,15 +86,9 @@ module GitHub
def api_credentials_type
token, username = api_credentials
- if token && !token.empty?
- if username && !username.empty?
- :keychain
- else
- :environment
- end
- else
- :none
- end
+ return :none if !token || token.empty?
+ return :keychain if !username || username.empty?
+ :environment
end
def api_credentials_error_message(response_headers, needed_scopes)