Merge pull request #16831 from reitermarkus/docs-private-by-default

Make documentation `@api private` by default.
This commit is contained in:
Mike McQuaid 2024-04-26 19:22:33 +01:00 committed by GitHub
commit 5607487e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
240 changed files with 222 additions and 863 deletions

View File

@ -28,8 +28,11 @@ Style/Documentation:
- cask/dsl.rb - cask/dsl.rb
- cask/dsl/version.rb - cask/dsl/version.rb
- cask/url.rb - cask/url.rb
- development_tools.rb
- download_strategy.rb - download_strategy.rb
- extend/ENV/super.rb
- extend/kernel.rb - extend/kernel.rb
- extend/pathname.rb
- formula.rb - formula.rb
- formula_assertions.rb - formula_assertions.rb
- formula_free_port.rb - formula_free_port.rb

View File

@ -3,7 +3,7 @@
--markup markdown --markup markdown
--no-private --no-private
--plugin sorbet --plugin sorbet
--load yard/ignore_directives.rb --load ./yard/docstring_parser.rb
--template-path yard/templates --template-path yard/templates
--exclude sorbet/rbi/gems/ --exclude sorbet/rbi/gems/
--exclude test/ --exclude test/

View File

@ -15,6 +15,10 @@ end
# installed gems (should all be require: false) # installed gems (should all be require: false)
# ALL gems that are not vendored should be in a group # ALL gems that are not vendored should be in a group
group :doc, optional: true do
gem "yard", require: false
gem "yard-sorbet", require: false
end
group :ast, optional: true do group :ast, optional: true do
gem "rubocop-ast", require: false gem "rubocop-ast", require: false
end end

View File

@ -198,6 +198,8 @@ DEPENDENCIES
stackprof stackprof
tapioca tapioca
warning warning
yard
yard-sorbet
RUBY VERSION RUBY VERSION
ruby 3.1.4p223 ruby 3.1.4p223

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
# Representation of a `*PATH` environment variable. # Representation of a `*PATH` environment variable.
#
# @api private
class PATH class PATH
include Enumerable include Enumerable
extend Forwardable extend Forwardable

View File

@ -9,8 +9,6 @@ require "extend/cachable"
module Homebrew module Homebrew
# Helper functions for using Homebrew's formulae.brew.sh API. # Helper functions for using Homebrew's formulae.brew.sh API.
#
# @api private
module API module API
extend Cachable extend Cachable
@ -191,7 +189,6 @@ module Homebrew
end end
end end
# @api private
sig { params(block: T.proc.returns(T.untyped)).returns(T.untyped) } sig { params(block: T.proc.returns(T.untyped)).returns(T.untyped) }
def self.with_no_api_env(&block) def self.with_no_api_env(&block)
return yield if Homebrew::EnvConfig.no_install_from_api? return yield if Homebrew::EnvConfig.no_install_from_api?
@ -199,7 +196,6 @@ module Homebrew
with_env(HOMEBREW_NO_INSTALL_FROM_API: "1", HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API: "1", &block) with_env(HOMEBREW_NO_INSTALL_FROM_API: "1", HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API: "1", &block)
end end
# @api private
sig { params(condition: T::Boolean, block: T.proc.returns(T.untyped)).returns(T.untyped) } sig { params(condition: T::Boolean, block: T.proc.returns(T.untyped)).returns(T.untyped) }
def self.with_no_api_env_if_needed(condition, &block) def self.with_no_api_env_if_needed(condition, &block)
return yield unless condition return yield unless condition

View File

@ -4,8 +4,6 @@
module Homebrew module Homebrew
module API module API
# Helper functions for using the analytics JSON API. # Helper functions for using the analytics JSON API.
#
# @api private
module Analytics module Analytics
class << self class << self
sig { returns(String) } sig { returns(String) }

View File

@ -7,8 +7,6 @@ require "api/download"
module Homebrew module Homebrew
module API module API
# Helper functions for using the cask JSON API. # Helper functions for using the cask JSON API.
#
# @api private
module Cask module Cask
extend Cachable extend Cachable

View File

@ -5,7 +5,6 @@ require "downloadable"
module Homebrew module Homebrew
module API module API
# @api private
class DownloadStrategy < CurlDownloadStrategy class DownloadStrategy < CurlDownloadStrategy
sig { override.returns(Pathname) } sig { override.returns(Pathname) }
def symlink_location def symlink_location
@ -13,7 +12,6 @@ module Homebrew
end end
end end
# @api private
class Download < Downloadable class Download < Downloadable
sig { sig {
params( params(

View File

@ -7,8 +7,6 @@ require "api/download"
module Homebrew module Homebrew
module API module API
# Helper functions for using the formula JSON API. # Helper functions for using the formula JSON API.
#
# @api private
module Formula module Formula
extend Cachable extend Cachable

View File

@ -17,8 +17,6 @@ require "socket"
require "cmd/install" require "cmd/install"
# A formula build. # A formula build.
#
# @api private
class Build class Build
attr_reader :formula, :deps, :reqs, :args attr_reader :formula, :deps, :reqs, :args

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
# Settings for the build environment. # Settings for the build environment.
#
# @api private
class BuildEnvironment class BuildEnvironment
sig { params(settings: Symbol).void } sig { params(settings: Symbol).void }
def initialize(*settings) def initialize(*settings)

View File

@ -2,10 +2,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# Options for a formula build. # Options for a formula build.
#
# @api private
class BuildOptions class BuildOptions
# @private
def initialize(args, options) def initialize(args, options)
@args = args @args = args
@options = options @options = options
@ -70,12 +67,10 @@ class BuildOptions
!@args.empty? || !@options.empty? !@args.empty? || !@options.empty?
end end
# @private
def used_options def used_options
@options & @args @options & @args
end end
# @private
def unused_options def unused_options
@options - @args @options - @args
end end

View File

@ -3,8 +3,6 @@
module Homebrew module Homebrew
# Class handling architecture-specific version information. # Class handling architecture-specific version information.
#
# @api private
class BumpVersionParser class BumpVersionParser
sig { returns(T.nilable(T.any(Version, Cask::DSL::Version))) } sig { returns(T.nilable(T.any(Version, Cask::DSL::Version))) }
attr_reader :arm, :general, :intel attr_reader :arm, :general, :intel

View File

@ -5,8 +5,6 @@ require "system_command"
module Homebrew module Homebrew
# Representation of a macOS bundle version, commonly found in `Info.plist` files. # Representation of a macOS bundle version, commonly found in `Info.plist` files.
#
# @api private
class BundleVersion class BundleVersion
include Comparable include Comparable

View File

@ -30,8 +30,6 @@ require "cask/artifact/zap"
module Cask module Cask
# Module containing all cask artifact classes. # Module containing all cask artifact classes.
#
# @api private
module Artifact module Artifact
end end
end end

View File

@ -7,8 +7,6 @@ require "extend/object/deep_dup"
module Cask module Cask
module Artifact module Artifact
# Abstract superclass for all artifacts. # Abstract superclass for all artifacts.
#
# @api private
class AbstractArtifact class AbstractArtifact
extend T::Helpers extend T::Helpers
abstract! abstract!

View File

@ -6,8 +6,6 @@ require "cask/artifact/abstract_artifact"
module Cask module Cask
module Artifact module Artifact
# Abstract superclass for block artifacts. # Abstract superclass for block artifacts.
#
# @api private
class AbstractFlightBlock < AbstractArtifact class AbstractFlightBlock < AbstractArtifact
def self.dsl_key def self.dsl_key
super.to_s.sub(/_block$/, "").to_sym super.to_s.sub(/_block$/, "").to_sym

View File

@ -12,8 +12,6 @@ require "system_command"
module Cask module Cask
module Artifact module Artifact
# Abstract superclass for uninstall artifacts. # Abstract superclass for uninstall artifacts.
#
# @api private
class AbstractUninstall < AbstractArtifact class AbstractUninstall < AbstractArtifact
include SystemCommand::Mixin include SystemCommand::Mixin

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `app` stanza. # Artifact corresponding to the `app` stanza.
#
# @api private
class App < Moved class App < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Generic artifact corresponding to the `artifact` stanza. # Generic artifact corresponding to the `artifact` stanza.
#
# @api private
class Artifact < Moved class Artifact < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `audio_unit_plugin` stanza. # Artifact corresponding to the `audio_unit_plugin` stanza.
#
# @api private
class AudioUnitPlugin < Moved class AudioUnitPlugin < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/symlinked"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `binary` stanza. # Artifact corresponding to the `binary` stanza.
#
# @api private
class Binary < Symlinked class Binary < Symlinked
def link(command: nil, **options) def link(command: nil, **options)
super(command:, **options) super(command:, **options)

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `colorpicker` stanza. # Artifact corresponding to the `colorpicker` stanza.
#
# @api private
class Colorpicker < Moved class Colorpicker < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `dictionary` stanza. # Artifact corresponding to the `dictionary` stanza.
#
# @api private
class Dictionary < Moved class Dictionary < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `font` stanza. # Artifact corresponding to the `font` stanza.
#
# @api private
class Font < Moved class Font < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `input_method` stanza. # Artifact corresponding to the `input_method` stanza.
#
# @api private
class InputMethod < Moved class InputMethod < Moved
end end
end end

View File

@ -7,8 +7,6 @@ require "extend/hash/keys"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `installer` stanza. # Artifact corresponding to the `installer` stanza.
#
# @api private
class Installer < AbstractArtifact class Installer < AbstractArtifact
VALID_KEYS = Set.new([ VALID_KEYS = Set.new([
:manual, :manual,

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `internet_plugin` stanza. # Artifact corresponding to the `internet_plugin` stanza.
#
# @api private
class InternetPlugin < Moved class InternetPlugin < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `keyboard_layout` stanza. # Artifact corresponding to the `keyboard_layout` stanza.
#
# @api private
class KeyboardLayout < Moved class KeyboardLayout < Moved
def install_phase(**options) def install_phase(**options)
super(**options) super(**options)

View File

@ -6,8 +6,6 @@ require "cask/artifact/symlinked"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `manpage` stanza. # Artifact corresponding to the `manpage` stanza.
#
# @api private
class Manpage < Symlinked class Manpage < Symlinked
attr_reader :section attr_reader :section

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `mdimporter` stanza. # Artifact corresponding to the `mdimporter` stanza.
#
# @api private
class Mdimporter < Moved class Mdimporter < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -7,8 +7,6 @@ require "cask/quarantine"
module Cask module Cask
module Artifact module Artifact
# Superclass for all artifacts that are installed by moving them to the target location. # Superclass for all artifacts that are installed by moving them to the target location.
#
# @api private
class Moved < Relocated class Moved < Relocated
sig { returns(String) } sig { returns(String) }
def self.english_description def self.english_description

View File

@ -10,8 +10,6 @@ require "extend/hash/keys"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `pkg` stanza. # Artifact corresponding to the `pkg` stanza.
#
# @api private
class Pkg < AbstractArtifact class Pkg < AbstractArtifact
attr_reader :path, :stanza_options attr_reader :path, :stanza_options

View File

@ -6,8 +6,6 @@ require "cask/artifact/abstract_flight_block"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `postflight` stanza. # Artifact corresponding to the `postflight` stanza.
#
# @api private
class PostflightBlock < AbstractFlightBlock class PostflightBlock < AbstractFlightBlock
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/abstract_flight_block"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `preflight` stanza. # Artifact corresponding to the `preflight` stanza.
#
# @api private
class PreflightBlock < AbstractFlightBlock class PreflightBlock < AbstractFlightBlock
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `prefpane` stanza. # Artifact corresponding to the `prefpane` stanza.
#
# @api private
class Prefpane < Moved class Prefpane < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `qlplugin` stanza. # Artifact corresponding to the `qlplugin` stanza.
#
# @api private
class Qlplugin < Moved class Qlplugin < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -7,8 +7,6 @@ require "extend/hash/keys"
module Cask module Cask
module Artifact module Artifact
# Superclass for all artifacts which have a source and a target location. # Superclass for all artifacts which have a source and a target location.
#
# @api private
class Relocated < AbstractArtifact class Relocated < AbstractArtifact
def self.from_args(cask, *args) def self.from_args(cask, *args)
source_string, target_hash = args source_string, target_hash = args

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `screen_saver` stanza. # Artifact corresponding to the `screen_saver` stanza.
#
# @api private
class ScreenSaver < Moved class ScreenSaver < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `service` stanza. # Artifact corresponding to the `service` stanza.
#
# @api private
class Service < Moved class Service < Moved
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/artifact/abstract_artifact"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `stage_only` stanza. # Artifact corresponding to the `stage_only` stanza.
#
# @api private
class StageOnly < AbstractArtifact class StageOnly < AbstractArtifact
def self.from_args(cask, *args, **kwargs) def self.from_args(cask, *args, **kwargs)
if (args != [true] && args != ["true"]) || kwargs.present? if (args != [true] && args != ["true"]) || kwargs.present?

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `suite` stanza. # Artifact corresponding to the `suite` stanza.
#
# @api private
class Suite < Moved class Suite < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -6,8 +6,6 @@ require "cask/artifact/relocated"
module Cask module Cask
module Artifact module Artifact
# Superclass for all artifacts which are installed by symlinking them to the target location. # Superclass for all artifacts which are installed by symlinking them to the target location.
#
# @api private
class Symlinked < Relocated class Symlinked < Relocated
sig { returns(String) } sig { returns(String) }
def self.link_type_english_name def self.link_type_english_name

View File

@ -8,8 +8,6 @@ UPGRADE_REINSTALL_SKIP_DIRECTIVES = [:quit, :signal].freeze
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `uninstall` stanza. # Artifact corresponding to the `uninstall` stanza.
#
# @api private
class Uninstall < AbstractUninstall class Uninstall < AbstractUninstall
def uninstall_phase(upgrade: false, reinstall: false, **options) def uninstall_phase(upgrade: false, reinstall: false, **options)
filtered_directives = ORDERED_DIRECTIVES.filter do |directive_sym| filtered_directives = ORDERED_DIRECTIVES.filter do |directive_sym|

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `vst3_plugin` stanza. # Artifact corresponding to the `vst3_plugin` stanza.
#
# @api private
class Vst3Plugin < Moved class Vst3Plugin < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -6,8 +6,6 @@ require "cask/artifact/moved"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `vst_plugin` stanza. # Artifact corresponding to the `vst_plugin` stanza.
#
# @api private
class VstPlugin < Moved class VstPlugin < Moved
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name

View File

@ -6,8 +6,6 @@ require "cask/artifact/abstract_uninstall"
module Cask module Cask
module Artifact module Artifact
# Artifact corresponding to the `zap` stanza. # Artifact corresponding to the `zap` stanza.
#
# @api private
class Zap < AbstractUninstall class Zap < AbstractUninstall
def zap_phase(**options) def zap_phase(**options)
dispatch_uninstall_directives(**options) dispatch_uninstall_directives(**options)

View File

@ -5,8 +5,6 @@ require "set"
module Cask module Cask
# Sorted set containing all cask artifacts. # Sorted set containing all cask artifacts.
#
# @api private
class ArtifactSet < ::Set class ArtifactSet < ::Set
def each(&block) def each(&block)
return enum_for(T.must(__method__)) { size } unless block return enum_for(T.must(__method__)) { size } unless block

View File

@ -14,8 +14,6 @@ require "utils/shared_audits"
module Cask module Cask
# Audit a cask for various problems. # Audit a cask for various problems.
#
# @api private
class Audit class Audit
include SystemCommand::Mixin include SystemCommand::Mixin
include ::Utils::Curl include ::Utils::Curl

View File

@ -5,8 +5,6 @@ require "cask/audit"
module Cask module Cask
# Helper class for auditing all available languages of a cask. # Helper class for auditing all available languages of a cask.
#
# @api private
class Auditor class Auditor
def self.audit(cask, **options) def self.audit(cask, **options)
new(cask, **options).audit new(cask, **options).audit

View File

@ -3,8 +3,6 @@
module Cask module Cask
# Helper functions for the cask cache. # Helper functions for the cask cache.
#
# @api private
module Cache module Cache
sig { returns(Pathname) } sig { returns(Pathname) }
def self.path def self.path

View File

@ -12,8 +12,6 @@ require "extend/api_hashable"
module Cask module Cask
# An instance of a cask. # An instance of a cask.
#
# @api private
class Cask class Cask
extend Forwardable extend Forwardable
extend Attrable extend Attrable
@ -35,7 +33,6 @@ module Cask
attr_predicate :loaded_from_api? attr_predicate :loaded_from_api?
# @api private
def self.all(eval_all: false) def self.all(eval_all: false)
if !eval_all && !Homebrew::EnvConfig.eval_all? if !eval_all && !Homebrew::EnvConfig.eval_all?
raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL" raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL"
@ -383,7 +380,6 @@ module Cask
} }
end end
# @private
def to_internal_api_hash def to_internal_api_hash
api_hash = { api_hash = {
"token" => token, "token" => token,
@ -426,7 +422,6 @@ module Cask
HASH_KEYS_TO_SKIP = %w[outdated installed versions].freeze HASH_KEYS_TO_SKIP = %w[outdated installed versions].freeze
private_constant :HASH_KEYS_TO_SKIP private_constant :HASH_KEYS_TO_SKIP
# @private
def to_hash_with_variations(hash_method: :to_h) def to_hash_with_variations(hash_method: :to_h)
case hash_method case hash_method
when :to_h when :to_h

View File

@ -9,8 +9,6 @@ require "extend/hash/keys"
module Cask module Cask
# Loads a cask from various sources. # Loads a cask from various sources.
#
# @api private
module CaskLoader module CaskLoader
extend Context extend Context

View File

@ -3,8 +3,6 @@
module Cask module Cask
# List of casks which are not allowed in official taps. # List of casks which are not allowed in official taps.
#
# @api private
module Denylist module Denylist
sig { params(name: String).returns(T.nilable(String)) } sig { params(name: String).returns(T.nilable(String)) }
def self.reason(name) def self.reason(name)

View File

@ -8,8 +8,6 @@ require "cask/quarantine"
module Cask module Cask
# A download corresponding to a {Cask}. # A download corresponding to a {Cask}.
#
# @api private
class Download < ::Downloadable class Download < ::Downloadable
include Context include Context

View File

@ -30,8 +30,6 @@ require "extend/on_system"
module Cask module Cask
# Class representing the domain-specific language used for casks. # Class representing the domain-specific language used for casks.
#
# @api private
class DSL class DSL
ORDINARY_ARTIFACT_CLASSES = [ ORDINARY_ARTIFACT_CLASSES = [
Artifact::Installer, Artifact::Installer,

View File

@ -7,8 +7,6 @@ require "extend/on_system"
module Cask module Cask
class DSL class DSL
# Superclass for all stanzas which take a block. # Superclass for all stanzas which take a block.
#
# @api private
class Base class Base
extend Forwardable extend Forwardable

View File

@ -14,8 +14,6 @@ module Cask
# The return value of the last method in the block is also sent # The return value of the last method in the block is also sent
# to the output by the caller, but that feature is only for the # to the output by the caller, but that feature is only for the
# convenience of cask authors. # convenience of cask authors.
#
# @api private
class Caveats < Base class Caveats < Base
extend Attrable extend Attrable

View File

@ -7,8 +7,6 @@ require "extend/hash/keys"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `conflicts_with` stanza. # Class corresponding to the `conflicts_with` stanza.
#
# @api private
class ConflictsWith < SimpleDelegator class ConflictsWith < SimpleDelegator
VALID_KEYS = [ VALID_KEYS = [
:formula, :formula,

View File

@ -6,8 +6,6 @@ require "unpack_strategy"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `container` stanza. # Class corresponding to the `container` stanza.
#
# @api private
class Container class Container
attr_accessor :nested, :type attr_accessor :nested, :type

View File

@ -8,8 +8,6 @@ require "requirements/macos_requirement"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `depends_on` stanza. # Class corresponding to the `depends_on` stanza.
#
# @api private
class DependsOn < SimpleDelegator class DependsOn < SimpleDelegator
VALID_KEYS = Set.new([ VALID_KEYS = Set.new([
:formula, :formula,

View File

@ -6,8 +6,6 @@ require "cask/staged"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `postflight` stanza. # Class corresponding to the `postflight` stanza.
#
# @api private
class Postflight < Base class Postflight < Base
include Staged include Staged

View File

@ -6,8 +6,6 @@ require "cask/staged"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `preflight` stanza. # Class corresponding to the `preflight` stanza.
#
# @api private
class Preflight < Base class Preflight < Base
include Staged include Staged
end end

View File

@ -4,8 +4,6 @@
module Cask module Cask
class DSL class DSL
# Class corresponding to the `uninstall_postflight` stanza. # Class corresponding to the `uninstall_postflight` stanza.
#
# @api private
class UninstallPostflight < Base class UninstallPostflight < Base
end end
end end

View File

@ -6,8 +6,6 @@ require "cask/staged"
module Cask module Cask
class DSL class DSL
# Class corresponding to the `uninstall_preflight` stanza. # Class corresponding to the `uninstall_preflight` stanza.
#
# @api private
class UninstallPreflight < Base class UninstallPreflight < Base
include Staged include Staged
end end

View File

@ -4,8 +4,6 @@
module Cask module Cask
class DSL class DSL
# Class corresponding to the `version` stanza. # Class corresponding to the `version` stanza.
#
# @api private
class Version < ::String class Version < ::String
DIVIDERS = { DIVIDERS = {
"." => :dots, "." => :dots,

View File

@ -3,13 +3,9 @@
module Cask module Cask
# General cask error. # General cask error.
#
# @api private
class CaskError < RuntimeError; end class CaskError < RuntimeError; end
# Cask error containing multiple other errors. # Cask error containing multiple other errors.
#
# @api private
class MultipleCaskErrors < CaskError class MultipleCaskErrors < CaskError
def initialize(errors) def initialize(errors)
super() super()
@ -28,8 +24,6 @@ module Cask
end end
# Abstract cask error containing a cask token. # Abstract cask error containing a cask token.
#
# @api private
class AbstractCaskErrorWithToken < CaskError class AbstractCaskErrorWithToken < CaskError
sig { returns(String) } sig { returns(String) }
attr_reader :token attr_reader :token
@ -46,8 +40,6 @@ module Cask
end end
# Error when a cask is not installed. # Error when a cask is not installed.
#
# @api private
class CaskNotInstalledError < AbstractCaskErrorWithToken class CaskNotInstalledError < AbstractCaskErrorWithToken
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -57,8 +49,6 @@ module Cask
end end
# Error when a cask cannot be installed. # Error when a cask cannot be installed.
#
# @api private
class CaskCannotBeInstalledError < AbstractCaskErrorWithToken class CaskCannotBeInstalledError < AbstractCaskErrorWithToken
attr_reader :message attr_reader :message
@ -75,8 +65,6 @@ module Cask
end end
# Error when a cask conflicts with another cask. # Error when a cask conflicts with another cask.
#
# @api private
class CaskConflictError < AbstractCaskErrorWithToken class CaskConflictError < AbstractCaskErrorWithToken
attr_reader :conflicting_cask attr_reader :conflicting_cask
@ -93,8 +81,6 @@ module Cask
end end
# Error when a cask is not available. # Error when a cask is not available.
#
# @api private
class CaskUnavailableError < AbstractCaskErrorWithToken class CaskUnavailableError < AbstractCaskErrorWithToken
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -104,8 +90,6 @@ module Cask
end end
# Error when a cask is unreadable. # Error when a cask is unreadable.
#
# @api private
class CaskUnreadableError < CaskUnavailableError class CaskUnreadableError < CaskUnavailableError
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -115,8 +99,6 @@ module Cask
end end
# Error when a cask in a specific tap is not available. # Error when a cask in a specific tap is not available.
#
# @api private
class TapCaskUnavailableError < CaskUnavailableError class TapCaskUnavailableError < CaskUnavailableError
attr_reader :tap attr_reader :tap
@ -135,8 +117,6 @@ module Cask
end end
# Error when a cask with the same name is found in multiple taps. # Error when a cask with the same name is found in multiple taps.
#
# @api private
class TapCaskAmbiguityError < CaskError class TapCaskAmbiguityError < CaskError
sig { returns(String) } sig { returns(String) }
attr_reader :token attr_reader :token
@ -161,8 +141,6 @@ module Cask
end end
# Error when a cask already exists. # Error when a cask already exists.
#
# @api private
class CaskAlreadyCreatedError < AbstractCaskErrorWithToken class CaskAlreadyCreatedError < AbstractCaskErrorWithToken
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -172,8 +150,6 @@ module Cask
end end
# Error when there is a cyclic cask dependency. # Error when there is a cyclic cask dependency.
#
# @api private
class CaskCyclicDependencyError < AbstractCaskErrorWithToken class CaskCyclicDependencyError < AbstractCaskErrorWithToken
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -183,8 +159,6 @@ module Cask
end end
# Error when a cask depends on itself. # Error when a cask depends on itself.
#
# @api private
class CaskSelfReferencingDependencyError < CaskCyclicDependencyError class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -194,8 +168,6 @@ module Cask
end end
# Error when no cask is specified. # Error when no cask is specified.
#
# @api private
class CaskUnspecifiedError < CaskError class CaskUnspecifiedError < CaskError
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -205,8 +177,6 @@ module Cask
end end
# Error when a cask is invalid. # Error when a cask is invalid.
#
# @api private
class CaskInvalidError < AbstractCaskErrorWithToken class CaskInvalidError < AbstractCaskErrorWithToken
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -216,8 +186,6 @@ module Cask
end end
# Error when a cask token does not match the file name. # Error when a cask token does not match the file name.
#
# @api private
class CaskTokenMismatchError < CaskInvalidError class CaskTokenMismatchError < CaskInvalidError
def initialize(token, header_token) def initialize(token, header_token)
super(token, "Token '#{header_token}' in header line does not match the file name.") super(token, "Token '#{header_token}' in header line does not match the file name.")
@ -225,8 +193,6 @@ module Cask
end end
# Error during quarantining of a file. # Error during quarantining of a file.
#
# @api private
class CaskQuarantineError < CaskError class CaskQuarantineError < CaskError
attr_reader :path, :reason attr_reader :path, :reason
@ -253,8 +219,6 @@ module Cask
end end
# Error while propagating quarantine information to subdirectories. # Error while propagating quarantine information to subdirectories.
#
# @api private
class CaskQuarantinePropagationError < CaskQuarantineError class CaskQuarantinePropagationError < CaskQuarantineError
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
@ -272,8 +236,6 @@ module Cask
end end
# Error while removing quarantine information. # Error while removing quarantine information.
#
# @api private
class CaskQuarantineReleaseError < CaskQuarantineError class CaskQuarantineReleaseError < CaskQuarantineError
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }

View File

@ -4,8 +4,6 @@
require "json" require "json"
module Cask module Cask
#
# @api private
class Info class Info
def self.get_info(cask) def self.get_info(cask)
require "cask/installer" require "cask/installer"

View File

@ -15,8 +15,6 @@ require "cgi"
module Cask module Cask
# Installer for a {Cask}. # Installer for a {Cask}.
#
# @api private
class Installer class Installer
extend Attrable extend Attrable

View File

@ -4,7 +4,6 @@
require "cask/artifact/relocated" require "cask/artifact/relocated"
module Cask module Cask
# @api private
class List class List
def self.list_casks(*casks, one: false, full_name: false, versions: false) def self.list_casks(*casks, one: false, full_name: false, versions: false)
output = if casks.any? output = if casks.any?

View File

@ -3,8 +3,6 @@
module Cask module Cask
# Helper module for reading and writing cask metadata. # Helper module for reading and writing cask metadata.
#
# @api private
module Metadata module Metadata
METADATA_SUBDIR = ".metadata" METADATA_SUBDIR = ".metadata"
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S.%L" TIMESTAMP_FORMAT = "%Y%m%d%H%M%S.%L"

View File

@ -5,8 +5,6 @@ require "cask/macos"
module Cask module Cask
# Helper class for uninstalling `.pkg` installers. # Helper class for uninstalling `.pkg` installers.
#
# @api private
class Pkg class Pkg
sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) } sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) }
def self.all_matching(regexp, command) def self.all_matching(regexp, command)

View File

@ -7,8 +7,6 @@ require "system_command"
module Cask module Cask
# Helper module for quarantining files. # Helper module for quarantining files.
#
# @api private
module Quarantine module Quarantine
extend SystemCommand::Mixin extend SystemCommand::Mixin

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Cask module Cask
#
# @api private
class Reinstall class Reinstall
def self.reinstall_casks( def self.reinstall_casks(
*casks, *casks,

View File

@ -5,8 +5,6 @@ require "utils/user"
module Cask module Cask
# Helper functions for staged casks. # Helper functions for staged casks.
#
# @api private
module Staged module Staged
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed. # FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant # rubocop:disable Style/MutableConstant

View File

@ -2,7 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Cask module Cask
# @api private
class Uninstall class Uninstall
def self.uninstall_casks(*casks, binaries: nil, force: false, verbose: false) def self.uninstall_casks(*casks, binaries: nil, force: false, verbose: false)
require "cask/installer" require "cask/installer"

View File

@ -5,7 +5,6 @@ require "env_config"
require "cask/config" require "cask/config"
module Cask module Cask
# @api private
class Upgrade class Upgrade
sig { sig {
params( params(

View File

@ -6,10 +6,7 @@ require "utils/curl"
module Cask module Cask
# Class corresponding to the `url` stanza. # Class corresponding to the `url` stanza.
#
# @api private
class URL < Delegator class URL < Delegator
# @api private
class DSL class DSL
attr_reader :uri, :specs, attr_reader :uri, :specs,
:verified, :using, :verified, :using,
@ -79,7 +76,6 @@ module Cask
end end
end end
# @api private
class BlockDSL class BlockDSL
# To access URL associated with page contents. # To access URL associated with page contents.
module PageWithURL module PageWithURL

View File

@ -8,8 +8,6 @@ BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs"
module Cask module Cask
# Helper functions for various cask operations. # Helper functions for various cask operations.
#
# @api private
module Utils module Utils
def self.gain_permissions_mkpath(path, command: SystemCommand) def self.gain_permissions_mkpath(path, command: SystemCommand)
dir = path.ascend.find(&:directory?) dir = path.ascend.find(&:directory?)

View File

@ -5,8 +5,6 @@ require "language/python"
require "utils/service" require "utils/service"
# A formula's caveats. # A formula's caveats.
#
# @api private
class Caveats class Caveats
extend Forwardable extend Forwardable

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
# A formula's checksum. # A formula's checksum.
#
# @api private
class Checksum class Checksum
extend Forwardable extend Forwardable

View File

@ -10,8 +10,6 @@ require "set"
module Homebrew module Homebrew
# Helper class for cleaning up the Homebrew cache. # Helper class for cleaning up the Homebrew cache.
#
# @api private
class Cleanup class Cleanup
CLEANUP_DEFAULT_DAYS = Homebrew::EnvConfig.cleanup_periodic_full_days.to_i.freeze CLEANUP_DEFAULT_DAYS = Homebrew::EnvConfig.cleanup_periodic_full_days.to_i.freeze
private_constant :CLEANUP_DEFAULT_DAYS private_constant :CLEANUP_DEFAULT_DAYS

View File

@ -8,8 +8,6 @@ require "cli/args"
module Homebrew module Homebrew
module CLI module CLI
# Helper class for loading formulae/casks from named arguments. # Helper class for loading formulae/casks from named arguments.
#
# @api private
class NamedArgs < Array class NamedArgs < Array
sig { sig {
params( params(

View File

@ -4,8 +4,6 @@
require "completions" require "completions"
# Helper functions for commands. # Helper functions for commands.
#
# @api private
module Commands module Commands
HOMEBREW_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"cmd").freeze HOMEBREW_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"cmd").freeze
HOMEBREW_DEV_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"dev-cmd").freeze HOMEBREW_DEV_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"dev-cmd").freeze

View File

@ -1,7 +1,6 @@
# typed: true # typed: true
# frozen_string_literal: true # frozen_string_literal: true
# @private
module CompilerConstants module CompilerConstants
GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13].freeze GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13].freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/ GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/
@ -16,8 +15,6 @@ module CompilerConstants
end end
# Class for checking compiler compatibility for a formula. # Class for checking compiler compatibility for a formula.
#
# @api private
class CompilerFailure class CompilerFailure
attr_reader :type attr_reader :type
@ -99,8 +96,6 @@ class CompilerFailure
end end
# Class for selecting a compiler for a formula. # Class for selecting a compiler for a formula.
#
# @api private
class CompilerSelector class CompilerSelector
include CompilerConstants include CompilerConstants

View File

@ -7,8 +7,6 @@ require "erb"
module Homebrew module Homebrew
# Helper functions for generating shell completions. # Helper functions for generating shell completions.
#
# @api private
module Completions module Completions
Variables = Struct.new( Variables = Struct.new(
:aliases, :aliases,

View File

@ -4,8 +4,6 @@
require "monitor" require "monitor"
# Module for querying the current execution context. # Module for querying the current execution context.
#
# @api private
module Context module Context
extend MonitorMixin extend MonitorMixin

View File

@ -6,8 +6,6 @@ require "mutex_m"
require "ignorable" require "ignorable"
# Helper module for debugging formulae. # Helper module for debugging formulae.
#
# @api private
module Debrew module Debrew
extend Mutex_m extend Mutex_m

View File

@ -3,7 +3,6 @@
require "irb" require "irb"
# @private
module IRB module IRB
def self.start_within(binding) def self.start_within(binding)
unless @setup_done unless @setup_done

View File

@ -4,8 +4,6 @@
require "options" require "options"
# Shared functions for classes which can be depended upon. # Shared functions for classes which can be depended upon.
#
# @api private
module Dependable module Dependable
# `:run` and `:linked` are no longer used but keep them here to avoid their # `:run` and `:linked` are no longer used but keep them here to avoid their
# misuse in future. # misuse in future.

View File

@ -4,8 +4,6 @@
require "delegate" require "delegate"
# A collection of dependencies. # A collection of dependencies.
#
# @api private
class Dependencies < SimpleDelegator class Dependencies < SimpleDelegator
def initialize(*args) def initialize(*args)
super(args) super(args)
@ -45,8 +43,6 @@ class Dependencies < SimpleDelegator
end end
# A collection of requirements. # A collection of requirements.
#
# @api private
class Requirements < SimpleDelegator class Requirements < SimpleDelegator
def initialize(*args) def initialize(*args)
super(Set.new(args)) super(Set.new(args))

View File

@ -4,8 +4,6 @@
require "cask_dependent" require "cask_dependent"
# Helper functions for dependencies. # Helper functions for dependencies.
#
# @api private
module DependenciesHelpers module DependenciesHelpers
def args_includes_ignores(args) def args_includes_ignores(args)
includes = [:required?, :recommended?] # included by default includes = [:required?, :recommended?] # included by default

View File

@ -4,8 +4,6 @@
require "dependable" require "dependable"
# A dependency on another Homebrew formula. # A dependency on another Homebrew formula.
#
# @api private
class Dependency class Dependency
extend Forwardable extend Forwardable
include Dependable include Dependable
@ -28,10 +26,6 @@ class Dependency
@tap, = tap_with_name @tap, = tap_with_name
end end
# @!visibility private
sig { returns(String) }
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
end end
@ -100,6 +94,10 @@ class Dependency
false false
end end
# @!visibility private
sig { returns(String) }
def to_s = name
# @!visibility private # @!visibility private
sig { returns(String) } sig { returns(String) }
def inspect def inspect

View File

@ -158,7 +158,7 @@ class DependencyCollector
def parse_symbol_spec(spec, tags) def parse_symbol_spec(spec, tags)
# When modifying this list of supported requirements, consider # When modifying this list of supported requirements, consider
# whether Formulary::API_SUPPORTED_REQUIREMENTS should also be changed. # whether `Formulary::API_SUPPORTED_REQUIREMENTS` should also be changed.
case spec case spec
when :arch then ArchRequirement.new(tags) when :arch then ArchRequirement.new(tags)
when :codesign then CodesignRequirement.new(tags) when :codesign then CodesignRequirement.new(tags)

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
# Helper module for handling `disable!` and `deprecate!`. # Helper module for handling `disable!` and `deprecate!`.
#
# @api private
module DeprecateDisable module DeprecateDisable
module_function module_function

View File

@ -6,8 +6,6 @@ require "formula_versions"
require "search" require "search"
# Helper class for printing and searching descriptions. # Helper class for printing and searching descriptions.
#
# @api private
class Descriptions class Descriptions
# Given a regex, find all formulae whose specified fields contain a match. # Given a regex, find all formulae whose specified fields contain a match.
def self.search(string_or_regex, field, cache_store, eval_all = Homebrew::EnvConfig.eval_all?) def self.search(string_or_regex, field, cache_store, eval_all = Homebrew::EnvConfig.eval_all?)

View File

@ -0,0 +1,37 @@
# typed: strict
# frozen_string_literal: true
require "abstract_command"
module Homebrew
module DevCmd
class Rubydoc < AbstractCommand
cmd_args do
description <<~EOS
Generate Homebrew's RubyDoc documentation.
EOS
switch "--only-public",
description: "Only generate public API documentation."
switch "--open",
description: "Open generated documentation in a browser."
end
sig { override.void }
def run
Homebrew.install_bundler_gems!(groups: ["doc"])
HOMEBREW_LIBRARY_PATH.cd do
no_api_args = if args.only_public?
["--hide-api", "private", "--hide-api", "internal"]
else
[]
end
system "bundle", "exec", "yard", "doc", "--output", "doc", *no_api_args
exec_browser "file://#{HOMEBREW_LIBRARY_PATH}/doc/index.html" if args.open?
end
end
end
end
end

View File

@ -3,9 +3,14 @@
require "version" require "version"
# @private # Helper class for gathering information about development tools.
#
# @api public
class DevelopmentTools class DevelopmentTools
class << self class << self
# Locate a development tool.
#
# @api public
sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) }
def locate(tool) def locate(tool)
# Don't call tools (cc, make, strip, etc.) directly! # Don't call tools (cc, make, strip, etc.) directly!
@ -44,11 +49,17 @@ class DevelopmentTools
"Checksums will still be verified." "Checksums will still be verified."
end end
# Get the default C compiler.
#
# @api public
sig { returns(Symbol) } sig { returns(Symbol) }
def default_compiler def default_compiler
:clang :clang
end end
# Get the Clang version.
#
# @api public
sig { returns(Version) } sig { returns(Version) }
def clang_version def clang_version
@clang_version ||= if (path = locate("clang")) && @clang_version ||= if (path = locate("clang")) &&
@ -59,6 +70,9 @@ class DevelopmentTools
end end
end end
# Get the Clang build version.
#
# @api public
sig { returns(Version) } sig { returns(Version) }
def clang_build_version def clang_build_version
@clang_build_version ||= if (path = locate("clang")) && @clang_build_version ||= if (path = locate("clang")) &&
@ -70,6 +84,9 @@ class DevelopmentTools
end end
end end
# Get the LLVM Clang build version.
#
# @api public
sig { returns(Version) } sig { returns(Version) }
def llvm_clang_build_version def llvm_clang_build_version
@llvm_clang_build_version ||= begin @llvm_clang_build_version ||= begin

View File

@ -15,8 +15,6 @@ require "system_command"
module Homebrew module Homebrew
# Module containing diagnostic checks. # Module containing diagnostic checks.
#
# @api private
module Diagnostic module Diagnostic
def self.missing_deps(formulae, hide = nil) def self.missing_deps(formulae, hide = nil)
missing = {} missing = {}

Some files were not shown because too many files have changed in this diff Show More