From cf5fdeef1d8e9fd053121145882835b87eec2a43 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 24 Sep 2017 20:12:58 +0100 Subject: Rubocop: manual rule fixes. --- Library/Homebrew/utils/github.rb | 12 +++--------- Library/Homebrew/utils/shell.rb | 4 ---- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'Library/Homebrew/utils') 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) diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 5327f6ecf..8c1c5f984 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -51,8 +51,6 @@ module Utils end end - private - SHELL_PROFILE_MAP = { bash: "~/.bash_profile", csh: "~/.cshrc", @@ -65,8 +63,6 @@ module Utils UNSAFE_SHELL_CHAR = %r{([^A-Za-z0-9_\-.,:/@\n])} - module_function - def csh_quote(str) # ruby's implementation of shell_escape str = str.to_s -- cgit v1.2.3