Class: Homebrew::Cmd::Bundle::SubcommandContext Private
- Defined in:
- bundle/subcommand_context.rb
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.
Instance Attribute Summary collapse
-
#extensions ⇒ Array<T.class_of(Homebrew::Bundle::Extension)>
readonly
private
Returns the value of prop
extensions. -
#file ⇒ String?
readonly
private
Returns the value of prop
file. -
#force ⇒ Boolean
readonly
private
Returns the value of prop
force. -
#global ⇒ Boolean
readonly
private
Returns the value of prop
global. -
#jobs ⇒ Integer
readonly
private
Returns the value of prop
jobs. -
#no_type_args ⇒ Boolean
readonly
private
Returns the value of prop
no_type_args. -
#no_upgrade ⇒ Boolean
readonly
private
Returns the value of prop
no_upgrade. -
#subcommand ⇒ String
readonly
private
Returns the value of prop
subcommand. -
#verbose ⇒ Boolean
readonly
private
Returns the value of prop
verbose. -
#zap ⇒ Boolean
readonly
private
Returns the value of prop
zap.
Instance Method Summary collapse
- #extension_dump_disabled?(args, extension) ⇒ Boolean private
- #extension_selected?(args, extension) ⇒ Boolean private
- #initialize(subcommand:, global:, file: nil, no_upgrade:, verbose:, force:, jobs:, zap:, no_type_args:, extensions:) ⇒ void constructor
- #selected_types(args) ⇒ Array<Symbol> private
Constructor Details
#initialize(subcommand:, global:, file: nil, no_upgrade:, verbose:, force:, jobs:, zap:, no_type_args:, extensions:) ⇒ void
|
|
# File '' const :subcommand, String const :global, T::Boolean const :file, T.nilable(String) const :no_upgrade, T::Boolean const :verbose, T::Boolean const :force, T::Boolean const :jobs, Integer const :zap, T::Boolean const :no_type_args, T::Boolean const :extensions, T::Array[T.class_of(Homebrew::Bundle::Extension)] |
Instance Attribute Details
#extensions ⇒ Array<T.class_of(Homebrew::Bundle::Extension)> (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 extensions.
|
|
# File '' const :extensions, T::Array[T.class_of(Homebrew::Bundle::Extension)] |
#file ⇒ 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 file.
|
|
# File '' const :file, T.nilable(String) |
#force ⇒ Boolean (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 force.
|
|
# File '' const :force, T::Boolean |
#global ⇒ Boolean (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 global.
|
|
# File '' const :global, T::Boolean |
#jobs ⇒ Integer (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 jobs.
|
|
# File '' const :jobs, Integer |
#no_type_args ⇒ Boolean (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 no_type_args.
|
|
# File '' const :no_type_args, T::Boolean |
#no_upgrade ⇒ Boolean (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 no_upgrade.
|
|
# File '' const :no_upgrade, T::Boolean |
#subcommand ⇒ 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 subcommand.
|
|
# File '' const :subcommand, String |
#verbose ⇒ Boolean (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 verbose.
|
|
# File '' const :verbose, T::Boolean |
#zap ⇒ Boolean (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 zap.
|
|
# File '' const :zap, T::Boolean |
Instance Method Details
#extension_dump_disabled?(args, extension) ⇒ 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.
28 29 30 |
# File 'bundle/subcommand_context.rb', line 28 def extension_dump_disabled?(args, extension) args.public_send(extension.dump_disable_predicate_method) end |
#extension_selected?(args, extension) ⇒ 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.
23 24 25 |
# File 'bundle/subcommand_context.rb', line 23 def extension_selected?(args, extension) args.public_send(extension.predicate_method) end |
#selected_types(args) ⇒ Array<Symbol>
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.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'bundle/subcommand_context.rb', line 33 def selected_types(args) # We intentionally omit the s from `brews`, `casks`, and `taps` for ease of handling later. type_hash = { brew: args.formulae?, cask: args.casks?, tap: args.taps?, } extensions.each do |extension| type_hash[extension.type] = extension_selected?(args, extension) end type_hash[:none] = no_type_args type_hash.select { |_, v| v }.keys end |