Class: Homebrew::Bundle::PackageType Abstract Private
- Extended by:
- T::Helpers
- Defined in:
- bundle/package_type.rb
Overview
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.
It cannot be directly instantiated. Subclasses must implement the abstract methods below.
Class Method Summary collapse
- .batch_installable?(_name, _options = {}) ⇒ Boolean private
- .check(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ Array<String> private
- .check_label ⇒ String abstract private
- .dump ⇒ String abstract private
- .dump_output(describe: false, no_restart: false) ⇒ String private
- .dump_supported? ⇒ Boolean private
- .inherited(subclass) ⇒ void private
- .install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) ⇒ Boolean abstract private
- .install_batch!(_entries, verbose: false) ⇒ Boolean private
- .install_supported? ⇒ Boolean private
- .install_verb(_name = "", _options = {}) ⇒ String private
- .preinstall!(name, no_upgrade: false, verbose: false, **options) ⇒ Boolean abstract private
- .reset! ⇒ void abstract private
- .type ⇒ Symbol abstract private
Instance Method Summary collapse
- #checkable_entries(all_entries) ⇒ Array<Dsl::Entry> private
- #exit_early_check(packages, no_upgrade:) ⇒ Array<String> private
- #failure_reason(name, no_upgrade:) ⇒ String private
- #find_actionable(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ Array<String> private
- #format_checkable(entries) ⇒ Array<Object> private
- #full_check(packages, no_upgrade:) ⇒ Array<String> private
- #installed_and_up_to_date?(_pkg, no_upgrade: false) ⇒ Boolean private
Class Method Details
.batch_installable?(_name, _options = {}) ⇒ 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.
43 44 45 |
# File 'bundle/package_type.rb', line 43 def self.batch_installable?(_name, = {}) false end |
.check(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ Array<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.
87 88 89 |
# File 'bundle/package_type.rb', line 87 def self.check(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) new.find_actionable(entries, exit_on_first_error:, no_upgrade:, verbose:) end |
.check_label ⇒ 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.
25 |
# File 'bundle/package_type.rb', line 25 def self.check_label; end |
.dump ⇒ 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.
92 |
# File 'bundle/package_type.rb', line 92 def self.dump; end |
.dump_output(describe: false, no_restart: false) ⇒ 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.
95 96 97 98 99 100 |
# File 'bundle/package_type.rb', line 95 def self.dump_output(describe: false, no_restart: false) _ = describe _ = no_restart dump end |
.dump_supported? ⇒ 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/package_type.rb', line 28 def self.dump_supported? true end |
.inherited(subclass) ⇒ void
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.
This method returns an undefined value.
14 15 16 17 18 19 |
# File 'bundle/package_type.rb', line 14 def self.inherited(subclass) super return if subclass.name == "Homebrew::Bundle::Extension" Homebrew::Bundle.register_package_type(subclass) end |
.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) ⇒ 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.
77 |
# File 'bundle/package_type.rb', line 77 def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **); end |
.install_batch!(_entries, verbose: false) ⇒ 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.
48 49 50 51 52 |
# File 'bundle/package_type.rb', line 48 def self.install_batch!(_entries, verbose: false) _ = verbose raise NotImplementedError end |
.install_supported? ⇒ 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.
33 34 35 |
# File 'bundle/package_type.rb', line 33 def self.install_supported? true end |
.install_verb(_name = "", _options = {}) ⇒ 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.
38 39 40 |
# File 'bundle/package_type.rb', line 38 def self.install_verb(_name = "", = {}) "Installing" end |
.preinstall!(name, no_upgrade: false, verbose: false, **options) ⇒ 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.
65 |
# File 'bundle/package_type.rb', line 65 def self.preinstall!(name, no_upgrade: false, verbose: false, **); end |
.reset! ⇒ void
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.
This method returns an undefined value.
55 |
# File 'bundle/package_type.rb', line 55 def self.reset!; end |
.type ⇒ 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.
22 |
# File 'bundle/package_type.rb', line 22 def self.type; end |
Instance Method Details
#checkable_entries(all_entries) ⇒ Array<Dsl::Entry>
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.
129 130 131 132 133 134 135 136 137 |
# File 'bundle/package_type.rb', line 129 def checkable_entries(all_entries) require "bundle/skipper" all_entries.filter_map do |entry| next if entry.type != self.class.type next if Bundle::Skipper.skip?(entry) entry end end |
#exit_early_check(packages, no_upgrade:) ⇒ Array<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.
103 104 105 106 107 108 109 110 |
# File 'bundle/package_type.rb', line 103 def exit_early_check(packages, no_upgrade:) packages.each do |pkg| next if installed_and_up_to_date?(pkg, no_upgrade:) return [failure_reason(pkg, no_upgrade:)] end [] end |
#failure_reason(name, no_upgrade:) ⇒ 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.
113 114 115 116 117 118 119 120 |
# File 'bundle/package_type.rb', line 113 def failure_reason(name, no_upgrade:) reason = if no_upgrade && Bundle.upgrade_formulae.exclude?(name) "needs to be installed." else "needs to be installed or updated." end "#{self.class.check_label} #{name} #{reason}" end |
#find_actionable(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ Array<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.
157 158 159 160 161 162 163 164 165 |
# File 'bundle/package_type.rb', line 157 def find_actionable(entries, exit_on_first_error: false, no_upgrade: false, verbose: false) requested = format_checkable(entries) if exit_on_first_error exit_early_check(requested, no_upgrade:) else full_check(requested, no_upgrade:) end end |
#format_checkable(entries) ⇒ Array<Object>
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.
140 141 142 |
# File 'bundle/package_type.rb', line 140 def format_checkable(entries) checkable_entries(entries).map(&:name) end |
#full_check(packages, no_upgrade:) ⇒ Array<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.
123 124 125 126 |
# File 'bundle/package_type.rb', line 123 def full_check(packages, no_upgrade:) packages.reject { |pkg| installed_and_up_to_date?(pkg, no_upgrade:) } .map { |pkg| failure_reason(pkg, no_upgrade:) } end |
#installed_and_up_to_date?(_pkg, no_upgrade: false) ⇒ 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.
145 146 147 |
# File 'bundle/package_type.rb', line 145 def installed_and_up_to_date?(_pkg, no_upgrade: false) raise NotImplementedError end |