-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Replace Nokogiri with REXML #11610
Replace Nokogiri with REXML #11610
Conversation
Review period will end on 2021-06-29 at 00:10:57 UTC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here! May be worth considering a brew style
check (in a follow-up PR) that ensures there's no require "nokogiri"
usage in Homebrew/brew.
Review period ended. |
If we don't have any intention to keep If we were to drop it from the |
Yes, I think it can/should be dropped from the |
Certainly understandable to me. Last question: would we want the
I'll try to tinker with this when I get a chance but, at the moment, there's some important livecheck work that I would like to focus on wrapping up into a PR first. |
Up to you!
👍🏻 thanks for all your work here and on livecheck! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This is a follow-up to #11599, where I said I would replace use of
nokogiri
for XML parsing withrexml
in parts of brew outside of theSparkle
livecheck strategy. These changes are generally a straightforward shift fromnokogiri
methods torexml
methods.One notable difference is that
rexml
requires you to access attribute values using square bracket syntax instead of a method (like#attr
innokogiri
).rexml
has an#attribute
method but it returns the full attribute (e.g.,a="b"
). We can't use a safe navigation operator in this context, so it was necessary to create an intermediate variable to be able to guard againstnil
values.If we had more code doing this, I would say that we could probably just extend
rexml
to add anattr
method that's just a wrapper for the square bracket syntax. This would allow us to use the safe navigation operator but I'm not sure if it's worth deviating fromrexml
's established API.I'm not familiar with the
BundleVersion
andUnversionedCaskChecker
classes but I've tried to exercise this using livecheck'sExtractPlist
andSparkle
strategies, which use one or both of these classes. The output from checking casks that use these strategies was the same with and without these changes.The other area where
UnversionedCaskChecker
is used is in thebrew bump-unversioned-casks
dev-cmd. I let this run for a few casks and it seemed to work as expected. I don't anticipate this introducing any issues but it wouldn't hurt for some homebrew/cask folks to test this out, as I'm not as knowledgeable about that side of Homebrew.