diff --git a/Library/Homebrew/sorbet/rbi/utils/user.rbi b/Library/Homebrew/sorbet/rbi/utils/user.rbi deleted file mode 100644 index ef1997fafd..0000000000 --- a/Library/Homebrew/sorbet/rbi/utils/user.rbi +++ /dev/null @@ -1,11 +0,0 @@ -# typed: strict - -class User < SimpleDelegator - include Kernel - - sig { returns(T::Boolean) } - def gui?; end - - sig { returns(T.nilable(T.attached_class)) } - def self.current; end -end diff --git a/Library/Homebrew/utils/user.rb b/Library/Homebrew/utils/user.rb index 0973a95be4..238cbdd864 100644 --- a/Library/Homebrew/utils/user.rb +++ b/Library/Homebrew/utils/user.rb @@ -10,7 +10,11 @@ require "system_command" # # @api private class User < SimpleDelegator + include Kernel + extend T::Sig + # Return whether the user has an active GUI session. + sig { returns(T::Boolean) } def gui? out, _, status = system_command "who" return false unless status.success? @@ -21,6 +25,7 @@ class User < SimpleDelegator end # Return the current user. + sig { returns(T.nilable(T.attached_class)) } def self.current return @current if defined?(@current)