Add Hash#deep_transform_values to extend/
This commit is contained in:
parent
0cdd4eee3b
commit
a87cdf0d21
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||
|
@ -1,3 +1,4 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Hash
|
22
Library/Homebrew/extend/hash/deep_transform_values.rbi
Normal file
22
Library/Homebrew/extend/hash/deep_transform_values.rbi
Normal file
@ -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
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user