diff --git a/Library/Homebrew/cli/args.rbi b/Library/Homebrew/cli/args.rbi new file mode 100644 index 0000000000..2314e9c8f3 --- /dev/null +++ b/Library/Homebrew/cli/args.rbi @@ -0,0 +1,29 @@ +# typed: strict + +module Homebrew + module CLI + class Args < OpenStruct + def devel?; end + + def HEAD?; end + + def include_test?; end + + def build_bottle?; end + + def build_universal?; end + + def build_from_source?; end + + def named_args; end + + def force_bottle?; end + + def debug?; end + + def quiet?; end + + def verbose?; end + end + end +end diff --git a/Library/Homebrew/compat/cli/parser.rbi b/Library/Homebrew/compat/cli/parser.rbi new file mode 100644 index 0000000000..39061bb798 --- /dev/null +++ b/Library/Homebrew/compat/cli/parser.rbi @@ -0,0 +1,15 @@ +# typed: strict + +module Homebrew + module CLI + class Parser + module Compat + include Kernel + + module DeprecatedArgs + include Kernel + end + end + end + end +end diff --git a/Library/Homebrew/compat/dependencies_helpers.rbi b/Library/Homebrew/compat/dependencies_helpers.rbi new file mode 100644 index 0000000000..3ea83b62b9 --- /dev/null +++ b/Library/Homebrew/compat/dependencies_helpers.rbi @@ -0,0 +1,9 @@ +# typed: strict + +module DependenciesHelpers + module Compat + include Kernel + + def args_includes_ignores(args); end + end +end diff --git a/Library/Homebrew/compat/extend/nil.rbi b/Library/Homebrew/compat/extend/nil.rbi new file mode 100644 index 0000000000..0a0adb9756 --- /dev/null +++ b/Library/Homebrew/compat/extend/nil.rbi @@ -0,0 +1,7 @@ +# typed: strict + +class NilClass + module Compat + include Kernel + end +end diff --git a/Library/Homebrew/compat/extend/string.rbi b/Library/Homebrew/compat/extend/string.rbi new file mode 100644 index 0000000000..4851c5b127 --- /dev/null +++ b/Library/Homebrew/compat/extend/string.rbi @@ -0,0 +1,7 @@ +# typed: strict + +class String + module Compat + include Kernel + end +end diff --git a/Library/Homebrew/compat/formula.rbi b/Library/Homebrew/compat/formula.rbi new file mode 100644 index 0000000000..976ddb4a12 --- /dev/null +++ b/Library/Homebrew/compat/formula.rbi @@ -0,0 +1,11 @@ +# typed: strict + +class Formula + module Compat + include Kernel + + def any_installed_keg; end + + def latest_installed_prefix; end + end +end diff --git a/Library/Homebrew/compat/os/mac.rbi b/Library/Homebrew/compat/os/mac.rbi new file mode 100644 index 0000000000..b6156fa2e8 --- /dev/null +++ b/Library/Homebrew/compat/os/mac.rbi @@ -0,0 +1,11 @@ +# typed: strict + +module OS + module Mac + class << self + module Compat + include Kernel + end + end + end +end diff --git a/Library/Homebrew/dependable.rbi b/Library/Homebrew/dependable.rbi new file mode 100644 index 0000000000..c8eda0640b --- /dev/null +++ b/Library/Homebrew/dependable.rbi @@ -0,0 +1,5 @@ +# typed: strict + +module Dependable + def tags; end +end diff --git a/Library/Homebrew/dependencies_helpers.rbi b/Library/Homebrew/dependencies_helpers.rbi new file mode 100644 index 0000000000..f2226a40f4 --- /dev/null +++ b/Library/Homebrew/dependencies_helpers.rbi @@ -0,0 +1,5 @@ +# typed: strict + +module DependenciesHelpers + include Kernel +end diff --git a/Library/Homebrew/extend/os/linux/system_config.rb b/Library/Homebrew/extend/os/linux/system_config.rb index 154c805a1a..6c93d2a4fa 100644 --- a/Library/Homebrew/extend/os/linux/system_config.rb +++ b/Library/Homebrew/extend/os/linux/system_config.rb @@ -3,8 +3,11 @@ require "formula" require "os/linux/glibc" +require "system_command" module SystemConfig + include SystemCommand::Mixin + HOST_RUBY_PATH = "/usr/bin/ruby" class << self diff --git a/Library/Homebrew/extend/os/mac/system_config.rb b/Library/Homebrew/extend/os/mac/system_config.rb index 3ea619e2db..6f70e60597 100644 --- a/Library/Homebrew/extend/os/mac/system_config.rb +++ b/Library/Homebrew/extend/os/mac/system_config.rb @@ -1,8 +1,12 @@ # typed: true # frozen_string_literal: true +require "system_command" + module SystemConfig class << self + include SystemCommand::Mixin + undef describe_java, describe_homebrew_ruby def describe_java diff --git a/Library/Homebrew/global.rbi b/Library/Homebrew/global.rbi new file mode 100644 index 0000000000..1557c3b769 --- /dev/null +++ b/Library/Homebrew/global.rbi @@ -0,0 +1,5 @@ +# typed: strict + +module Homebrew + include Kernel +end diff --git a/Library/Homebrew/help.rbi b/Library/Homebrew/help.rbi new file mode 100644 index 0000000000..9db873c525 --- /dev/null +++ b/Library/Homebrew/help.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Homebrew + module Help + include Kernel + end +end diff --git a/Library/Homebrew/install.rbi b/Library/Homebrew/install.rbi new file mode 100644 index 0000000000..5208127284 --- /dev/null +++ b/Library/Homebrew/install.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Homebrew + module Install + include Kernel + end +end diff --git a/Library/Homebrew/language/perl.rbi b/Library/Homebrew/language/perl.rbi new file mode 100644 index 0000000000..9be98f1896 --- /dev/null +++ b/Library/Homebrew/language/perl.rbi @@ -0,0 +1,9 @@ +# typed: strict + +module Language + module Perl + module Shebang + include Kernel + end + end +end diff --git a/Library/Homebrew/os/linux.rbi b/Library/Homebrew/os/linux.rbi new file mode 100644 index 0000000000..b6f3164683 --- /dev/null +++ b/Library/Homebrew/os/linux.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module OS + module Linux + include ::Kernel + end +end diff --git a/Library/Homebrew/os/mac.rbi b/Library/Homebrew/os/mac.rbi new file mode 100644 index 0000000000..85a546f554 --- /dev/null +++ b/Library/Homebrew/os/mac.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module OS + module Mac + include Kernel + end +end diff --git a/Library/Homebrew/sorbet/rbi/cli.rbi b/Library/Homebrew/sorbet/rbi/cli.rbi deleted file mode 100644 index f920abb0a5..0000000000 --- a/Library/Homebrew/sorbet/rbi/cli.rbi +++ /dev/null @@ -1,37 +0,0 @@ -# typed: strict - -module Homebrew::CLI - class Args < OpenStruct - def devel?; end - - def HEAD?; end - - def include_test?; end - - def build_bottle?; end - - def build_universal?; end - - def build_from_source?; end - - def named_args; end - - def force_bottle?; end - - def debug?; end - - def quiet?; end - - def verbose?; end - end - - - class Parser - module Compat - include Kernel - module DeprecatedArgs - include Kernel - end - end - end -end diff --git a/Library/Homebrew/sorbet/rbi/homebrew.rbi b/Library/Homebrew/sorbet/rbi/homebrew.rbi deleted file mode 100644 index 6ada3bacff..0000000000 --- a/Library/Homebrew/sorbet/rbi/homebrew.rbi +++ /dev/null @@ -1,65 +0,0 @@ -# typed: strict - -module Homebrew - include Kernel -end - -module Homebrew::Help - include Kernel -end - -module Homebrew::Fetch - def args; end -end - -module Homebrew::Install - include Kernel -end - -module Language::Perl::Shebang - include Kernel -end - -module Dependable - def tags; end -end - -module DependenciesHelpers - include Kernel - - module Compat - include Kernel - - def args_includes_ignores(args); end - end -end - -class Formula - module Compat - include Kernel - - def latest_version_installed?; end - - def active_spec; end - - def any_installed_keg; end - - def latest_installed_prefix; end - - def patches; end - end -end - -class NilClass - module Compat - include Kernel - end -end - -class String - module Compat - include Kernel - - def chomp; end - end -end diff --git a/Library/Homebrew/sorbet/rbi/os.rbi b/Library/Homebrew/sorbet/rbi/os.rbi deleted file mode 100644 index f4b85f1f7e..0000000000 --- a/Library/Homebrew/sorbet/rbi/os.rbi +++ /dev/null @@ -1,22 +0,0 @@ -# typed: true - -module OS - module Linux - include Kernel - - def which(cmd, path = ENV["PATH"]) - end - end - - module Mac - include Kernel - end -end - -module OS::Mac - class << self - module Compat - include Kernel - end - end -end diff --git a/Library/Homebrew/sorbet/tapioca/require.rb b/Library/Homebrew/sorbet/tapioca/require.rb index fe1388b13a..536e027e91 100644 --- a/Library/Homebrew/sorbet/tapioca/require.rb +++ b/Library/Homebrew/sorbet/tapioca/require.rb @@ -1,4 +1,4 @@ -# typed: false +# typed: strict # frozen_string_literal: true # Add your extra requires here diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 33f3781d7b..8ad098df1a 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -7,26 +7,25 @@ require "plist" require "shellwords" require "extend/io" +require "extend/predicable" require "extend/hash_validator" using HashValidator -# Make `system_command` available everywhere. -# -# @api private -module Kernel - def system_command(*args) - SystemCommand.run(*args) - end - - def system_command!(*args) - SystemCommand.run!(*args) - end -end - # Class for running sub-processes and capturing their output and exit status. # # @api private class SystemCommand + # Helper functions for calling `SystemCommand.run`. + module Mixin + def system_command(*args) + SystemCommand.run(*args) + end + + def system_command!(*args) + SystemCommand.run!(*args) + end + end + include Context extend Predicable @@ -248,3 +247,7 @@ class SystemCommand private :warn_plist_garbage end end + +# Make `system_command` available everywhere. +# FIXME: Include this explicitly only where it is needed. +include SystemCommand::Mixin # rubocop:disable Style/MixinUsage diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index 5af0d7dbd2..02230bb9b4 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -5,12 +5,15 @@ require "hardware" require "software_spec" require "development_tools" require "extend/ENV" +require "system_command" # Helper module for querying information about the system configuration. # # @api private module SystemConfig class << self + include SystemCommand::Mixin + def clang @clang ||= if DevelopmentTools.installed? DevelopmentTools.clang_version diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index f76069f3b9..774d296156 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -1,10 +1,14 @@ # typed: false # frozen_string_literal: true +require "system_command" + # Module containing all available strategies for unpacking archives. # # @api private module UnpackStrategy + include SystemCommand::Mixin + # Helper module for identifying the file type. module Magic # Length of the longest regex (currently Tar). diff --git a/Library/Homebrew/unpack_strategy/fossil.rb b/Library/Homebrew/unpack_strategy/fossil.rb index c8f165fdd6..f421ee1be8 100644 --- a/Library/Homebrew/unpack_strategy/fossil.rb +++ b/Library/Homebrew/unpack_strategy/fossil.rb @@ -1,10 +1,13 @@ # typed: true # frozen_string_literal: true +require "system_command" + module UnpackStrategy # Strategy for unpacking Fossil repositories. class Fossil include UnpackStrategy + extend SystemCommand::Mixin using Magic diff --git a/Library/Homebrew/unpack_strategy/tar.rb b/Library/Homebrew/unpack_strategy/tar.rb index 7e7b407bcd..a31550b75d 100644 --- a/Library/Homebrew/unpack_strategy/tar.rb +++ b/Library/Homebrew/unpack_strategy/tar.rb @@ -1,10 +1,13 @@ # typed: true # frozen_string_literal: true +require "system_command" + module UnpackStrategy # Strategy for unpacking tar archives. class Tar include UnpackStrategy + extend SystemCommand::Mixin using Magic diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index f2827a8979..d130871167 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -8,7 +8,6 @@ module Utils # # @api private module Inreplace - include Kernel extend T::Sig # Error during replacement. diff --git a/Library/Homebrew/utils/inreplace.rbi b/Library/Homebrew/utils/inreplace.rbi new file mode 100644 index 0000000000..02542091d2 --- /dev/null +++ b/Library/Homebrew/utils/inreplace.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Utils + module Inreplace + include Kernel + end +end diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index 1a726d5939..8078390f60 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -6,8 +6,6 @@ module Utils # # @api private module Link - include Kernel - module_function def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) diff --git a/Library/Homebrew/utils/link.rbi b/Library/Homebrew/utils/link.rbi new file mode 100644 index 0000000000..0b88a48d16 --- /dev/null +++ b/Library/Homebrew/utils/link.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Utils + module Link + include Kernel + end +end diff --git a/Library/Homebrew/utils/shebang.rb b/Library/Homebrew/utils/shebang.rb index 2fdb721cad..762ddf5804 100644 --- a/Library/Homebrew/utils/shebang.rb +++ b/Library/Homebrew/utils/shebang.rb @@ -6,8 +6,6 @@ module Utils # # @api private module Shebang - include Kernel - module_function # Specification on how to rewrite a given shebang. diff --git a/Library/Homebrew/utils/shebang.rbi b/Library/Homebrew/utils/shebang.rbi new file mode 100644 index 0000000000..9cdb0b2007 --- /dev/null +++ b/Library/Homebrew/utils/shebang.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Utils + module Shebang + include Kernel + end +end diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index c469c3ad94..47a22749de 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -3,7 +3,6 @@ module Utils module Shell - include Kernel extend T::Sig module_function diff --git a/Library/Homebrew/utils/shell.rbi b/Library/Homebrew/utils/shell.rbi new file mode 100644 index 0000000000..b860bc1190 --- /dev/null +++ b/Library/Homebrew/utils/shell.rbi @@ -0,0 +1,7 @@ +# typed: strict + +module Utils + module Shell + include Kernel + end +end diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb index febc3dee9a..e6f9fcd228 100644 --- a/Library/Homebrew/utils/svn.rb +++ b/Library/Homebrew/utils/svn.rb @@ -8,36 +8,36 @@ module Utils # # @api private module Svn - include Kernel - extend T::Sig + class << self + extend T::Sig - module_function + include SystemCommand::Mixin - sig { returns(T::Boolean) } - def available? - version.present? - end + sig { returns(T::Boolean) } + def available? + version.present? + end - sig { returns(T.nilable(String)) } - def version - return @version if defined?(@version) + sig { returns(T.nilable(String)) } + def version + return @version if defined?(@version) - stdout, _, status = system_command(HOMEBREW_SHIMS_PATH/"scm/svn", args: ["--version"], print_stderr: false) - @version = status.success? ? stdout.chomp[/svn, version (\d+(?:\.\d+)*)/, 1] : nil - end + stdout, _, status = system_command(HOMEBREW_SHIMS_PATH/"scm/svn", args: ["--version"], print_stderr: false) + @version = status.success? ? stdout.chomp[/svn, version (\d+(?:\.\d+)*)/, 1] : nil + end - sig { params(url: String).returns(T::Boolean) } - def remote_exists?(url) - return true unless available? + sig { params(url: String).returns(T::Boolean) } + def remote_exists?(url) + return true unless available? - # OK to unconditionally trust here because we're just checking if - # a URL exists. - quiet_system "svn", "ls", url, "--depth", "empty", - "--non-interactive", "--trust-server-cert" - end + # OK to unconditionally trust here because we're just checking if a URL exists. + system_command("svn", args: ["ls", url, "--depth", "empty", + "--non-interactive", "--trust-server-cert"], print_stderr: false).success? + end - def clear_version_cache - remove_instance_variable(:@version) if defined?(@version) + def clear_version_cache + remove_instance_variable(:@version) if defined?(@version) + end end end end diff --git a/Library/Homebrew/utils/tar.rb b/Library/Homebrew/utils/tar.rb index fe65d32999..ced4ed5234 100644 --- a/Library/Homebrew/utils/tar.rb +++ b/Library/Homebrew/utils/tar.rb @@ -6,36 +6,34 @@ module Utils # # @api private module Tar - include Kernel + class << self + TAR_FILE_EXTENSIONS = %w[.tar .tb2 .tbz .tbz2 .tgz .tlz .txz .tZ].freeze - module_function + def available? + executable.present? + end - TAR_FILE_EXTENSIONS = %w[.tar .tb2 .tbz .tbz2 .tgz .tlz .txz .tZ].freeze + def executable + return @executable if defined?(@executable) - def available? - executable.present? - end + gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar" + gnu_tar_gtar = gnu_tar_gtar_path if gnu_tar_gtar_path.executable? + @executable = which("gtar") || gnu_tar_gtar || which("tar") + end - def executable - return @executable if defined?(@executable) + def validate_file(path) + return unless available? - gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar" - gnu_tar_gtar = gnu_tar_gtar_path if gnu_tar_gtar_path.executable? - @executable = which("gtar") || gnu_tar_gtar || which("tar") - end + path = Pathname.new(path) + return unless TAR_FILE_EXTENSIONS.include? path.extname + return if Utils.popen_read(executable, "-tf", path).match?(%r{/.*\.}) - def validate_file(path) - return unless available? + odie "#{path} is not a valid tar file!" + end - path = Pathname.new(path) - return unless TAR_FILE_EXTENSIONS.include? path.extname - return if Utils.popen_read(executable, "-tf", path).match?(%r{/.*\.}) - - odie "#{path} is not a valid tar file!" - end - - def clear_executable_cache - remove_instance_variable(:@executable) if defined?(@executable) + def clear_executable_cache + remove_instance_variable(:@executable) if defined?(@executable) + end end end end diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 991c79336b..01ebc1b214 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -5,122 +5,116 @@ # # @api private module Tty - include Kernel - extend T::Sig - @stream = $stdout - module_function + class << self + extend T::Sig - sig { params(stream: IO, _block: T.proc.params(arg0: IO).void).void } - def with(stream, &_block) - previous_stream = @stream - @stream = stream + sig { params(stream: T.any(IO, StringIO), _block: T.proc.params(arg0: T.any(IO, StringIO)).void).void } + def with(stream, &_block) + previous_stream = @stream + @stream = stream - yield stream - ensure - @stream = previous_stream - end - - sig { params(string: String).returns(String) } - def strip_ansi(string) - string.gsub(/\033\[\d+(;\d+)*m/, "") - end - - sig { returns(Integer) } - def width - @width ||= begin - _, width = `/bin/stty size 2>/dev/null`.split - width, = `/usr/bin/tput cols 2>/dev/null`.split if width.to_i.zero? - width ||= 80 - width.to_i + yield stream + ensure + @stream = previous_stream end - end - sig { params(string: String).returns(String) } - def truncate(string) - (w = width).zero? ? string.to_s : (string.to_s[0, w - 4] || "") - end - - COLOR_CODES = { - red: 31, - green: 32, - yellow: 33, - blue: 34, - magenta: 35, - cyan: 36, - default: 39, - }.freeze - - STYLE_CODES = { - reset: 0, - bold: 1, - italic: 3, - underline: 4, - strikethrough: 9, - no_underline: 24, - }.freeze - - SPECIAL_CODES = { - up: "1A", - down: "1B", - right: "1C", - left: "1D", - erase_line: "K", - erase_char: "P", - }.freeze - - CODES = COLOR_CODES.merge(STYLE_CODES).freeze - - sig { params(code: Integer).returns(T.self_type) } - def append_to_escape_sequence(code) - @escape_sequence ||= [] - @escape_sequence << code - self - end - - sig { returns(String) } - def current_escape_sequence - return "" if @escape_sequence.nil? - - "\033[#{@escape_sequence.join(";")}m" - end - - sig { void } - def reset_escape_sequence! - @escape_sequence = nil - end - - CODES.each do |name, code| - define_singleton_method(name) do - append_to_escape_sequence(code) + sig { params(string: String).returns(String) } + def strip_ansi(string) + string.gsub(/\033\[\d+(;\d+)*m/, "") end - end - SPECIAL_CODES.each do |name, code| - define_singleton_method(name) do - if @stream.tty? - "\033[#{code}" - else - "" + sig { returns(Integer) } + def width + @width ||= begin + _, width = `/bin/stty size 2>/dev/null`.split + width, = `/usr/bin/tput cols 2>/dev/null`.split if width.to_i.zero? + width ||= 80 + width.to_i end end - end - sig { returns(String) } - def to_s - return "" unless color? + sig { params(string: String).returns(String) } + def truncate(string) + (w = width).zero? ? string.to_s : (string.to_s[0, w - 4] || "") + end - current_escape_sequence - ensure - reset_escape_sequence! - end + COLOR_CODES = { + red: 31, + green: 32, + yellow: 33, + blue: 34, + magenta: 35, + cyan: 36, + default: 39, + }.freeze - sig { returns(T::Boolean) } - def color? - return false if Homebrew::EnvConfig.no_color? - return true if Homebrew::EnvConfig.color? + STYLE_CODES = { + reset: 0, + bold: 1, + italic: 3, + underline: 4, + strikethrough: 9, + no_underline: 24, + }.freeze - @stream.tty? - end + SPECIAL_CODES = { + up: "1A", + down: "1B", + right: "1C", + left: "1D", + erase_line: "K", + erase_char: "P", + }.freeze + + CODES = COLOR_CODES.merge(STYLE_CODES).freeze + + sig { returns(String) } + def current_escape_sequence + return "" if @escape_sequence.nil? + + "\033[#{@escape_sequence.join(";")}m" + end + + sig { void } + def reset_escape_sequence! + @escape_sequence = nil + end + + CODES.each do |name, code| + define_method(name) do + @escape_sequence ||= [] + @escape_sequence << code + self + end + end + + SPECIAL_CODES.each do |name, code| + define_method(name) do + if @stream.tty? + "\033[#{code}" + else + "" + end + end + end + + sig { returns(String) } + def to_s + return "" unless color? + + current_escape_sequence + ensure + reset_escape_sequence! + end + + sig { returns(T::Boolean) } + def color? + return false if Homebrew::EnvConfig.no_color? + return true if Homebrew::EnvConfig.color? + + @stream.tty? + end +end end diff --git a/Library/Homebrew/utils/user.rb b/Library/Homebrew/utils/user.rb index 238cbdd864..c2db57e637 100644 --- a/Library/Homebrew/utils/user.rb +++ b/Library/Homebrew/utils/user.rb @@ -10,9 +10,10 @@ require "system_command" # # @api private class User < SimpleDelegator - include Kernel extend T::Sig + include SystemCommand::Mixin + # Return whether the user has an active GUI session. sig { returns(T::Boolean) } def gui?