Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in REXML gem as it doesn't ship with Ruby 3 #16150

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Library/Homebrew/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ group :typecheck, optional: true do
gem "tapioca", require: false
end

# shared gems (used by multiple groups)
group :audit, :bump_unversioned_casks, :livecheck, optional: true do
gem "rexml", require: false
end

# vendored gems (no group)
gem "activesupport"
gem "addressable"
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ DEPENDENCIES
patchelf
plist
pry
rexml
ronn
rspec
rspec-github
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
return
end

gem_groups = ["audit"]

Check warning on line 156 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L156

Added line #L156 was not covered by tests
gem_groups << "style" unless skip_style
Homebrew.install_bundler_gems!(groups: gem_groups)

Check warning on line 158 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L158

Added line #L158 was not covered by tests

style_files = args.named.to_paths unless skip_style

only_cops = args.only_cops
Expand Down
5 changes: 4 additions & 1 deletion Library/Homebrew/dev-cmd/bump-cask-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@
# odeprecated "brew bump-cask-pr --online" if args.online?
# This will be run by `brew audit` or `brew style` later so run it first to
# not start spamming during normal output.
Homebrew.install_bundler_gems!(groups: ["style"]) if !args.no_audit? || !args.no_style?
gem_groups = []

Check warning on line 73 in Library/Homebrew/dev-cmd/bump-cask-pr.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump-cask-pr.rb#L73

Added line #L73 was not covered by tests
gem_groups << "style" if !args.no_audit? || !args.no_style?
gem_groups << "audit" unless args.no_audit?
Homebrew.install_bundler_gems!(groups: gem_groups) unless gem_groups.empty?

# As this command is simplifying user-run commands then let's just use a
# user path, too.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/bump-formula-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def bump_formula_pr

# This will be run by `brew audit` later so run it first to not start
# spamming during normal output.
Homebrew.install_bundler_gems!(groups: ["style"]) unless args.no_audit?
Homebrew.install_bundler_gems!(groups: ["audit", "style"]) unless args.no_audit?

tap_remote_repo = formula.tap.full_name || formula.tap.remote_repo
remote = "origin"
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/dev-cmd/bump-unversioned-casks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
def self.bump_unversioned_casks
args = bump_unversioned_casks_args.parse

Homebrew.install_bundler_gems!(groups: ["bump_unversioned_casks"])

Check warning on line 36 in Library/Homebrew/dev-cmd/bump-unversioned-casks.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump-unversioned-casks.rb#L36

Added line #L36 was not covered by tests

state_file = if args.state_file.present?
Pathname(args.state_file).expand_path
else
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
def livecheck
args = livecheck_args.parse

Homebrew.install_bundler_gems!(groups: ["livecheck"]) if args.json?
Homebrew.install_bundler_gems!(groups: ["livecheck"])

Check warning on line 69 in Library/Homebrew/dev-cmd/livecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/livecheck.rb#L69

Added line #L69 was not covered by tests

all = args.eval_all?

Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/livecheck/strategy/sparkle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def self.match?(url)
# @return [Item, nil]
sig { params(content: String).returns(T::Array[Item]) }
def self.items_from_content(content)
require "rexml/document"
xml = Xml.parse_xml(content)
return [] if xml.blank?

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/livecheck/strategy/xml.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# typed: true
# frozen_string_literal: true

require "rexml/document"

module Homebrew
module Livecheck
module Strategy
Expand Down