Merge pull request #17157 from reitermarkus/docs-inspect-to_s
Hide `#inspect` and `#to_s` in docs.
This commit is contained in:
commit
ee4499f6d6
@ -24,6 +24,7 @@ Style/Documentation:
|
|||||||
AllowedConstants:
|
AllowedConstants:
|
||||||
- Homebrew
|
- Homebrew
|
||||||
Include:
|
Include:
|
||||||
|
- cask/cask.rb
|
||||||
- cask/dsl.rb
|
- cask/dsl.rb
|
||||||
- cask/dsl/version.rb
|
- cask/dsl/version.rb
|
||||||
- cask/url.rb
|
- cask/url.rb
|
||||||
|
@ -61,7 +61,10 @@ class PATH
|
|||||||
def to_str
|
def to_str
|
||||||
@paths.join(File::PATH_SEPARATOR)
|
@paths.join(File::PATH_SEPARATOR)
|
||||||
end
|
end
|
||||||
alias to_s to_str
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = to_str
|
||||||
|
|
||||||
sig { params(other: T.untyped).returns(T::Boolean) }
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
||||||
def ==(other)
|
def ==(other)
|
||||||
|
@ -149,6 +149,7 @@ module Cask
|
|||||||
cask.config
|
cask.config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"#{summarize} (#{self.class.english_name})"
|
"#{summarize} (#{self.class.english_name})"
|
||||||
|
@ -325,11 +325,13 @@ module Cask
|
|||||||
@ruby_source_checksum = { sha256: ruby_source_sha256 }
|
@ruby_source_checksum = { sha256: ruby_source_sha256 }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Alias for {#token}.
|
# @api public
|
||||||
#
|
# @!visibility private
|
||||||
# @api internal
|
sig { returns(String) }
|
||||||
def to_s = token
|
def to_s = token
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<Cask #{token}#{sourcefile_path&.to_s&.prepend(" ")}>"
|
"#<Cask #{token}#{sourcefile_path&.to_s&.prepend(" ")}>"
|
||||||
end
|
end
|
||||||
|
@ -39,6 +39,8 @@ module Cask
|
|||||||
|
|
||||||
private_class_method :caveat
|
private_class_method :caveat
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
(@custom_caveats + @built_in_caveats.values).join("\n")
|
(@custom_caveats + @built_in_caveats.values).join("\n")
|
||||||
end
|
end
|
||||||
|
@ -29,9 +29,9 @@ module Cask
|
|||||||
pairs.to_yaml
|
pairs.to_yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
# @!visibility private
|
||||||
pairs.inspect
|
sig { returns(String) }
|
||||||
end
|
def to_s = pairs.inspect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,6 +17,7 @@ module Cask
|
|||||||
@errors = errors
|
@errors = errors
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
<<~EOS
|
<<~EOS
|
||||||
@ -48,6 +49,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskNotInstalledError < AbstractCaskErrorWithToken
|
class CaskNotInstalledError < AbstractCaskErrorWithToken
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' is not installed."
|
"Cask '#{token}' is not installed."
|
||||||
@ -65,6 +67,7 @@ module Cask
|
|||||||
@message = message
|
@message = message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' has been #{message}"
|
"Cask '#{token}' has been #{message}"
|
||||||
@ -82,6 +85,7 @@ module Cask
|
|||||||
@conflicting_cask = conflicting_cask
|
@conflicting_cask = conflicting_cask
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' conflicts with '#{conflicting_cask}'."
|
"Cask '#{token}' conflicts with '#{conflicting_cask}'."
|
||||||
@ -92,6 +96,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskUnavailableError < AbstractCaskErrorWithToken
|
class CaskUnavailableError < AbstractCaskErrorWithToken
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' is unavailable#{reason.empty? ? "." : ": #{reason}"}"
|
"Cask '#{token}' is unavailable#{reason.empty? ? "." : ": #{reason}"}"
|
||||||
@ -102,6 +107,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskUnreadableError < CaskUnavailableError
|
class CaskUnreadableError < CaskUnavailableError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' is unreadable#{reason.empty? ? "." : ": #{reason}"}"
|
"Cask '#{token}' is unreadable#{reason.empty? ? "." : ": #{reason}"}"
|
||||||
@ -119,6 +125,7 @@ module Cask
|
|||||||
@tap = tap
|
@tap = tap
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = super
|
s = super
|
||||||
@ -157,6 +164,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskAlreadyCreatedError < AbstractCaskErrorWithToken
|
class CaskAlreadyCreatedError < AbstractCaskErrorWithToken
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
%Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.)
|
%Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.)
|
||||||
@ -167,6 +175,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskCyclicDependencyError < AbstractCaskErrorWithToken
|
class CaskCyclicDependencyError < AbstractCaskErrorWithToken
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' includes cyclic dependencies on other Casks#{reason.empty? ? "." : ": #{reason}"}"
|
"Cask '#{token}' includes cyclic dependencies on other Casks#{reason.empty? ? "." : ": #{reason}"}"
|
||||||
@ -177,6 +186,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
|
class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' depends on itself."
|
"Cask '#{token}' depends on itself."
|
||||||
@ -187,6 +197,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskUnspecifiedError < CaskError
|
class CaskUnspecifiedError < CaskError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"This command requires a Cask token."
|
"This command requires a Cask token."
|
||||||
@ -197,6 +208,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskInvalidError < AbstractCaskErrorWithToken
|
class CaskInvalidError < AbstractCaskErrorWithToken
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"Cask '#{token}' definition is invalid#{reason.empty? ? "." : ": #{reason}"}"
|
"Cask '#{token}' definition is invalid#{reason.empty? ? "." : ": #{reason}"}"
|
||||||
@ -225,6 +237,7 @@ module Cask
|
|||||||
@reason = reason
|
@reason = reason
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = +"Failed to quarantine #{path}."
|
s = +"Failed to quarantine #{path}."
|
||||||
@ -243,6 +256,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskQuarantinePropagationError < CaskQuarantineError
|
class CaskQuarantinePropagationError < CaskQuarantineError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = +"Failed to quarantine one or more files within #{path}."
|
s = +"Failed to quarantine one or more files within #{path}."
|
||||||
@ -261,6 +275,7 @@ module Cask
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class CaskQuarantineReleaseError < CaskQuarantineError
|
class CaskQuarantineReleaseError < CaskQuarantineError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = +"Failed to release #{path} from quarantine."
|
s = +"Failed to release #{path} from quarantine."
|
||||||
|
@ -68,6 +68,8 @@ class CompilerFailure
|
|||||||
type == compiler.type && version_matched
|
type == compiler.type && version_matched
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{type} #{version}>"
|
"#<#{self.class.name}: #{type} #{version}>"
|
||||||
end
|
end
|
||||||
|
@ -22,6 +22,7 @@ class CxxStdlib
|
|||||||
type.to_s.gsub(/cxx$/, "c++")
|
type.to_s.gsub(/cxx$/, "c++")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{compiler} #{type}>"
|
"#<#{self.class.name}: #{compiler} #{type}>"
|
||||||
|
@ -37,6 +37,7 @@ class Dependencies < SimpleDelegator
|
|||||||
self.class.new(*__getobj__.reject { |dep| dep.uses_from_macos? && dep.use_macos_install? })
|
self.class.new(*__getobj__.reject { |dep| dep.uses_from_macos? && dep.use_macos_install? })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{__getobj__}>"
|
"#<#{self.class.name}: #{__getobj__}>"
|
||||||
@ -65,6 +66,7 @@ class Requirements < SimpleDelegator
|
|||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: {#{__getobj__.to_a.join(", ")}}>"
|
"#<#{self.class.name}: {#{__getobj__.to_a.join(", ")}}>"
|
||||||
|
@ -11,7 +11,11 @@ class Dependency
|
|||||||
include Dependable
|
include Dependable
|
||||||
extend Cachable
|
extend Cachable
|
||||||
|
|
||||||
attr_reader :name, :tap
|
sig { returns(String) }
|
||||||
|
attr_reader :name
|
||||||
|
|
||||||
|
sig { returns(T.nilable(Tap)) }
|
||||||
|
attr_reader :tap
|
||||||
|
|
||||||
def initialize(name, tags = [])
|
def initialize(name, tags = [])
|
||||||
raise ArgumentError, "Dependency must have a name!" unless name
|
raise ArgumentError, "Dependency must have a name!" unless name
|
||||||
@ -24,9 +28,9 @@ class Dependency
|
|||||||
@tap, = tap_with_name
|
@tap, = tap_with_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
# @!visibility private
|
||||||
name
|
sig { returns(String) }
|
||||||
end
|
def to_s = name
|
||||||
|
|
||||||
def ==(other)
|
def ==(other)
|
||||||
instance_of?(other.class) && name == other.name && tags == other.tags
|
instance_of?(other.class) && name == other.name && tags == other.tags
|
||||||
@ -96,6 +100,7 @@ class Dependency
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{name.inspect} #{tags.inspect}>"
|
"#<#{self.class.name}: #{name.inspect} #{tags.inspect}>"
|
||||||
@ -279,6 +284,7 @@ class UsesFromMacOSDependency < Dependency
|
|||||||
self.class.new(formula.full_name.to_s, tags, bounds:)
|
self.class.new(formula.full_name.to_s, tags, bounds:)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{name.inspect} #{tags.inspect} #{bounds.inspect}>"
|
"#<#{self.class.name}: #{name.inspect} #{tags.inspect} #{bounds.inspect}>"
|
||||||
|
@ -16,6 +16,7 @@ class UsageError < RuntimeError
|
|||||||
@reason = reason
|
@reason = reason
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = "Invalid usage"
|
s = "Invalid usage"
|
||||||
@ -110,6 +111,7 @@ class FormulaOrCaskUnavailableError < RuntimeError
|
|||||||
"Did you mean #{similar_formula_names.to_sentence two_words_connector: " or ", last_word_connector: " or "}?"
|
"Did you mean #{similar_formula_names.to_sentence two_words_connector: " or ", last_word_connector: " or "}?"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = "No available formula or cask with the name \"#{name}\". #{did_you_mean}".strip
|
s = "No available formula or cask with the name \"#{name}\". #{did_you_mean}".strip
|
||||||
@ -129,6 +131,7 @@ class TapFormulaOrCaskUnavailableError < FormulaOrCaskUnavailableError
|
|||||||
@tap = tap
|
@tap = tap
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = super
|
s = super
|
||||||
@ -148,6 +151,7 @@ class FormulaUnavailableError < FormulaOrCaskUnavailableError
|
|||||||
" (dependency of #{dependent})" if dependent && dependent != name
|
" (dependency of #{dependent})" if dependent && dependent != name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"No available formula with the name \"#{name}\"#{dependent_s}. #{did_you_mean}".strip
|
"No available formula with the name \"#{name}\"#{dependent_s}. #{did_you_mean}".strip
|
||||||
@ -160,6 +164,8 @@ end
|
|||||||
module FormulaClassUnavailableErrorModule
|
module FormulaClassUnavailableErrorModule
|
||||||
attr_reader :path, :class_name, :class_list
|
attr_reader :path, :class_name, :class_list
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = super
|
s = super
|
||||||
s += "\nIn formula file: #{path}"
|
s += "\nIn formula file: #{path}"
|
||||||
@ -204,6 +210,7 @@ end
|
|||||||
module FormulaUnreadableErrorModule
|
module FormulaUnreadableErrorModule
|
||||||
attr_reader :formula_error
|
attr_reader :formula_error
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"#{name}: " + formula_error.to_s
|
"#{name}: " + formula_error.to_s
|
||||||
@ -232,6 +239,8 @@ class TapFormulaUnavailableError < FormulaUnavailableError
|
|||||||
super "#{tap}/#{name}"
|
super "#{tap}/#{name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = super
|
s = super
|
||||||
s += "\nPlease tap it and then try again: brew tap #{tap}" unless tap.installed?
|
s += "\nPlease tap it and then try again: brew tap #{tap}" unless tap.installed?
|
||||||
|
@ -1731,11 +1731,12 @@ class Formula
|
|||||||
[name, *oldnames, *aliases].compact
|
[name, *oldnames, *aliases].compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
# @api public
|
||||||
name
|
# @!visibility private
|
||||||
end
|
sig { returns(String) }
|
||||||
|
def to_s = name
|
||||||
|
|
||||||
# @private
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<Formula #{name} (#{active_spec_sym}) #{path}>"
|
"#<Formula #{name} (#{active_spec_sym}) #{path}>"
|
||||||
|
@ -37,6 +37,8 @@ class KegOnlyReason
|
|||||||
!by_macos?
|
!by_macos?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
return @explanation unless @explanation.empty?
|
return @explanation unless @explanation.empty?
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ module Homebrew
|
|||||||
@text.include? string
|
@text.include? string
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
@text
|
@text
|
||||||
end
|
end
|
||||||
|
@ -107,10 +107,9 @@ class GitRepository
|
|||||||
popen_git("log", "-1", "--pretty=%B", commit, "--", safe:, err: :out)&.strip
|
popen_git("log", "-1", "--pretty=%B", commit, "--", safe:, err: :out)&.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s = pathname.to_s
|
||||||
pathname.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ class Keg
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = []
|
s = []
|
||||||
@ -68,6 +69,7 @@ class Keg
|
|||||||
|
|
||||||
# Error for when a directory is not writable.
|
# Error for when a directory is not writable.
|
||||||
class DirectoryNotWritableError < LinkError
|
class DirectoryNotWritableError < LinkError
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
<<~EOS
|
<<~EOS
|
||||||
@ -155,7 +157,7 @@ class Keg
|
|||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|
||||||
def_delegators :path,
|
def_delegators :path,
|
||||||
:to_s, :hash, :abv, :disk_usage, :file_count, :directory?, :exist?, :/,
|
:to_path, :hash, :abv, :disk_usage, :file_count, :directory?, :exist?, :/,
|
||||||
:join, :rename, :find
|
:join, :rename, :find
|
||||||
|
|
||||||
def initialize(path)
|
def initialize(path)
|
||||||
@ -175,8 +177,11 @@ class Keg
|
|||||||
path.parent
|
path.parent
|
||||||
end
|
end
|
||||||
|
|
||||||
alias to_path to_s
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = path.to_s
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}:#{path}>"
|
"#<#{self.class.name}:#{path}>"
|
||||||
|
@ -108,6 +108,7 @@ class Locale
|
|||||||
locale_groups.find { |locales| locales.any? { |locale| include?(locale) } }
|
locale_groups.find { |locales| locales.any? { |locale| include?(locale) } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
[@language, @script, @region].compact.join("-")
|
[@language, @script, @region].compact.join("-")
|
||||||
|
@ -38,6 +38,7 @@ class Mktemp
|
|||||||
@quiet = true
|
@quiet = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"[Mktemp: #{tmpdir} retain=#{@retain} quiet=#{@quiet}]"
|
"[Mktemp: #{tmpdir} retain=#{@retain} quiet=#{@quiet}]"
|
||||||
|
@ -13,9 +13,9 @@ class Option
|
|||||||
@description = description
|
@description = description
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
# @!visibility private
|
||||||
flag
|
sig { returns(String) }
|
||||||
end
|
def to_s = flag
|
||||||
|
|
||||||
def <=>(other)
|
def <=>(other)
|
||||||
return unless other.is_a?(Option)
|
return unless other.is_a?(Option)
|
||||||
@ -32,6 +32,7 @@ class Option
|
|||||||
name.hash
|
name.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{flag.inspect}>"
|
"#<#{self.class.name}: #{flag.inspect}>"
|
||||||
@ -139,11 +140,13 @@ class Options
|
|||||||
|
|
||||||
alias to_ary to_a
|
alias to_ary to_a
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
@options.map(&:to_s).join(" ")
|
@options.map(&:to_s).join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{to_a.inspect}>"
|
"#<#{self.class.name}: #{to_a.inspect}>"
|
||||||
|
@ -55,6 +55,7 @@ class EmbeddedPatch
|
|||||||
Utils.safe_popen_write("patch", *args) { |p| p.write(data) }
|
Utils.safe_popen_write("patch", *args) { |p| p.write(data) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{strip.inspect}>"
|
"#<#{self.class.name}: #{strip.inspect}>"
|
||||||
@ -160,6 +161,7 @@ class ExternalPatch
|
|||||||
raise BuildError.new(f, cmd, args, ENV.to_hash)
|
raise BuildError.new(f, cmd, args, ENV.to_hash)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{strip.inspect} #{url.inspect}>"
|
"#<#{self.class.name}: #{strip.inspect} #{url.inspect}>"
|
||||||
|
@ -32,14 +32,18 @@ class PkgVersion
|
|||||||
version.head?
|
version.head?
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
sig { returns(String) }
|
||||||
|
def to_str
|
||||||
if revision.positive?
|
if revision.positive?
|
||||||
"#{version}_#{revision}"
|
"#{version}_#{revision}"
|
||||||
else
|
else
|
||||||
version.to_s
|
version.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias to_str to_s
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = to_str
|
||||||
|
|
||||||
def <=>(other)
|
def <=>(other)
|
||||||
return unless other.is_a?(PkgVersion)
|
return unless other.is_a?(PkgVersion)
|
||||||
|
@ -142,6 +142,7 @@ class Requirement
|
|||||||
[self.class, name, tags].hash
|
[self.class, name, tags].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{tags.inspect}>"
|
"#<#{self.class.name}: #{tags.inspect}>"
|
||||||
|
@ -29,6 +29,8 @@ class ArchRequirement < Requirement
|
|||||||
"The #{@arch} architecture is required for this software."
|
"The #{@arch} architecture is required for this software."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: arch=#{@arch.to_s.inspect} #{tags.inspect}>"
|
"#<#{self.class.name}: arch=#{@arch.to_s.inspect} #{tags.inspect}>"
|
||||||
end
|
end
|
||||||
|
@ -98,6 +98,7 @@ class MacOSRequirement < Requirement
|
|||||||
[super, comparator, version].hash
|
[super, comparator, version].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>"
|
"#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>"
|
||||||
|
@ -50,6 +50,7 @@ class XcodeRequirement < Requirement
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: version>=#{@version.inspect} #{tags.inspect}>"
|
"#<#{self.class.name}: version>=#{@version.inspect} #{tags.inspect}>"
|
||||||
|
@ -294,6 +294,7 @@ class ResourceStageContext
|
|||||||
|
|
||||||
# The {Resource} that is being staged.
|
# The {Resource} that is being staged.
|
||||||
attr_reader :resource
|
attr_reader :resource
|
||||||
|
|
||||||
# The {Mktemp} in which {#resource} is staged.
|
# The {Mktemp} in which {#resource} is staged.
|
||||||
attr_reader :staging
|
attr_reader :staging
|
||||||
|
|
||||||
@ -305,6 +306,7 @@ class ResourceStageContext
|
|||||||
@staging = staging
|
@staging = staging
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"<#{self.class}: resource=#{resource} staging=#{staging}>"
|
"<#{self.class}: resource=#{resource} staging=#{staging}>"
|
||||||
|
@ -314,10 +314,13 @@ class Bottle
|
|||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_str
|
||||||
"#{name}--#{version}#{extname}"
|
"#{name}--#{version}#{extname}"
|
||||||
end
|
end
|
||||||
alias to_str to_s
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = to_str
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def json
|
def json
|
||||||
|
@ -18,6 +18,7 @@ module Homebrew
|
|||||||
@column = column
|
@column = column
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
"#{line}#{column&.to_s&.prepend(":")}"
|
"#{line}#{column&.to_s&.prepend(":")}"
|
||||||
|
@ -403,6 +403,7 @@ class Tab
|
|||||||
tabfile.atomic_write(to_json)
|
tabfile.atomic_write(to_json)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
s = []
|
s = []
|
||||||
|
@ -155,9 +155,9 @@ class Tap
|
|||||||
# @api public
|
# @api public
|
||||||
attr_reader :name
|
attr_reader :name
|
||||||
|
|
||||||
# Alias for {#name}.
|
|
||||||
#
|
|
||||||
# @api public
|
# @api public
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def to_s = name
|
def to_s = name
|
||||||
|
|
||||||
# The full name of this {Tap}, including the `homebrew-` prefix.
|
# The full name of this {Tap}, including the `homebrew-` prefix.
|
||||||
|
@ -16,6 +16,7 @@ class URL
|
|||||||
@specs.freeze
|
@specs.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
@url
|
@url
|
||||||
|
@ -202,6 +202,7 @@ module Utils
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
to_sym.to_s
|
to_sym.to_s
|
||||||
|
@ -73,6 +73,7 @@ module GitHub
|
|||||||
@end_column = Integer(end_column) if end_column
|
@end_column = Integer(end_column) if end_column
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
metadata = @type.to_s
|
metadata = @type.to_s
|
||||||
|
@ -85,6 +85,7 @@ module PyPI
|
|||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
if valid_pypi_package?
|
if valid_pypi_package?
|
||||||
|
@ -100,6 +100,7 @@ module Tty
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_s
|
||||||
return "" unless color?
|
return "" unless color?
|
||||||
|
@ -59,6 +59,7 @@ class Version
|
|||||||
sig { abstract.params(other: T.untyped).returns(T.nilable(Integer)) }
|
sig { abstract.params(other: T.untyped).returns(T.nilable(Integer)) }
|
||||||
def <=>(other); end
|
def <=>(other); end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name} #{value.inspect}>"
|
"#<#{self.class.name} #{value.inspect}>"
|
||||||
@ -80,10 +81,13 @@ class Version
|
|||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_s
|
def to_str
|
||||||
value.to_s
|
value.to_s
|
||||||
end
|
end
|
||||||
alias to_str to_s
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = to_str
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def numeric?
|
def numeric?
|
||||||
@ -133,7 +137,8 @@ class Version
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def blank? = true
|
def blank? = true
|
||||||
|
|
||||||
sig { override.returns(String) }
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}>"
|
"#<#{self.class.name}>"
|
||||||
end
|
end
|
||||||
@ -702,11 +707,6 @@ class Version
|
|||||||
version.to_i
|
version.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
|
||||||
def to_s
|
|
||||||
version.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def to_str
|
def to_str
|
||||||
raise NoMethodError, "undefined method `to_str' for #{self.class}:NULL" if null?
|
raise NoMethodError, "undefined method `to_str' for #{self.class}:NULL" if null?
|
||||||
@ -714,6 +714,10 @@ class Version
|
|||||||
T.must(version).to_str
|
T.must(version).to_str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
|
sig { returns(String) }
|
||||||
|
def to_s = version.to_s
|
||||||
|
|
||||||
sig { params(options: T.untyped).returns(String) }
|
sig { params(options: T.untyped).returns(String) }
|
||||||
def to_json(*options)
|
def to_json(*options)
|
||||||
version.to_json(*options)
|
version.to_json(*options)
|
||||||
@ -726,6 +730,7 @@ class Version
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!visibility private
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def inspect
|
def inspect
|
||||||
return "#<Version::NULL>" if null?
|
return "#<Version::NULL>" if null?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user