Merge pull request #15817 from ZhongRuoyu/development_tools-locate
development_tools: allow `Symbol`s to be `locate`d
This commit is contained in:
commit
41ca77c6ac
@ -6,7 +6,7 @@ require "version"
|
||||
# @private
|
||||
class DevelopmentTools
|
||||
class << self
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
# Don't call tools (cc, make, strip, etc.) directly!
|
||||
# Give the name of the binary you look for as a string to this method
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
class DevelopmentTools
|
||||
class << self
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
(@locate ||= {}).fetch(tool) do |key|
|
||||
@locate[key] = if needs_build_formulae? &&
|
||||
|
||||
@ -10,7 +10,7 @@ class DevelopmentTools
|
||||
undef installed?, default_compiler, curl_handles_most_https_certificates?,
|
||||
subversion_handles_most_https_certificates?
|
||||
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
(@locate ||= {}).fetch(tool) do |key|
|
||||
@locate[key] = if (located_tool = generic_locate(tool))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user