diff options
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/fork.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/utils/github.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/utils/link.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils/ruby.sh | 2 |
4 files changed, 13 insertions, 10 deletions
diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index 2f2a403e2..57ddbfae2 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -14,7 +14,7 @@ module Utils read.close write.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) yield - rescue Exception => e + rescue Exception => e # rubocop:disable Lint/RescueException Marshal.dump(e, write) write.close exit! @@ -26,8 +26,11 @@ module Utils ignore_interrupts(:quietly) do # the child will receive the interrupt and marshal it back begin socket = server.accept_nonblock + # rubocop:disable Lint/ShadowedException + # FIXME: https://github.com/bbatsov/rubocop/issues/4843 rescue Errno::EAGAIN, Errno::EWOULDBLOCK, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR retry unless Process.waitpid(pid, Process::WNOHANG) + # rubocop:enable Lint/ShadowedException else socket.send_io(write) socket.close @@ -36,7 +39,7 @@ module Utils data = read.read read.close Process.wait(pid) unless socket.nil? - raise Marshal.load(data) unless data.nil? || data.empty? + raise Marshal.load(data) unless data.nil? || data.empty? # rubocop:disable Security/MarshalLoad raise Interrupt if $CHILD_STATUS.exitstatus == 130 raise "Forked child process failed: #{$CHILD_STATUS}" unless $CHILD_STATUS.success? end diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index df0811e95..e73951c8d 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -16,7 +16,7 @@ module GitHub class RateLimitExceededError < Error def initialize(reset, error) - super <<-EOS.undent + super <<~EOS GitHub API Error: #{error} Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token: #{ALL_SCOPES_URL} @@ -33,12 +33,12 @@ module GitHub def initialize(error) message = "GitHub #{error}\n" if ENV["HOMEBREW_GITHUB_API_TOKEN"] - message << <<-EOS.undent + message << <<~EOS HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check: #{Formatter.url("https://github.com/settings/tokens")} EOS else - message << <<-EOS.undent + message << <<~EOS The GitHub credentials in the macOS keychain may be invalid. Clear them with: printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase @@ -104,7 +104,7 @@ module GitHub case GitHub.api_credentials_type when :keychain - onoe <<-EOS.undent + onoe <<~EOS Your macOS keychain GitHub credentials do not have sufficient scope! Scopes they need: #{needed_human_scopes} Scopes they have: #{credentials_scopes} @@ -112,7 +112,7 @@ module GitHub and then set HOMEBREW_GITHUB_API_TOKEN as the authentication method instead. EOS when :environment - onoe <<-EOS.undent + onoe <<~EOS Your HOMEBREW_GITHUB_API_TOKEN does not have sufficient scope! Scopes they need: #{needed_human_scopes} Scopes it has: #{credentials_scopes} @@ -235,7 +235,7 @@ module GitHub def issues_for_formula(name, options = {}) tap = options[:tap] || CoreTap.instance - search_issues(name, state: "open", repo: "#{tap.user}/homebrew-#{tap.repo}") + search_issues(name, state: "open", repo: "#{tap.user}/homebrew-#{tap.repo}", in: "title") end def print_pull_requests_matching(query) diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index 095dba209..96bfd602e 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -22,7 +22,7 @@ module Utils end return if conflicts.empty? - onoe <<-EOS.undent + onoe <<~EOS Could not link: #{conflicts.join("\n")} diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index 9a3ab2e81..b16531e9f 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -40,7 +40,7 @@ setup-ruby-path() { ruby_old_version="$("$HOMEBREW_RUBY_PATH" -rrubygems -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")" fi - if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] + if [[ -z "$HOMEBREW_RUBY_PATH" || "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] then brew vendor-install ruby if [[ ! -x "$vendor_ruby_path" ]] |
