From 3dfce75cc375413de672a2ad641631355869c7e2 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 12 Jan 2024 15:17:12 -0800 Subject: [PATCH] cleanup --- .gitignore | 6 +----- Library/Homebrew/extend/object/deep_dup.rb | 8 ++++++-- Library/Homebrew/global.rb | 9 +++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2172e87ce92e9d..58bd229b006504 100644 --- a/.gitignore +++ b/.gitignore @@ -53,11 +53,6 @@ !**/vendor/bundle/ruby/*/gems/*/lib !**/vendor/bundle/ruby/*/gems/addressable-*/data !**/vendor/bundle/ruby/*/gems/public_suffix-*/data -!**/vendor/bundle/ruby/*/gems/rubocop-performance-*/config -!**/vendor/bundle/ruby/*/gems/rubocop-rails-*/config -!**/vendor/bundle/ruby/*/gems/rubocop-rspec-*/config -!**/vendor/bundle/ruby/*/gems/rubocop-sorbet-*/config -!**/vendor/bundle/ruby/*/gems/sorbet-runtime-*/ # Ignore partially included gems where we don't need all files **/vendor/gems/mechanize-*/.* @@ -138,6 +133,7 @@ **/vendor/bundle/ruby/*/gems/simplecov_json_formatter-*/ **/vendor/bundle/ruby/*/gems/simpleidn-*/ **/vendor/bundle/ruby/*/gems/sorbet-*/ +!**/vendor/bundle/ruby/*/gems/sorbet-runtime-*/ **/vendor/bundle/ruby/*/gems/spoom-*/ **/vendor/bundle/ruby/*/gems/stackprof-*/ **/vendor/bundle/ruby/*/gems/strscan-*/ diff --git a/Library/Homebrew/extend/object/deep_dup.rb b/Library/Homebrew/extend/object/deep_dup.rb index b64eccc5f70263..24262d1a5a1553 100644 --- a/Library/Homebrew/extend/object/deep_dup.rb +++ b/Library/Homebrew/extend/object/deep_dup.rb @@ -14,7 +14,9 @@ class Object # object.instance_variable_defined?(:@a) # => false # dup.instance_variable_defined?(:@a) # => true sig { returns(T.self_type) } - def deep_dup = duplicable? ? dup : self + def deep_dup + duplicable? ? dup : self + end end class Array @@ -27,7 +29,9 @@ class Array # array[1][2] # => nil # dup[1][2] # => 4 sig { returns(T.self_type) } - def deep_dup = T.unsafe(self).map(&:deep_dup) + def deep_dup + T.unsafe(self).map(&:deep_dup) + end end class Hash diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 3bdf7e35163861..73be2c2deb9fec 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -10,6 +10,11 @@ require "forwardable" require "set" +require "extend/array" +require "extend/blank" +require "extend/enumerable" +require "extend/string" + HOMEBREW_API_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_API_DEFAULT_DOMAIN").freeze HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV.fetch("HOMEBREW_BOTTLE_DEFAULT_DOMAIN").freeze HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ENV.fetch("HOMEBREW_BREW_DEFAULT_GIT_REMOTE").freeze @@ -61,10 +66,6 @@ %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze -require "extend/array" -require "extend/blank" -require "extend/enumerable" -require "extend/string" require "env_config" require "macos_version" require "os"