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/hash/deep_merge.rb b/Library/Homebrew/extend/hash/deep_merge.rb index 9804d6d1e3579e..01ecbe926044cc 100644 --- a/Library/Homebrew/extend/hash/deep_merge.rb +++ b/Library/Homebrew/extend/hash/deep_merge.rb @@ -16,7 +16,9 @@ class Hash # h2 = { b: 250, c: { c1: 200 } } # h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val } # # => { a: 100, b: 450, c: { c1: 300 } } - def deep_merge(other_hash, &block) = dup.deep_merge!(other_hash, &block) + def deep_merge(other_hash, &block) + dup.deep_merge!(other_hash, &block) + end # Same as +deep_merge+, but modifies +self+. def deep_merge!(other_hash, &block) 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"