development_tools: update type signatures

This commit is contained in:
fn ⌃ ⌥ 2021-09-29 18:16:34 -07:00
parent 9638e3e8c0
commit bad19b88cd
4 changed files with 16 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class DevelopmentTools
true
end
sig { returns(T::Hash[String, T.untyped]) }
sig { returns(T::Hash[String, T.nilable(String)]) }
def build_system_info
{
"os" => ENV["HOMEBREW_SYSTEM"],

View File

@ -75,6 +75,7 @@ module OS
languages.first
end
sig { returns(String) }
def active_developer_dir
@active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip
end

View File

@ -91,6 +91,9 @@ module OS
# directory or nil if Xcode.app is not installed.
sig { returns(T.nilable(Pathname)) }
def prefix
return @prefix if defined?(@prefix)
@prefix = T.let(@prefix, T.nilable(Pathname))
@prefix ||=
begin
dir = MacOS.active_developer_dir

View File

@ -21,3 +21,14 @@ class Module
end
def define_method(arg0, arg1=T.unsafe(nil), &blk); end
end
class Pathname
# https://github.com/sorbet/sorbet/pull/4660
sig do
params(
consider_symlink: T::Boolean,
)
.returns(Pathname)
end
def cleanpath(consider_symlink=T.unsafe(nil)); end
end