diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index cca88cf182a59..be9bbff1420d0 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -164,7 +164,7 @@ GEM unf_ext unf_ext (0.0.7.7) unicode-display_width (2.0.0) - warning (1.1.0) + warning (1.2.0) webrick (1.7.0) webrobots (0.1.2) zeitwerk (2.4.2) diff --git a/Library/Homebrew/sorbet/rbi/gems/warning@1.1.0.rbi b/Library/Homebrew/sorbet/rbi/gems/warning@1.2.0.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/warning@1.1.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/warning@1.2.0.rbi diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 9f966079b34cb..4aa17dab9141b 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -91,4 +91,4 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thor-1.1.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/spoom-1.0.9/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tapioca-0.4.14/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/warning-1.1.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/warning-1.2.0/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.1.0/lib/warning.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.2.0/lib/warning.rb similarity index 83% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.1.0/lib/warning.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.2.0/lib/warning.rb index 52177b3c5de94..7fac4f5fcfacd 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.1.0/lib/warning.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.2.0/lib/warning.rb @@ -4,7 +4,7 @@ module Warning module Processor # Map of symbols to regexps for warning messages to ignore. IGNORE_MAP = { - ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after `\/' operator\n\z/, + ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after `\/' operator\n\z|: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `\/' operator\n\z/, arg_prefix: /: warning: `[&\*]' interpreted as argument prefix\n\z/, bignum: /: warning: constant ::Bignum is deprecated\n\z/, fixnum: /: warning: constant ::Fixnum is deprecated\n\z/, @@ -17,8 +17,9 @@ module Processor useless_operator: /: warning: possibly useless use of [> when the # result is not used. + # :void_context :: Ignore warnings for :: to reference constants when the result is not + # used (often used to trigger autoload). # # Examples: # @@ -126,7 +129,7 @@ def ignore(regexp, path='') # Instead of passing a block, you can pass a hash of actions to take for specific # warnings, using regexp as keys and a callable objects as values: # - # Warning.ignore(__FILE__, + # Warning.process(__FILE__, # /instance variable @\w+ not initialized/ => proc do |warning| # LOGGER.warning(warning) # end, @@ -166,57 +169,63 @@ def process(path='', actions=nil, &block) nil end - # Handle ignored warnings and warning processors. If the warning is - # not ignored, is not a duplicate warning (if checking for duplicates) - # and there is no warning processor setup for the warning - # string, then use the default behavior of writing to $stderr. - def warn(str) - synchronize{@ignore.dup}.each do |path, regexp| - if str.start_with?(path) && str =~ regexp - return - end - end - if @dedup - if synchronize{@dedup[str]} - return + if RUBY_VERSION >= '3.0' + method_args = ', category: nil' + super_ = "category ? super : super(str)" + else + super_ = "super" + end + + class_eval(<<-END, __FILE__, __LINE__+1) + def warn(str#{method_args}) + synchronize{@ignore.dup}.each do |path, regexp| + if str.start_with?(path) && str =~ regexp + return + end end - synchronize{@dedup[str] = true} - end + if @dedup + if synchronize{@dedup[str]} + return + end + + synchronize{@dedup[str] = true} + end - action = catch(:action) do - synchronize{@process.dup}.each do |path, block| - if str.start_with?(path) - if block.is_a?(Hash) - block.each do |regexp, blk| - if str =~ regexp - throw :action, blk.call(str) + action = catch(:action) do + synchronize{@process.dup}.each do |path, block| + if str.start_with?(path) + if block.is_a?(Hash) + block.each do |regexp, blk| + if str =~ regexp + throw :action, blk.call(str) + end end + else + throw :action, block.call(str) end - else - throw :action, block.call(str) end end + + :default end - :default - end + case action + when :default + #{super_} + when :backtrace + #{super_} + $stderr.puts caller + when :raise + raise str + else + # nothing + end - case action - when :default - super - when :backtrace - super - $stderr.puts caller - when :raise - raise str - else - # nothing + nil end - - nil - end + END private