From 7ebee52614cff6f8adf0e898d8691ae0093454f6 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 12 Dec 2023 10:12:01 -0800 Subject: [PATCH] Remove monkey-patched Hash#except --- Library/Homebrew/global.rb | 1 - .../active_support/core_ext/hash/except.rb | 24 ------------------- 2 files changed, 25 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/except.rb diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index ea6f1ebec4..084d74abee 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -16,7 +16,6 @@ require "active_support/core_ext/array/access" require "active_support/core_ext/enumerable" require "active_support/core_ext/file/atomic" require "active_support/core_ext/hash/deep_merge" -require "active_support/core_ext/hash/except" require "active_support/core_ext/hash/keys" require "active_support/core_ext/string/exclude" require "active_support/core_ext/string/filters" diff --git a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/except.rb b/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/except.rb deleted file mode 100644 index ec96929b0a..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/except.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class Hash - # Returns a hash that includes everything except given keys. - # hash = { a: true, b: false, c: nil } - # hash.except(:c) # => { a: true, b: false } - # hash.except(:a, :b) # => { c: nil } - # hash # => { a: true, b: false, c: nil } - # - # This is useful for limiting a set of parameters to everything but a few known toggles: - # @person.update(params[:person].except(:admin)) - def except(*keys) - slice(*self.keys - keys) - end unless method_defined?(:except) - - # Removes the given keys from hash and returns it. - # hash = { a: true, b: false, c: nil } - # hash.except!(:c) # => { a: true, b: false } - # hash # => { a: true, b: false } - def except!(*keys) - keys.each { |key| delete(key) } - self - end -end