18 Commits

Author SHA1 Message Date
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
47ffcd5cb7 Add types to block params 2023-04-04 22:42:27 -07:00
Douglas Eichelberger
f3a8241e69 Remove useless T.unsafe wrappers 2023-04-03 17:34:39 -07:00
Sam Ford
085827f605
Handle variable strategy block arguments
There are times where a regex isn't needed in a `strategy` block and
these changes explicitly handle that situation.

This allows the Symbol Proc format used in some `Sparkle` `livecheck`
blocks (e.g., `strategy :sparkle, &:version`) to continue working
instead of failing with a "wrong number of arguments (given 1,
expected 0)" error. This error would occur because a Symbol Proc only
only expects one argument (e.g., an `Item`, not an `Item` and a
regex/nil).

There's an argument to be made for avoiding the Symbol Proc format
for `strategy` blocks but I haven't found a way of selectively
disabling the Style/SymbolProc cop only for a `strategy` DSL method
call. That is to say, if we don't use the Symbol Proc format, `brew
style` will give a "Pass &:version as an argument to strategy instead
of a block." offense.

Besides that, this also replaces the `block` type signatures in
livecheck strategies with `T.untyped`. Sorbet doesn't know how to
handle a `Proc` with a variable number of arguments and can't be
taught how (i.e., `T.any` with a `Proc` signature for each variation
doesn't work). The aforementioned changes cause Sorbet to complain
about there being both too many and too few arguments, so the only
way to win is not to play the game. Hopefully we can restore the
`block` type signatures in the future (if upstream resolves this
years-old issue) but `T.untyped` seems to be our only option for now.
2021-11-19 23:58:55 -05: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
f2bd39ccef
Add additional method signatures to strategies 2021-08-11 19:05:59 -04:00
Sam Ford
a970780851
livecheck: allow nil return from strategy blocks 2021-08-02 18:33:34 -04:00
Sam Ford
7b864e0aaa
Sourceforge: Do not modify RSS URLs
This allows a `livecheck` block to check the RSS feed for a given
path in a SourceForge project. For example:
https://sourceforge.net/projects/example/rss?path=/directory
2021-07-19 15:15:27 -04:00
Markus Reiter
a210b1a04e
Add extract_plist strategy. 2021-04-07 04:58:31 +02:00
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
Sam Ford
2060f13de1
Refactor livecheck strategies around match regex 2020-12-31 09:18:36 -05:00
Sam Ford
361743e1fb
Livecheck: Extend strategy block support 2020-12-25 20:31:36 -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
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
nandahkrishna
f520301180
livecheck migration: add strategies
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Issy Long <me@issyl0.co.uk>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Seeker <meaningseeking@protonmail.com>
2020-08-27 20:00:30 +05:30