57 Commits

Author SHA1 Message Date
Sam Ford
8ce6059544
Gnu: Update generated URL to use HTTPS 2021-10-21 09:28:54 -04:00
Sam Ford
e709917cd5
Apache: Extend URL_MATCH_REGEX
Some Apache URLs use a `filename` query string parameter instead of
`path` and the `Apache` strategy isn't applied. The parameter value
is the same as `path` (i.e., a path to a file), so this updates the
strategy's `URL_MATCH_REGEX` to handle this URL format as well.
2021-10-20 10:52:49 -04:00
Bo Anderson
a01bb6b194
brew style --fix 2021-09-23 01:10:14 +01:00
Sam Ford
e65c9d02ab
PageMatch: Expand #find_versions tests 2021-08-19 16:07:53 -04:00
Sam Ford
26821301e7
livecheck: move url/regex generation into methods 2021-08-17 18:03:40 -04:00
Sam Ford
13b349b4ae
Refactor #find_versions parameters in strategies 2021-08-16 12:01:32 -04:00
Sam Ford
7e07010f06
Improve standardization of strategy tests 2021-08-11 19:05:59 -04:00
Sam Ford
56dd89114d
Standardize valid strategy block return types
Valid `strategy` block return types currently vary between
strategies. Some only accept a string whereas others accept a string
or array of strings. [`strategy` blocks also accept a `nil` return
(to simplify early returns) but this was already standardized across
strategies.]

While some strategies only identify one version by default (where a
string is an appropriate return type), it could be that a strategy
block identifies more than one version. In this situation, the
strategy would need to be modified to accept (and work with) an
array from a `strategy` block.

Rather than waiting for this to become a problem, this modifies all
strategies to standardize on allowing `strategy` blocks to return a
string or array of strings (even if only one of these is currently
used in practice). Standardizing valid return types helps to further
simplify the mental model for `strategy` blocks and reduce cognitive
load.

This commit extracts related logic from `#find_versions` into
methods like `#versions_from_content`, which is conceptually similar
to `PageMatch#page_matches` (renamed to `#versions_from_content`
for consistency). This allows us to write tests for the related code
without having to make network requests (or stub them) at this point.
In general, this also helps to better align the structure of
strategies and how the various `#find_versions` methods work with
versions.

There's still more planned work to be done here but this is a step
in the right direction.
2021-08-11 19:05:57 -04:00
Sam Ford
a970780851
livecheck: allow nil return from strategy blocks 2021-08-02 18:33:34 -04:00
Sam Ford
ddde0f7589
livecheck: allow inheriting from a formula/cask 2021-08-02 09:12:22 -04:00
Markus Reiter
a210b1a04e
Add extract_plist strategy. 2021-04-07 04:58:31 +02:00
nandahkrishna
15102a3234
livecheck/strategy/electron_builder: address changes from review
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2021-03-22 12:52:43 +05:30
nandahkrishna
f422b6cdc4
livecheck/strategy: add ElectronBuilder strategy 2021-03-20 15:23:09 +05:30
Issy Long
dfebf71e26
test/livecheck/skip_conditions_spec: Even better context wording
Co-authored-by: Nanda H. Krishna <nanda.harishankar@gmail.com>
2021-02-20 13:22:47 +00:00
Issy Long
e1ad07190e
rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Bo Anderson
323ff660fa rubocop: use consistent array/hash indentation 2021-02-11 13:27:42 +00:00
Sam Ford
703d59b521
livecheck: check stable before head by default 2021-02-04 15:44:09 -05:00
Seeker
feb45f1ce9 livecheck_version: add tests 2021-01-22 12:25:30 -08:00
Sam Ford
7bbd091fb1
Livecheck: Use let instead of constants in tests 2021-01-13 09:35:56 -05:00
Sam Ford
6c4041c026
Livecheck: Do not convert URL symbol to string 2021-01-13 09:35:54 -05:00
Sam Ford
12e5f4dce1
Livecheck: Refactor #skip_conditions into a module
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-01-12 18:34:33 -05:00
Sam Ford
aae91cacae
Livecheck: Skip Internet Archive stable URLs 2021-01-12 18:04:26 -05:00
Sam Ford
f36d1a7fb6
Livecheck: Skip Google Code Archive stable URLs 2021-01-12 18:04:26 -05:00
Sam Ford
84e058f6ca
Livecheck: Refactor memoized helpers 2021-01-12 18:04:26 -05:00
Dario Vladovic
86fee106a3
livecheck: strengthen URL patterns 2020-12-31 09:14:53 -05:00
Sam Ford
d7fa400930
Livecheck: Surface cached status in debug output 2020-12-24 22:19:14 -05:00
Sam Ford
5c9f5b9506
Xorg: Use PageMatch#find_versions 2020-12-24 11:15:55 -05:00
Sam Ford
12afb272bb
Strategy: Manually handle redirections 2020-12-23 00:35:27 -05:00
Sam Ford
99ea95c28d
Sparkle: Expand tests 2020-12-20 01:56:54 -05:00
Sam Ford
732e67d5db
Expand livecheck/livecheck tests 2020-12-19 23:45:26 -05:00
Sam Ford
3261bbc0bd
Reorganize livecheck/livecheck test variables 2020-12-19 22:26:37 -05:00
Sam Ford
6bcb0fd4b8
HeaderMatch: Add test 2020-12-19 19:34:26 -05:00
Sam Ford
740d5d3bcd
Sparkle: Add test 2020-12-19 19:34:26 -05:00
Mike McQuaid
4dfcf74fb2
Merge pull request #9478 from MikeMcQuaid/deprecate-disable-date
formula: deprecate!/disable!: deprecate missing or non-ISO 8601 dates.
2020-12-18 12:15:51 +00:00
Markus Reiter
f711352cfd Add audit for livecheck in casks. 2020-12-14 15:44:35 +01:00
Markus Reiter
3bde9d34a9
Remove version from Livecheck. 2020-12-12 17:43:25 -05:00
Seeker
6794a78087
livecheck: add support for casks 2020-12-12 17:43:21 -05:00
Sam Ford
5b770e9965
Cpan: Reimplement strategy and improve tests
Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-12-11 17:45:03 -05:00
Dario Vladovic
1f30f27c2d
livecheck: CPAN strategy 2020-12-11 17:43:09 -05:00
Mike McQuaid
f87ce3fffb
formula: deprecate!/disable!: deprecate missing or non-ISO 8601 dates.
As requested in https://github.com/Homebrew/homebrew-core/issues/66360
2020-12-11 14:03:21 +00:00
Sam Ford
e37da96341
GithubLatest: Align test URL with example 2020-12-05 11:40:08 -05:00
nandahkrishna
d173b57c42
github_latest: modify strategy and tests 2020-12-05 20:37:28 +05:30
nandahkrishna
f96b8e7138
livecheck: add GithubLatest strategy 2020-12-05 20:37:27 +05:30
Sam Ford
5a007a4ec6
livecheck: expand #preprocess_url tests more 2020-11-26 13:34:16 -05:00
Sam Ford
1f40d84ab1
livecheck: expand #preprocess_url tests 2020-11-26 09:50:00 -05:00
Mike McQuaid
a83336db02
Merge pull request #9105 from samford/expand-livecheck-preprocess_url-tests
Expand Livecheck#preprocess_url tests
2020-11-16 12:54:05 +00:00
Sam Ford
e40932e261
livecheck: skip disabled formulae 2020-11-11 17:03:51 -05:00
Sam Ford
e5a8574332
Expand Livecheck#preprocess_url tests 2020-11-11 11:52:58 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
2e5272d04c Deprecate/disable code for Homebrew 2.5.0.
Do the usual "disable deprecations" and "uncomment pending deprecations"
dance and delete/deprecate/disable relevant/related code.
2020-09-03 10:34:22 +01:00