6060 Commits

Author SHA1 Message Date
Douglas Eichelberger
c9a6bd6438
Merge pull request #19475 from Homebrew/typed-system-command
refactor: Enable strict typing in download_strategy
2025-03-14 22:34:17 +00:00
Mike McQuaid
c82518032e
Fix services types
Some of the typing/`T.must` usage when moving the
Homebrew/homebrew-services code to Homebrew/brew was not quite correct.

Rather than trying to make everything `strict` and import at the same
time: let's mostly loosen the typing to fix a few bugs and allow us to
add more later.
2025-03-14 16:53:07 +00:00
Sean Molenaar
0e80446543
Merge pull request #19459 from Homebrew/feat/fetch/cask_on_linux
fix: allow fetching casks on Linux
2025-03-14 08:40:43 +00:00
Bo Anderson
02cd7a63c8
Move Services module to Homebrew namespace 2025-03-14 08:19:11 +00:00
Sean Molenaar
756ba2ba59 Add Linux dependency check in cask.rb 2025-03-13 21:47:17 +01:00
botantony
25b9000c77
spec_helper: add :needs_systemd
Signed-off-by: botantony <antonsm21@gmail.com>
2025-03-13 20:29:26 +01:00
Douglas Eichelberger
c48870080e
Incorporate feedback 2025-03-13 11:59:31 -07:00
Mike McQuaid
0d3cbcad41
test/services: fix some more tests. 2025-03-13 17:36:46 +00:00
botantony
7a7395a229
services-systemctl: fix testcases
Signed-off-by: botantony <antonsm21@gmail.com>
2025-03-13 17:07:35 +01:00
Mike McQuaid
084ddca27a
Cleanup and fix homebrew-services migration 2025-03-13 15:22:01 +00:00
botantony
3ef52e4844
services: migrate command to main repo (WIP) 2025-03-13 13:22:01 +00:00
Douglas Eichelberger
1ca5299f40
refactor: Enable strict typing in download_strategy 2025-03-12 15:15:20 -07:00
Bevan Kay
cbc79184ad
test/dev-cmd/create: allow use of @ in cask name 2025-03-12 19:58:03 +11:00
Mike McQuaid
ae7b0c10f3
Merge pull request #19254 from tyuwags/install-size
Install size
2025-03-11 09:54:03 +00:00
Sam Ford
8ba1b4400a
livecheck: Include Content-Length header for POST
Some servers will return an error response if a `Content-Length`
header isn't included in a `POST` request, so this adds it to the
`post_args` array when `post_form` or `post_json` are used.
2025-03-07 20:31:00 -05:00
thibhero
6d3ca98207 correcting regex to match in any order and only once 2025-03-07 00:38:02 -05:00
thibhero
692174305d correcting regex to match in any order and only once 2025-03-06 23:54:19 -05:00
thibhero
9874f2bbb9 check for formula in any order 2025-03-06 23:30:22 -05:00
thibhero
909f2afd16 brew style --fix 2025-03-06 23:02:17 -05:00
thibhero
459741f683 include FileUtils for touch 2025-03-06 22:59:58 -05:00
thibhero
e6d02658b2 adding installed up-to-date 2025-03-06 22:03:15 -05:00
thibhero
2edc42e905 erratum testball and not testball1 2025-03-06 21:43:24 -05:00
thibhero
0ebbd118e4 test for reinstall 2025-03-06 21:27:35 -05:00
thibhero
c5b8dd91f1 test for upgrade 2025-03-06 21:27:25 -05:00
thibhero
99fad7797c modifying files with brew style 2025-03-06 21:27:13 -05:00
thibhero
f4d93e19b8 refactoring testball case to make it more readable 2025-03-06 20:59:56 -05:00
thibhero
fa4e2bad6e updating testball5-0.1.tbz to make it work 2025-03-06 20:59:33 -05:00
thibhero
e5e647d950 refactoring testball 2025-03-06 19:58:32 -05:00
thibhero
4651b961fa removing attributes from macOS 2025-03-06 19:57:44 -05:00
thibhero
16599b6e05 tests for install_spec.rb 2025-03-06 19:34:46 -05:00
thibhero
4e90aa527d moving testball3 to testball5 2025-03-06 19:34:25 -05:00
thibhero
f0f2e59fb7 Merge branch 'master' into ask-test
# Conflicts:
#	Library/Homebrew/vendor/bundle/bundler/setup.rb
2025-03-06 00:12:32 -05:00
thibhero
885b7c6f4f checking other tests functions 2025-03-05 23:57:58 -05:00
thibhero
0f919e8397 new files for integration_spec.rb for testball3 and 4 2025-03-05 21:32:48 -05:00
thibhero
640c5175fb creating install test with dependencies 2025-03-05 21:31:21 -05:00
thibhero
0b9374b7ac modifying integration_test.rb to work with other dependencies 2025-03-05 21:29:02 -05:00
thibhero
665fbc382d second test for install with dependencies 2025-03-05 17:38:55 -05:00
thibhero
817c40d261 test for upgrade_spec.rb 2025-03-05 17:37:25 -05:00
Sean Molenaar
fc319f6793 feat: add tests for completion stanzas 2025-03-05 20:12:18 +01:00
Heath Stewart
42caf20fa4
Add PowerShell (pwsh) completion support
Resolves #19403
2025-03-02 18:17:38 -08:00
thibhero
b7a298e1ec first test to check option --ask 2025-03-02 20:04:02 -05:00
Douglas Eichelberger
9cb5ecf8b3
Merge pull request #19379 from Homebrew/fix-formula-type
Fix return type of Formula.build
2025-02-25 17:15:51 +00:00
Douglas Eichelberger
6cd9daffdf
Fix return type of Formula.build 2025-02-25 09:03:01 -08:00
Sam Ford
749a7c846e
Add livecheck_find_versions_parameters tests 2025-02-25 10:56:32 -05:00
Sam Ford
0bb18b33b2
Livecheck::Options: Add #merge! 2025-02-25 10:56:32 -05:00
Sam Ford
8afa354c35
Livecheck::Options: Rework as T::Struct
As suggested, this reworks `Options` to subclass `T::Struct`, which
simplifies the implementation and makes it easier to maintain.

One noteworthy difference in switching to `T::Struct` is that
`#serialize` omits `nil` values but I don't _think_ this should be a
problem for us. In terms of changes, I modified `#merge` to remove a
now-unnecessary `compact` call and updated related tests.

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2025-02-25 10:56:32 -05:00
Sam Ford
b6eb945320
livecheck: Add Options class
This adds a `Livecheck::Options` class, which is intended to house
various configuration options that are set in `livecheck` blocks,
conditionally set by livecheck at runtime, etc. The general idea is
that when we add features involving configurations options (e.g., for
livecheck, strategies, curl, etc.), we can make changes to `Options`
without needing to modify parameters for strategy `find_versions`
methods, `Strategy` methods like `page_headers` and `page_content`,
etc. This is something that I've been trying to improve over the years
and `Options` should help to reduce maintenance overhead in this area
while also strengthening type signatures.

`Options` replaces the existing `homebrew_curl` option (which related
strategies pass to `Strategy` methods and on to `curl_args`) and the
new `url_options` (which contains `post_form` or `post_json` values
that are used to make `POST` requests). I recently added `url_options`
as a temporary way of enabling `POST` support without `Options` but
this restores the original `Options`-based implementation.

Along the way, I added a `homebrew_curl` parameter to the `url` DSL
method, allowing us to set an explicit value in `livecheck` blocks.
This is something that we've needed in some cases but I also intend
to replace implicit/inferred `homebrew_curl` usage with explicit
values in `livecheck` blocks once this is available for use. My
intention is to eventually remove the implicit behavior and only rely
on explicit values. That will align with how `homebrew_curl` options
work for other URLs and makes the behavior clear just from looking at
the `livecheck` block.

Lastly, this removes the `unused` rest parameter from `find_versions`
methods. I originally added `unused` as a way of handling parameters
that some `find_versions` methods have but others don't (e.g., `cask`
in `ExtractPlist`), as this allowed us to pass various arguments to
`find_versions` methods without worrying about whether a particular
parameter is available. This isn't an ideal solution and I originally
wanted to handle this situation by only passing expected arguments to
`find_versions` methods but there was a technical issue standing in
the way. I recently found an answer to the issue, so this also
replaces the existing `ExtractPlist` special case with generic logic
that checks the parameters for a strategy's `find_versions` method
and only passes expected arguments.

Replacing the aforementioned `find_versions` parameters with `Options`
ensures that the remaining parameters are fairly consistent across
strategies and any differences are handled by the aforementioned
logic. Outside of `ExtractPlist`, the only other difference is that
some `find_versions` methods have a `provided_content` parameter but
that's currently only used by tests (though it's intended for caching
support in the future). I will be renaming that parameter to `content`
in an upcoming PR and expanding it to the other strategies, which
should make them all consistent outside of `ExtractPlist`.
2025-02-25 10:56:31 -05:00
Mike McQuaid
e49b36d118
Merge pull request #19323 from Homebrew/typed-formula
Enable strict typing in Formula
2025-02-25 08:36:24 +00:00
Douglas Eichelberger
936b9b5369
Move nil check inside demodulize 2025-02-24 11:57:20 -08:00
Douglas Eichelberger
ca8759605c
Fix tests 2025-02-24 10:23:42 -08:00