Class: Homebrew::API::CaskStruct Private

Inherits:
T::Struct
  • Object
show all
Defined in:
api/cask_struct.rb,
sorbet/rbi/dsl/homebrew/api/cask_struct.rbi

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Constant Summary collapse

PREDICATES =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[
  :auto_updates,
  :caveats,
  :conflicts,
  :container,
  :depends_on,
  :deprecate,
  :desc,
  :disable,
  :homepage,
].freeze
ArtifactArgs =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.type_alias do
  [
    Symbol,
    T::Array[T.anything],
    T::Hash[Symbol, T.anything],
    T.nilable(T.proc.void),
  ]
end
DependsOnArgs =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.type_alias do
  T::Hash[
    # Keys are dependency types like :macos, :arch, :cask, :formula
    Symbol,
    # Values can be any of:
    T.any(
      # Strings like ">= :catalina" for :macos
      String,
      # Symbols like :intel or :arm64 for :arch
      Symbol,
      # Array of strings or symbols for :cask and :formula
      T::Array[T.any(String, Symbol)],
    ),
  ]
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_updates: false, conflicts_with_args: {}, container_args: {}, depends_on_args: {}, deprecate_args: {}, desc: nil, disable_args: {}, homepage: nil, languages: [], names: [], renames: [], ruby_source_checksum:, ruby_source_path: nil, sha256:, tap_git_head: nil, tap_string: nil, url_args: [], url_kwargs: {}, version:, raw_artifacts: [], raw_caveats: nil) ⇒ void

Parameters:



# File ''

const :auto_updates, T::Boolean, default: false
const :conflicts_with_args, T::Hash[Symbol, T::Array[String]], default: {}
const :container_args, T::Hash[Symbol, T.any(Symbol, T.anything)], default: {}
const :depends_on_args, DependsOnArgs, default: {}
const :deprecate_args, T::Hash[Symbol, T.nilable(T.any(String, Symbol))], default: {}
const :desc, T.nilable(String)
const :disable_args, T::Hash[Symbol, T.nilable(T.any(String, Symbol))], default: {}
const :homepage, T.nilable(String)
const :languages, T::Array[String], default: []
const :names, T::Array[String], default: []
const :renames, T::Array[[String, String]], default: []

const :ruby_source_path, T.nilable(String)
const :sha256, T.any(String, Symbol)
const :tap_git_head, T.nilable(String)
const :tap_string, T.nilable(String)
const :url_args, T::Array[String], default: []
const :url_kwargs, T::Hash[Symbol, T.anything], default: {}
const :version, T.any(String, Symbol)
const :raw_artifacts, T::Array[ArtifactArgs], default: []
const :raw_caveats, T.nilable(String)

Instance Attribute Details

#auto_updatesBoolean (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Changes to this struct must be mirrored in Homebrew::API::Cask.generate_cask_struct_hash

Returns:

  • (Boolean)


# File ''

const :auto_updates, T::Boolean, default: false

#conflicts_with_argsHash{Symbol => Array<String>} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop conflicts_with_args.

Returns:



# File ''

const :conflicts_with_args, T::Hash[Symbol, T::Array[String]], default: {}

#container_argsHash{Symbol => Symbol, T.anything} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop container_args.

Returns:



# File ''

const :container_args, T::Hash[Symbol, T.any(Symbol, T.anything)], default: {}

#depends_on_argsDependsOnArgs (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop depends_on_args.

Returns:



# File ''

const :depends_on_args, DependsOnArgs, default: {}

#deprecate_argsHash{Symbol => String, Symbol, nil} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop deprecate_args.

Returns:



# File ''

const :deprecate_args, T::Hash[Symbol, T.nilable(T.any(String, Symbol))], default: {}

#descString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop desc.

Returns:



# File ''

const :desc, T.nilable(String)

#disable_argsHash{Symbol => String, Symbol, nil} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop disable_args.

Returns:



# File ''

const :disable_args, T::Hash[Symbol, T.nilable(T.any(String, Symbol))], default: {}

#homepageString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop homepage.

Returns:



# File ''

const :homepage, T.nilable(String)

#languagesArray<String> (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop languages.

Returns:



# File ''

const :languages, T::Array[String], default: []

#namesArray<String> (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop names.

Returns:



# File ''

const :names, T::Array[String], default: []

#raw_artifactsArray<ArtifactArgs> (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop raw_artifacts.

Returns:



# File ''

const :raw_artifacts, T::Array[ArtifactArgs], default: []

#raw_caveatsString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop raw_caveats.

Returns:



# File ''

const :raw_caveats, T.nilable(String)

#renamesArray<Array<(String, String)>> (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop renames.

Returns:



# File ''

const :renames, T::Array[[String, String]], default: []

#ruby_source_checksumHash{Symbol => String} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop ruby_source_checksum.

Returns:



# File ''

#ruby_source_pathString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop ruby_source_path.

Returns:



# File ''

const :ruby_source_path, T.nilable(String)

#sha256String, Symbol (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop sha256.

Returns:



# File ''

const :sha256, T.any(String, Symbol)

#tap_git_headString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop tap_git_head.

Returns:



# File ''

const :tap_git_head, T.nilable(String)

#tap_stringString? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop tap_string.

Returns:



# File ''

const :tap_string, T.nilable(String)

#url_argsArray<String> (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop url_args.

Returns:



# File ''

const :url_args, T::Array[String], default: []

#url_kwargsHash{Symbol => T.anything} (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop url_kwargs.

Returns:



# File ''

const :url_kwargs, T::Hash[Symbol, T.anything], default: {}

#versionString, Symbol (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop version.

Returns:



# File ''

const :version, T.any(String, Symbol)

Class Method Details

.from_hash(cask_hash, ignore_types: false) ⇒ CaskStruct

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

  • cask_hash (Hash{String => T.untyped})
  • ignore_types (Boolean) (defaults to: false)

Returns:



8
9
10
11
12
13
14
15
# File 'api/cask_struct.rb', line 8

def self.from_hash(cask_hash, ignore_types: false)
  return super(cask_hash) if ignore_types

  cask_hash = cask_hash.transform_keys(&:to_sym)
                       .slice(*decorator.all_props)
                       .compact_blank
  new(**cask_hash)
end

Instance Method Details

#artifacts(appdir:) ⇒ Array<ArtifactArgs>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



87
88
89
# File 'api/cask_struct.rb', line 87

def artifacts(appdir:)
  deep_remove_placeholders(raw_artifacts, appdir.to_s)
end

#auto_updates?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


10
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 10

def auto_updates?; end

#caveats(appdir:) ⇒ String?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



92
93
94
# File 'api/cask_struct.rb', line 92

def caveats(appdir:)
  deep_remove_placeholders(raw_caveats, appdir.to_s)
end

#caveats?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


13
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 13

def caveats?; end

#conflicts?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


16
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 16

def conflicts?; end

#container?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


19
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 19

def container?; end

#depends_on?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


22
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 22

def depends_on?; end

#deprecate?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


25
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 25

def deprecate?; end

#desc?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


28
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 28

def desc?; end

#disable?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


31
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 31

def disable?; end

#homepage?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


34
# File 'sorbet/rbi/dsl/homebrew/api/cask_struct.rbi', line 34

def homepage?; end