560 Commits

Author SHA1 Message Date
Douglas Eichelberger
d98b7845d3 Enable typing in misc files 2023-03-03 08:29:26 -08:00
Douglas Eichelberger
325994a60c Move inflection utils to Utils module 2023-02-27 20:20:56 -08:00
Douglas Eichelberger
0438a3a538 Draft implementation to replace ActiveSupport inflections 2023-02-27 20:17:33 -08:00
Douglas Eichelberger
2b4d4a3707 Isolate Kernel extensions 2023-02-27 11:22:10 -08:00
Douglas Eichelberger
901a179ba6 Set back utils.rb file 2023-02-27 11:19:11 -08:00
Douglas Eichelberger
ff48ce24c4 Copy utils.rb into extend/kernel.rb 2023-02-27 11:19:11 -08:00
Maxim Belkin
c9b289fc3d Use 'wslview' instead of 'xdg-open' on Windows 2023-02-27 14:39:56 +00:00
Mike McQuaid
aca3eead71
which_editor: remove Atom.
It's been deprecated. Make VSCode first because it's what we recommend.
2023-02-23 08:53:32 +00:00
apainintheneck
a7dbd738dd cmd/edit: stop double warning
When you don't have EDITOR or HOMEBREW_EDITOR
configured `brew edit` printed a double warning.

This silences the first of those.
2023-02-11 00:16:11 -08:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
Caleb Xu
f6474c5048
utils: prepare for deprecation of Utils.gzip 2023-01-06 22:58:53 -05:00
EricFromCanada
76199ddd72
utils: prefer BBEdit over TextWrangler 2022-08-31 15:26:58 -04:00
fn ⌃ ⌥
a208ea9c92 info: highlight package name 2022-08-15 07:47:52 -07:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
8ada737d40
Encapsulate ENV["SHELL"] usage 2022-06-17 19:47:57 +01:00
Bo Anderson
e78665f4f7
Replace ENV["HOME"] with Dir.home 2022-06-17 19:47:57 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
Mike McQuaid
04c8e02418
cmd/update-report: use better wording where appropriate.
From reading https://github.com/orgs/Homebrew/discussions/3328: I
initially thought we should just change "Updated" to "Modified" when
appropriate. After conversation with Bo98, though, I thought more and
saw that we're already checking for outdated formulae here so, rather
than ever traverse through the formula history, look at the outdated
formula and list them unless we've set
`HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the
modifications.

While we're here, also do a bit of reformatting and renaming to better
clarify intent.
2022-06-03 19:23:38 +01:00
Bo Anderson
6ec9095946
utils: add disable_for_developers option for odeprecated 2022-04-18 16:41:58 +01:00
Adrian Ho
cbac7a3063 brew: keep DBus session address in env
Otherwise `brew deps --graph` will fail to launch Firefox on Linux.

Fixes https://github.com/Homebrew/brew/issues/12881.
2022-02-17 14:55:15 +08:00
Xuehai Pan
62a63063bb Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn>
2021-11-24 01:06:27 +08:00
XuehaiPan
9ef52080e3 utils: extract common word "for" in reason 2021-11-23 23:59:09 +08:00
XuehaiPan
466f29a16a cmd/update-report: redirect stdout to stderr when it is not a TTY 2021-11-23 23:55:06 +08:00
XuehaiPan
c0826f1890 utils: add method ensure_executable! 2021-11-23 23:32:32 +08:00
XuehaiPan
d749173adc utils: mark reason as keyword argument in ensure_formula_installed! 2021-11-23 23:31:22 +08:00
XuehaiPan
7baaebe544 utils: send output to stderr by default for ensure_formula_installed! 2021-11-23 23:09:42 +08:00
XuehaiPan
3376479e95 utils: add method ensure_formula_installed! 2021-11-23 22:48:39 +08:00
XuehaiPan
687dbe5268 dev-cmd/cat: auto-install bat when running brew cat ... with HOMEBREW_BAT set 2021-11-23 15:20:57 +08:00
fn ⌃ ⌥
84a7c2ba7d
Add VS Code to list of fallback editors 2021-09-30 18:54:51 -07:00
Mike McQuaid
72c59c816f
Merge pull request #11548 from MikeMcQuaid/3_2_deprecate_disable_remove
Deprecate, disable, delete code for Homebrew 3.2.0
2021-06-18 14:34:10 +01:00
Misty De Meo
c0a02442d9
Revert "language/java: use shortened brew paths"
This reverts commits 318175cfe2b23328f1b5f13812fd59cfd45fe1dc,
e7ab760392b9691a6c730b7e0d660b7874969e70 and
3b35af63f608438b1882756feca94a6ebdd0d6a3 (PR #11537).
2021-06-17 20:29:43 -07:00
Mike McQuaid
30a65342e8
Deprecate, disable, delete code for Homebrew 3.2.0
Do the usual deprecation, disable, delete dance for Homebrew 3.2.0.
2021-06-17 11:34:32 +01:00
Caleb Xu
318175cfe2
Utils: add shortened_brew_path 2021-06-15 09:58:46 -04:00
Mike McQuaid
c4d69dd2e9
Revert "fix(vendor-gems): redirect bundler stdout to stderr" 2021-06-07 14:51:07 +01:00
Gibson Fahnestock
07d571bebc
fix(vendor-gems): redirect bundler stdout to stderr
When running brew commands and interpreting the output, e.g. running
`brew livecheck --json`, it's necessary to stop other programs Homebrew
happens to execute from writing logging output to stdout. Most programs
don't do this, but `bundle install` does seem to.

To reproduce the issue you can run:

```shell
git -C "$(brew --prefix)" clean -ffdx Library/Homebrew/vendor
stdout=$(HOMEBREW_FORCE_VENDOR_RUBY=1 brew livecheck --newer-only --json --cask $(brew --repo homebrew/cask)/Casks/grid.rb)
echo "^^^ was stderr, >>> is stdout: $stdout"
```

If you run it without this change it will print a bunch of output like
this to the stdout before printing out the livecheck JSON output:

```text
Using bundler 1.17.3
Fetching byebug 11.1.3
Fetching coderay 1.1.3
Installing byebug 11.1.3 with native extensions
Installing coderay 1.1.3
Fetching colorize 0.8.1
Installing colorize 0.8.1

[
  # Contents of the JSON block.
]
```

With this change the stdout from `bundle install` will be redirected to
brew's stderr, meaning only the JSON goes to stdout, and the rest goes
to stderr.
2021-06-03 11:18:23 +01:00
Mike McQuaid
d73351251c
Deprecate, disable, delete code for next major/minor version.
Do the usual dance for bumping our major/minor version.
2021-04-09 09:30:36 +01:00
Markus Reiter
b6ed8915e5
Add compatibility layer for AbstractDownloadStrategy#fetch. 2021-04-03 20:10:33 +02:00
nandahkrishna
3ce8ef3173
utils: raise UsageError in parse_author!
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-04-01 22:22:32 +05:30
nandahkrishna
53a7065bcc
Allow specifying committer for some dev-cmds 2021-04-01 22:22:31 +05:30
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
Bo Anderson
0e732d3917 cmd/update-report: report outdated count & suggest brew upgrade 2021-02-10 15:36:38 +00:00
Misty De Meo
c6dc42fd9d Utils: fix *_stdout_or_stderr helpers
Several calls to ohai and puts were directly changed into calls to
these new functions, but they don't share arity or an API.
The base functions allow arbitrary number of arguments, allowing for
multiline printing that covers both a title and a longer message.
2021-02-05 10:13:44 -08:00
Mike McQuaid
72cb6ffd12
utils: import {ohai,puts}_stdout_or_stderr
Fixes #10536
2021-02-05 15:03:31 +00:00
Bo Anderson
b670ab1c7b Deprecate additional arch functions 2021-02-02 16:19:24 +00:00
nandahkrishna
e2ddf9894a
Refactor brew bump 2021-01-24 19:10:46 +05:30
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Seeker
41e0619de8 utils: add git_repository 2021-01-07 11:45:11 -08:00