435 Commits

Author SHA1 Message Date
Sam Ford
308390ba5b
Address feedback and expand documentation
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com>
2021-01-11 17:51:41 -05:00
Markus Reiter
21e543d4e0 Only select Sparkle items for macOS. 2021-01-10 19:58:44 +01:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Markus Reiter
41a8fa4efc
Merge pull request #10235 from reitermarkus/livecheck-header
Don't preprocess URL for `:header_match` strategy.
2021-01-07 15:01:31 +01:00
Markus Reiter
52daccb365 Don't preprocess URL for :header_match strategy. 2021-01-06 12:34:30 +01:00
Seeker
790d807b97 livecheck: enable Sorbet type checking 2021-01-05 14:16:54 -08:00
Sam Ford
2060f13de1
Refactor livecheck strategies around match regex 2020-12-31 09:18:36 -05:00
Dario Vladovic
86fee106a3
livecheck: strengthen URL patterns 2020-12-31 09:14:53 -05:00
Sam Ford
8ab6922f8c
Merge pull request #10128 from samford/livecheck-extend-strategy-block-support
Livecheck: Extend strategy block support
2020-12-28 12:25:32 -05:00
Sam Ford
fef4512b35
Livecheck: Pass regex into strategy blocks 2020-12-25 20:31:37 -05:00
Sam Ford
361743e1fb
Livecheck: Extend strategy block support 2020-12-25 20:31:36 -05:00
Sam Ford
d7fa400930
Livecheck: Surface cached status in debug output 2020-12-24 22:19:14 -05:00
Sam Ford
8b5e334be4
PageMatch: Require provided_content to be a string 2020-12-24 21:49:30 -05:00
Sam Ford
eedd108ace
PageMatch: Return fetched content in match_data
If we want caching to work in the `Xorg` strategy, it's necessary to
pass fetched content back in the `match_data` hash.
2020-12-24 21:48:31 -05:00
Sam Ford
88843d2e43
Livecheck: Fix final url spacing in debug output 2020-12-24 15:00:57 -05:00
Sam Ford
ea259da9c7
Livecheck: Demodulize PageMatch name in calls
Co-authored-by: Markus Reiter <me@reitermark.us>
2020-12-24 11:15:57 -05:00
Sam Ford
5c9f5b9506
Xorg: Use PageMatch#find_versions 2020-12-24 11:15:55 -05:00
Markus Reiter
bf7efb369c Fix Sparkle strategy. 2020-12-24 03:33:14 +01:00
Sam Ford
12afb272bb
Strategy: Manually handle redirections 2020-12-23 00:35:27 -05:00
Markus Reiter
53ef74f674
Merge pull request #10068 from reitermarkus/bitbucket-strategy
Use more exact regex for `Bitbucket` strategy.
2020-12-22 18:21:11 +01:00
Sam Ford
466e55c6ab
Bitbucket: Format regex like other strategies 2020-12-20 18:13:51 -05:00
Sam Ford
21b1888388
Bitbucket: Anchor start of regex with protocol 2020-12-20 16:00:08 -05:00
Sam Ford
ac459f8e76
Strategy: Temporarily remove response caching
The simple approach here caches all header or body content from
responses, so memory usage continually grows with each fetch. This
becomes more of a notable issue with long livecheck runs (e.g.,
`--tap homebrew/core`).

Instead, we should only cache the header/body for URLs that we know
will be fetched more than once in a given run. Being able to
determine which URLs will be fetched more than once requires
structural changes within livecheck strategies, so this will take a
bit of work to implement.

I've been working on this off and on and I'll introduce a more
sophisticated method of livecheck-wide caching in a later PR. In the
interim time, it's best to remove this caching behavior until I've
finished working on an approach that provides benefits (reducing
duplicate fetches) while minimizing detriments (increased memory
usage).
2020-12-20 12:42:51 -05:00
Sam Ford
99ea95c28d
Sparkle: Expand tests 2020-12-20 01:56:54 -05:00
Sam Ford
c6c303acfe
Sparkle: Rename contents to content 2020-12-20 00:23:22 -05:00
Markus Reiter
91ee5e0a65 Simplify assignment of curl result. 2020-12-20 02:23:30 +01:00
Sam Ford
f299d3ea6e
Strategy#page_headers: Disable debug in curl 2020-12-19 19:34:28 -05:00
Sam Ford
3933b866b6
Sparkle: Align with PageMatch
This inlines the `PRIORITY` and `#match?` logic from `PageMatch`
into `Sparkle` instead of subclassing `PageMatch`. `Sparkle` doesn't
really make sense as a subclass of `PageMatch` (since it functions
in a completely different manner), so it's better to simply copy
over these parts of `PageMatch`. This also helps to separate the
strategies, so any changes to `PRIORITY` or `#match?` in `PageMatch`
won't affect `Sparkle`.
2020-12-19 19:34:28 -05:00
Sam Ford
cc5cd4bf59
HeaderMatch: Align with PageMatch 2020-12-19 19:34:28 -05:00
Markus Reiter
edf6a11be6
Simplify creation of merged_headers. 2020-12-19 19:34:27 -05:00
Markus Reiter
921485c672
Don't print backtrace for “Unable to get versions” error. 2020-12-19 19:34:27 -05:00
Sam Ford
f93ecd7d55
Satisfy brew typecheck and style 2020-12-19 19:34:27 -05:00
Sam Ford
8ea9ec8176
HeaderMatch: Align NICE_NAME with PageMatch 2020-12-19 19:34:27 -05:00
Sam Ford
57995f936f
Sparkle: Remove unnecessary NICE_NAME 2020-12-19 19:34:27 -05:00
Sam Ford
9fdc902630
Sparkle: Reorganize methods, etc. 2020-12-19 19:34:26 -05:00
Sam Ford
0148ee870e
Livecheck: Use alphabetical order in symbols array 2020-12-19 19:34:26 -05:00
Sam Ford
8b40d959bf
HeaderMatch: Fix content-disposition regex logic 2020-12-19 19:34:26 -05:00
Sam Ford
7f40198506
Make Strategy#page_headers more general purpose 2020-12-19 19:34:26 -05:00
Sam Ford
1bd2be5e04
Rename page_contents to page_content 2020-12-19 19:34:25 -05:00
Sam Ford
a55686a0e2
Enforce strategy url requirement in latest_version 2020-12-19 19:34:25 -05:00
Sam Ford
f5774c1af4
Sparkle: Use demodulized class name in error text 2020-12-19 19:34:25 -05:00
Markus Reiter
0d7c8c8c61
Revert priority for Git strategy. 2020-12-19 19:34:25 -05:00
Markus Reiter
0fd0b1dad0
Actually cache headers. 2020-12-19 19:34:25 -05:00
Markus Reiter
b8de4e8b21
Simplify strategies. 2020-12-19 19:34:24 -05:00
Markus Reiter
c306577575
Skip Sparkle strategy only if URL is not specified explicitly. 2020-12-19 19:34:24 -05:00
Markus Reiter
71104a27ef
Pass page directly instead of hash containing :page. 2020-12-19 19:34:24 -05:00
Markus Reiter
1a18742366
Pass headers directly instead of hash containing :headers. 2020-12-19 19:34:24 -05:00
Markus Reiter
3723cd7dec
Remove detection for Sparkle strategy. 2020-12-19 19:34:23 -05:00
Markus Reiter
4aaa2de6c4
Fix syntax. 2020-12-19 19:34:23 -05:00
Markus Reiter
71759035dd
Fix Sparkle detection if content type is missing. 2020-12-19 19:34:23 -05:00