Class: Homebrew::DevCmd::Bump Private
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- Homebrew::DevCmd::Bump
- Defined in:
- dev-cmd/bump.rb,
sorbet/rbi/dsl/homebrew/dev_cmd/bump.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.
Defined Under Namespace
Classes: Args, ResourceVersionInfo, VersionBumpInfo
Constant Summary collapse
- MIN_RELEASE_AGE_DAYS =
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.
1- DEFAULT_CURL_ARGS =
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.let([ "--compressed", "--fail-with-body", "--location", "--max-redirs", "5", "--silent", ].freeze, T::Array[String])
- DEFAULT_CURL_OPTIONS =
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.let({ connect_timeout: 15, max_time: 55, timeout: 60, retries: 0, }.freeze, T::Hash[Symbol, T.untyped])
- PYPI_UNSTABLE_VERSION_REGEX =
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.
/^(?:\d+!)?\d+(?:\.\d+)*(?:a|b|rc)\d+|\.dev\d+$/i- LIVECHECK_MESSAGE_REGEX =
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.
/^(?:error:|skipped|unable to get(?: throttled)? versions)/i- NEWER_THAN_UPSTREAM_MSG =
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.
" (newer than upstream)"
Instance Method Summary collapse
- #args ⇒ Homebrew::DevCmd::Bump::Args private
- #run ⇒ void private
Methods inherited from AbstractCommand
command, command_name, dev_cmd?, #initialize, parser, ruby_cmd?
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
Constructor Details
This class inherits a constructor from Homebrew::AbstractCommand
Instance Method Details
#args ⇒ Homebrew::DevCmd::Bump::Args
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.
10 |
# File 'sorbet/rbi/dsl/homebrew/dev_cmd/bump.rbi', line 10 def args; end |
#run ⇒ 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.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'dev-cmd/bump.rb', line 103 def run Homebrew.install_bundler_gems!(groups: ["livecheck"]) Homebrew.with_no_api_env do eval_all = args.eval_all? excluded_autobump = [] if args.no_autobump? && eval_all excluded_autobump.concat(autobumped_formulae_or_casks(CoreTap.instance)) if args.formula? excluded_autobump.concat(autobumped_formulae_or_casks(CoreCaskTap.instance, casks: true)) if args.cask? end formulae_and_casks = if args.auto? raise UsageError, "`--formula` or `--cask` must be passed with `--auto`." if !args.formula? && !args.cask? tap_arg = args.tap raise UsageError, "`--tap=` must be passed with `--auto`." if tap_arg.blank? tap = Tap.fetch(tap_arg) autobump_list = tap.autobump what = args.cask? ? "casks" : "formulae" raise UsageError, "No autobumped #{what} found." if autobump_list.blank? # Only run bump on the first formula in each synced group if args.bump_synced? && args.formula? synced_formulae = Set.new(tap.synced_versions_formulae.flat_map { it.drop(1) }) end autobump_list.filter_map do |name| qualified_name = "#{tap.name}/#{name}" next Cask::CaskLoader.load(qualified_name) if args.cask? next if synced_formulae&.include?(name) Formulary.factory(qualified_name) end elsif args.tap tap = Tap.fetch(args.tap) raise UsageError, "`--tap` requires `--auto` for official taps." if tap.official? formulae = args.cask? ? [] : tap.formula_files.map { |path| Formulary.factory(path) } casks = args.formula? ? [] : tap.cask_files.map { |path| Cask::CaskLoader.load(path) } formulae + casks elsif args.installed? formulae = args.cask? ? [] : Formula.installed casks = args.formula? ? [] : Cask::Caskroom.casks formulae + casks elsif args.named.present? T.cast(args.named.to_formulae_and_casks_with_taps, T::Array[T.any(Formula, Cask::Cask)]) elsif eval_all formulae = args.cask? ? [] : Formula.all(eval_all:) casks = args.formula? ? [] : Cask::Cask.all(eval_all:) formulae + casks else raise UsageError, "`brew bump` without named arguments needs `--installed` or `--eval-all` passed or " \ "`HOMEBREW_EVAL_ALL=1` set!" end if (start_with = args.start_with) formulae_and_casks.select! do |formula_or_cask| name = formula_or_cask.is_a?(Cask::Cask) ? formula_or_cask.token : formula_or_cask.name name.start_with?(start_with) end end formulae_and_casks = formulae_and_casks.sort_by do |formula_or_cask| formula_or_cask.is_a?(Cask::Cask) ? formula_or_cask.token : formula_or_cask.name end formulae_and_casks -= excluded_autobump if args.repology? && !Utils::Curl.curl_supports_tls13? begin Formula["curl"].ensure_installed!(reason: "Repology queries") unless HOMEBREW_BREWED_CURL_PATH.exist? rescue FormulaUnavailableError opoo "A newer `curl` is required for Repology queries." end end handle_formulae_and_casks(formulae_and_casks) end end |