diff --git a/.gitignore b/.gitignore index f4692e2200..12fd4fb18f 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,6 @@ !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/ !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/ !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/*/ -!**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/hash/deep_transform_values.rb !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/hash/keys.rb !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/object/deep_dup.rb !**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/core_ext/object/duplicable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/deep_transform_values.rb b/Library/Homebrew/extend/hash/deep_transform_values.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/deep_transform_values.rb rename to Library/Homebrew/extend/hash/deep_transform_values.rb index 8ad85c0a6d..c3dd789d25 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.6/lib/active_support/core_ext/hash/deep_transform_values.rb +++ b/Library/Homebrew/extend/hash/deep_transform_values.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class Hash diff --git a/Library/Homebrew/extend/hash/deep_transform_values.rbi b/Library/Homebrew/extend/hash/deep_transform_values.rbi new file mode 100644 index 0000000000..072474393b --- /dev/null +++ b/Library/Homebrew/extend/hash/deep_transform_values.rbi @@ -0,0 +1,22 @@ +# typed: strict + +class Hash + sig { + type_parameters(:out).params( + block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)) + ).returns(T::Hash[Hash::K, T.type_parameter(:out)]) + } + def deep_transform_values(&block); end + sig { + type_parameters(:out).params( + block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)) + ).returns(T::Hash[Hash::K, T.type_parameter(:out)]) + } + def deep_transform_values!(&block); end + + sig { params(object: T.anything, block: T.untyped).returns(T.untyped) } + def _deep_transform_values_in_object(object, &block); end + + sig { params(object: T.anything, block: T.untyped).returns(T.untyped) } + def _deep_transform_values_in_object!(object, &block); end +end diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index f473dcb08a..6690311389 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -9,7 +9,7 @@ require "service" require "utils/curl" require "deprecate_disable" -require "active_support/core_ext/hash/deep_transform_values" +require "extend/hash/deep_transform_values" # The {Formulary} is responsible for creating instances of {Formula}. # It is not meant to be used directly from formulae. diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 25033917e5..44225a085b 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -92,7 +92,7 @@ class Tab end if attributes["source"]["spec"].nil? - version = PkgVersion.parse path.to_s.split("/")[-2] + version = PkgVersion.parse(File.basename(File.dirname(path))) attributes["source"]["spec"] = if version.head? "head" else