280 Commits

Author SHA1 Message Date
Douglas Eichelberger
00ba09d73d Remove use of ActiveSupport try 2023-11-05 09:28:19 -08:00
Mike McQuaid
20b8a74906
global: use correct user-agent. 2023-10-21 09:37:57 +01:00
Rui Chen
2c4b282bff
chore(global): update safari user-agent to latest
Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-10-20 19:44:16 -04:00
Mike McQuaid
4e0ec2555e
Merge pull request #15986 from EricFromCanada/docs-assorted-improvements
Docs: assorted refinements for output
2023-09-11 13:06:52 +01:00
Eric Knibbe
2f79bdd257
global: add HOMEBREW_API_WWW 2023-09-11 02:26:37 -04:00
Rui Chen
e5c714fa91
chore: update safari UA to the latest
Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-09-06 15:10:05 -04:00
Mike McQuaid
c940e15a5c
Use HOMEBREW_CELLAR_PLACEHOLDER
Similarly to HOMEBREW_PREFIX_PLACEHOLDER, this allows the substitution
of HOMEBREW_CELLAR in JSON output when using the API.

Fixes #15668.
2023-07-18 10:59:27 +01:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
03ee70b1ae Remove kernel/reporting extension 2023-04-26 09:16:55 -07:00
Douglas Eichelberger
8539607a89 Organize activesupport requires 2023-04-25 11:02:31 -07:00
Douglas Eichelberger
7224ff5f77 Include T::Sig in Module 2023-04-24 20:42:38 -07:00
Douglas Eichelberger
403f08db8b Remove delegation 2023-04-16 09:30:21 -07:00
Douglas Eichelberger
b90897e280 Create git_repo attr 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
429f23dcc6 Create GitRepoPath 2023-04-15 19:35:12 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
Douglas Eichelberger
cc5b013cb9 Remove compatibility layer 2023-03-14 14:49:34 -07:00
Douglas Eichelberger
1943132cf6 Move i18n out of global 2023-03-11 17:27:53 -08:00
Mike McQuaid
5631310653
Auto-update from the API less often
Instead of doing so literally whenever we query for a formula, Instead
do so only when we're in an auto-updateable command.

This better fits the existing behaviour while still updating when it's
most important to do so.
2023-03-10 17:53:15 +00:00
Douglas Eichelberger
7aab1c2a38 Remove ActiveSupport String inflections 2023-03-07 10:16:52 -08:00
Douglas Eichelberger
e68b02c4a6 Move tests and requires 2023-03-03 12:44:23 -08:00
Douglas Eichelberger
91ad24b876 Remove Array#to_sentence monkey-patch 2023-03-03 12:44:22 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Mike McQuaid
2884b1649b
api: don't download files as root when Homebrew's not owned by root.
This was mentioned in a random comment. While we're here, make some
helper functions to query this a bit more nicely elsewhere when we do
it.
2023-02-23 10:04:50 +00:00
Mike McQuaid
c5252817c2
analytics: refactor InfluxDB/Google handling. 2023-02-15 16:34:50 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
Mike McQuaid
179974ce26
Merge pull request #14502 from dduugg/active-support-reduce
Remove active_support Time extensions
2023-02-05 11:51:48 +01:00
Douglas Eichelberger
24e7c2c5bd Remove active_support Time extensions 2023-02-04 13:51:35 -08:00
Xuehai Pan
ba3bccf9ed api: download from HOMEBREW_API_DOMAIN 2023-02-04 13:05:20 +00:00
Douglas Eichelberger
e98e668a34 remove redundant string extension 2023-01-28 08:26:11 -08:00
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
Troy McCabe
ac9a96874e Adds brew docs to close #13834 2022-09-11 22:10:37 -05:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
cd73e6bac5
Introduce more Ruby constants for values set by brew.sh 2022-06-17 19:47:57 +01:00
Mike McQuaid
04938efc24
Unify GitHub Packages authorization logic in brew.sh. 2022-01-27 15:44:34 +00:00
Mike McQuaid
0cda6a0657
Only use patchelf.rb
Remove support for using the `patchelf` formula for writing as it's been
off by default for a long time now.
2021-10-19 15:15:56 +01:00
Bo Anderson
861dea9ada
Bump various type strictnesses 2021-09-11 01:00:23 +01:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
Markus Reiter
59f4a711cd
Deprecate _fetch without timeout option. 2021-04-03 20:10:33 +02:00
Markus Reiter
b6ed8915e5
Add compatibility layer for AbstractDownloadStrategy#fetch. 2021-04-03 20:10:33 +02:00
Mike McQuaid
d8a2cf9efc
Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
  and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
  local bottle file.
2021-03-31 09:43:37 +01:00
Mike McQuaid
3f00d08544
dev-cmd/pr-upload: some refactoring
- make the description more generic/correct
- use "internet archive" over "archive"
- move some logic to a new `GitHubReleases` class (for consistency)
- remove some obvious comments
- extract out and move some constants
2021-03-11 14:49:56 +00:00
Bo Anderson
1fba9b9b53
Prevent loading all non-Bundler gems 2021-02-26 18:23:48 +00:00
Mike McQuaid
e65e310fd0
Fix brew style 2021-01-29 20:56:59 +00:00
Mike McQuaid
683ae7ff53
Add HOMEBREW_BOOTSNAP to optionally use Bootsnap
> Bootsnap is a library that plugs into Ruby, with optional support
> for ActiveSupport and YAML, to optimize and cache expensive
> computations.
https://github.com/Shopify/bootsnap

For our case that translates to "repeated calls to `brew` have
reductions in the time spend `require`ing speeding up the process
boot time".

For example:

```
$ hyperfine --warmup=2 "unset HOMEBREW_BOOTSNAP; brew info wget" "export HOMEBREW_BOOTSNAP=1; brew info wget"
Benchmark #1: unset HOMEBREW_BOOTSNAP; brew info wget
  Time (mean ± σ):      2.417 s ±  0.032 s    [User: 659.0 ms, System: 855.5 ms]
  Range (min … max):    2.382 s …  2.464 s    10 runs

Benchmark #2: export HOMEBREW_BOOTSNAP=1; brew info wget
  Time (mean ± σ):      1.862 s ±  0.064 s    [User: 425.3 ms, System: 566.8 ms]
  Range (min … max):    1.736 s …  1.952 s    10 runs

Summary
  'export HOMEBREW_BOOTSNAP=1; brew info wget' ran
    1.30 ± 0.05 times faster than 'unset HOMEBREW_BOOTSNAP; brew info wget'
```
2021-01-21 12:34:04 +00:00
Seeker
cdb07d89ae integration_test: fix indentation for test formulae 2020-12-21 16:17:39 -08:00
Mike McQuaid
0f9bad0052
Fix bottle prefix and repository handling
We were previously only looking at the `cellar` value when pouring
bottles and ignoring the `prefix` and (implicit) `repository`.

Actually look at these values and set the defaults for each platform.

Also, when we're relocating to create or pour bottles when `prefix`
and `repository` are equal then skip relocating the `repository` and
always use references to the `prefix` instead.

Fixes #9453
2020-12-09 13:53:10 +00:00
Mike McQuaid
7439a9b8a2
global: add more active_support includes. 2020-11-30 16:27:47 +00:00
Markus Reiter
7348185347 Reorder global. 2020-11-30 00:00:02 +01:00