At the moment, `#use_homebrew_curl?` can only be true for a `homepage` or `stable`/cask `url` with `using: :homebrew_curl`. If the checked URL differs from these URLs, livecheck won't use brewed curl. This limitation prevents livecheck from using brewed curl for a `livecheck` block URL that's a string literal (not a symbol for a `#checkable_url` like `:stable`, `:head`, `:url`). `libzip` was the original formula referenced in the related brew issue and it meets this criterion, so it doesn't appear to be handled by the existing `#use_homebrew_curl?` implementation. Additionally, the existing behavior can cause livecheck to unnecessarily use brewed curl for a completely different website (e.g., `cubelib`, `otf2`). For example, if the `stable` URL has `using: :homebrew_curl` and the `livecheck` block has `url :homepage`, livecheck will use brewed curl when checking the `homepage`. If these are completely different domains/servers, it's unlikely that we would need to use brewed curl when checking the `homepage`, so this particular behavior may not be beneficial. This commit reimplements `use_homebrew_curl?` to apply brewed curl when the checked URL's root domain is the same as the root domain of an aforementioned formula/cask URL with `using: :homebrew_curl`. For example, this looser approach would allow a `livecheck` block checking `https://www.example.com/downloads/` to use brewed curl if the `stable` URL was `https://downloads.example.com/example.zip` with `using: :homebrew_curl`. These could be different servers but, based on related formulae, this looseness is necessary for the moment. This approach aims to resolve both issues, allowing brewed curl to be applied to a slightly broader range of URLs (i.e., not limited to just the `#checkable_urls`) while also helping to avoid unnecessarily applying brewed curl when it's less likely to be useful (completely different domains). Neither approach is perfect but this one may be more useful in the interim time. Depending on how this looser approach works in practice, we may want to consider returning to a stricter approach once we have something like `using: :homebrew_curl` in `livecheck` blocks (this is forthcoming). Being explicit in a `livecheck` block is the most reliable approach (i.e., only use brewed curl when needed), so we could favor that and pare down the automated approach to only what's needed to support implicit checks (i.e., with no `livecheck` block). Of course, it's also possible to drop the automated approach entirely and simply require a `livecheck` block in this scenario but we can decide on how to handle this when the time comes.
49 lines
1.3 KiB
Ruby
49 lines
1.3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
source "https://rubygems.org"
|
|
|
|
# disallowed gems (should not be used)
|
|
# * nokogiri - use rexml instead for XML parsing
|
|
|
|
# installed gems (should all be require: false)
|
|
gem "addressable", require: false
|
|
gem "bootsnap", require: false
|
|
gem "byebug", require: false
|
|
gem "json_schemer", require: false
|
|
gem "minitest", require: false
|
|
gem "parallel_tests", require: false
|
|
gem "ronn", require: false
|
|
gem "rspec", require: false
|
|
gem "rspec-github", require: false
|
|
gem "rspec-its", require: false
|
|
gem "rspec_junit_formatter", require: false
|
|
gem "rspec-retry", require: false
|
|
gem "rspec-wait", require: false
|
|
gem "rubocop", require: false
|
|
gem "rubocop-ast", require: false
|
|
gem "simplecov", require: false
|
|
gem "simplecov-cobertura", require: false
|
|
gem "warning", require: false
|
|
|
|
group :sorbet, optional: true do
|
|
gem "parlour", require: false
|
|
gem "rspec-sorbet", require: false
|
|
gem "sorbet", require: false
|
|
gem "sorbet-runtime", require: false
|
|
gem "tapioca", require: false
|
|
end
|
|
|
|
# vendored gems
|
|
gem "activesupport", "< 7" # 7 requires Ruby 2.7
|
|
gem "concurrent-ruby"
|
|
gem "did_you_mean" # remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
|
|
gem "mechanize"
|
|
gem "patchelf"
|
|
gem "plist"
|
|
gem "rubocop-performance"
|
|
gem "rubocop-rails"
|
|
gem "rubocop-rspec"
|
|
gem "rubocop-sorbet"
|
|
gem "ruby-macho"
|
|
gem "sorbet-runtime-stub"
|