From a408da65fc083284cba9b974198f00b9e937b5d9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 17 May 2024 14:42:44 +0900 Subject: [PATCH] Hide default gems warnings for Ruby 3.4. These omit warnings with Ruby 3.3 and are required for Ruby 3.4. We'll fix them when we're upgrading to 3.4 instead. --- Library/Homebrew/api.rb | 5 ++++- Library/Homebrew/dev-cmd/contributions.rb | 5 ++++- Library/Homebrew/warnings.rb | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index abb6ec6020..6c2adac076 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -4,7 +4,10 @@ require "api/analytics" require "api/cask" require "api/formula" -require "base64" # TODO: Add this to the Gemfile or remove it before moving to Ruby 3.4. +require "warnings" +Warnings.ignore :default_gems do + require "base64" # TODO: Add this to the Gemfile or remove it before moving to Ruby 3.4. +end require "extend/cachable" module Homebrew diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index efb00fcd34..436afd0e7c 100644 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -2,7 +2,10 @@ # frozen_string_literal: true require "abstract_command" -require "csv" +require "warnings" +Warnings.ignore :default_gems do + require "csv" +end module Homebrew module DevCmd diff --git a/Library/Homebrew/warnings.rb b/Library/Homebrew/warnings.rb index 83c124234a..568808b205 100644 --- a/Library/Homebrew/warnings.rb +++ b/Library/Homebrew/warnings.rb @@ -14,6 +14,9 @@ module Warnings %r{warning: please see https://github\.com/whitequark/parser#compatibility-with-ruby-mri\.}, # ], + default_gems: [ + /warning: .+\.rb was loaded from the standard library, .+ default gems since Ruby \d+\.\d+\.\d+\./, + ], }.freeze def self.ignore(*warnings)