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
- .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
- .fetchable_name(name, options = {}, no_upgrade: false) ⇒ String? private
- .inherited(subclass) ⇒ void private
- .install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) ⇒ Boolean abstract 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
.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.
90 91 92 |
# File 'bundle/package_type.rb', line 90 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.
95 |
# File 'bundle/package_type.rb', line 95 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.
98 99 100 101 102 103 |
# File 'bundle/package_type.rb', line 98 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 |
.fetchable_name(name, options = {}, no_upgrade: 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.
49 50 51 52 53 54 55 |
# File 'bundle/package_type.rb', line 49 def self.fetchable_name(name, = {}, no_upgrade: false) _ = name _ = _ = no_upgrade nil 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.
80 |
# File 'bundle/package_type.rb', line 80 def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **); 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.
68 |
# File 'bundle/package_type.rb', line 68 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.
58 |
# File 'bundle/package_type.rb', line 58 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.
132 133 134 135 136 137 138 139 140 |
# File 'bundle/package_type.rb', line 132 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.
106 107 108 109 110 111 112 113 |
# File 'bundle/package_type.rb', line 106 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.
116 117 118 119 120 121 122 123 |
# File 'bundle/package_type.rb', line 116 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.
160 161 162 163 164 165 166 167 168 |
# File 'bundle/package_type.rb', line 160 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.
143 144 145 |
# File 'bundle/package_type.rb', line 143 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.
126 127 128 129 |
# File 'bundle/package_type.rb', line 126 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.
148 149 150 |
# File 'bundle/package_type.rb', line 148 def installed_and_up_to_date?(_pkg, no_upgrade: false) raise NotImplementedError end |