502 Commits

Author SHA1 Message Date
EricFromCanada
dddfbf80fc apidoc: add/update yard tags 2020-11-06 00:16:35 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
nandahkrishna
c1909e80b4
utils/tty: fix TTY handling for stderr 2020-09-17 04:18:13 +05:30
Markus Reiter
0514e2dbba Move command_help_lines into Help module. 2020-08-24 00:46:33 +02:00
Mike McQuaid
f6e035ec98
Merge pull request #8297 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-0.89.1
build(deps): bump rubocop from 0.88.0 to 0.89.1 in /Library/Homebrew
2020-08-19 17:40:32 +01:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
Baffour Adu Boampong
ad2809b615
Merge branch 'master' into mlh-outdated-packages 2020-08-10 21:21:09 +00:00
Markus Reiter
490e503b1b Replace Homebrew.args with Context. 2020-08-06 16:13:14 +02:00
Markus Reiter
75a692d08b Make ohai, oh1 and odebug use #debug? and verbose? of the current object when possible. 2020-08-06 16:12:52 +02:00
Baffour Adu Boampong
5f19a53195 Refactor bump.rb methods into seperate modules 2020-07-30 22:58:30 +00:00
Baffour Adu Boampong
537a07b42d
Remove duplicate line
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-29 13:41:27 +00:00
Baffour Adu Boampong
d7149d1f76 Fix merge conflicts 2020-07-06 03:32:18 +00:00
Baffour Adu Boampong
7a9fbfb6d3 setup and test command 2020-06-30 15:11:11 +00:00
EricFromCanada
e62137133e docs: fix comment help output 2020-06-25 11:59:42 -04:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid
bc27e38f18
Remove ARGV.debug?
Replace with `Homebrew.args.debug?`.

Part of #5730.
2020-05-23 14:38:58 +01:00
Mike McQuaid
e33dc9e916
utils: brew style --fix. 2020-05-21 10:15:34 +01:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
b5165ed7e8
Clarify tap issues should not be reported to Homebrew.
Instead, direct people to the actual tap.
2020-03-11 10:57:36 +00:00
Mike McQuaid
eb87651341
Revert "Revert "help: print cli/parser help message if used"" 2020-02-02 16:36:59 +01:00
Gautham Goli
acde828a45 ARGV: Replace ARGV.verbose? with Homebrew.args.verbose? 2020-02-02 14:00:04 +01:00
Mike McQuaid
f3afedb4ff
utils#system: improve verbose output.
This previously output the hilarious long and unnecessary LOAD_PATH.
2019-11-06 15:25:51 +00:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Markus Reiter
b1d0c61fea Update Gems. 2019-10-03 09:22:44 +02:00
Markus Reiter
e5899a6101 Move global methods into Kernel module.
Otherwise they are not defined inside of subclasses of `DelegateClass`.
2019-08-15 16:39:55 +02:00
Mike McQuaid
c5c59149c4
utils: make redact_secrets handle nil secrets.
Fixes #6363.
2019-08-13 08:15:24 +01:00
Cheng XU
9232ca4508
system_command: allow redacting secrets in the log
Add a new argument `secrets` to specify secret tokens, so we can redact them in the log.
2019-07-18 15:06:32 +08:00
Mike McQuaid
6325db9e37
utils: fix frozen string usage in odeprecated.
Fixes https://github.com/Homebrew/brew/issues/6053
2019-04-23 22:32:11 -07:00
Mike McQuaid
fc6bd2ea1c
Fixup more frozen string handling. 2019-04-20 14:07:29 +09:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
86f43f79ee
Enable/fix optional Ruby frozen string literal usage
Combined with https://github.com/Homebrew/homebrew-test-bot/pull/247
this will test Homebrew's use of frozen strings in CI. After this we
will then enable it for Homebrew developers and eventually all Homebrew
users.
2019-04-19 10:30:41 +09:00
Markus Reiter
75aa369102 Fix support for HOMEBREW_EDITOR with args. 2019-04-03 23:49:37 +02:00
Mike McQuaid
70b93f65ea
*cmd/*: use *system instead of exec for easier testing.
This improves both test coverage, makes it easier to use a profiler and
a debugger.
2019-03-27 21:15:24 +00:00
Zach Auten
dd4daa247f Merge branch 'master' of https://github.com/Homebrew/brew into brew-info-display-casks 2019-03-06 17:56:22 -05:00
Mike McQuaid
4f76d12874
utils/gems: extract from utils.
Also, don’t use any non-standard Ruby functionality to avoid needing any `requires.
2019-02-21 12:56:22 +00:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Zach Auten
554106d2e0 Updated missing formula cask reason
- search_for_cask in missing_formula renamed to is_a_cask_reason
    - is_a_cask calls new getInfo method in cask/cmd/info.rb to return info
      string
    - self.info in info.rb now calls getInfo and puts return value
    - added ohai_title to return the ohai printout for only titles, so that
      ohai printout could be added to the getInfo return string without
      calling puts.
    - refactored ohai to use ohai_title
    - updated info_spec.rb cask info test to be more specific when
      matching stderr.
    - is_a_cask_reason will respect 'silent'
    - refactored print_caveats to return instead of print
2019-02-18 03:33:57 -05:00
Mike Miller
6819cbf967 Set DISPLAY from HOMEBREW_DISPLAY unconditionally
No need to test for existence, ruby ENV does the right thing.
2019-02-12 11:42:17 -08:00
Mike Miller
ae1e4e7022 Set DISPLAY environment variable for browser on Linux
Fixes #5692
2019-02-10 23:30:54 -08:00
Mike McQuaid
8bfde013f6
utils: fix SVN remote test on Mojave.
For some reason Mojave needs the SSL args always set otherwise this
will always fail waiting for interactivity.

Also, while debugging this I noticed that `utils.rb` had a failure
expecting an integer so fix that too.
2019-01-22 14:20:24 +00:00
Mike McQuaid
a75f979eec
utils: re-add install_gem! version argument.
This is needed for `compat/download_strategy` for now.
2019-01-17 09:29:21 +00:00
Mike McQuaid
a7d72351cf
utils: don't look for bundler executable.
This exists sometimes and not others it seems.
2019-01-08 20:33:39 +00:00
Mike McQuaid
92cb62dace
utils: fix bad parameters. 2019-01-08 16:29:27 +00:00
Mike McQuaid
bf6cd48994
Merge branch 'master' into fix-deprecated-gem-options 2019-01-08 16:24:24 +00:00
Claudia
0b1ec2a414
Fix deprecated Rubygems options
In February 2013, Rubygems 2.0.0 deprecated [1] the `--[no-]ri` and `--[no-]rdoc` options, replacing them with the new `--[no-]document` option.

Almost five years later, Rubygems finally dropped support [2] for the long-deprecated `--[no-]ri` and `--[no-]rdoc` options.

This removal causes `bundle install` to **fail for fresh Homebrew checkouts** if Rubygems 3.0.x or newer is installed, which will happen if the user runs `gem update --system` on Ruby 2.3.0 or later. [3]

This also affects the system Ruby built into macOS 10.13 and 10.14.

Steps to reproduce:

```
$ sudo /usr/bin/gem update -N --system
[…]
Installing RubyGems 3.0.2
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem
$ gem --version 2>/dev/null
3.0.2
$ cd "$(mktemp -d)"
$ git clone --depth=1 https://github.com/Homebrew/brew.git
[…]
$ cd brew
$ export HOMEBREW_PATH=bin  # in case shellcheck is not installed
$ bin/brew style Library/Homebrew/extend/ENV/std.rb
==> Installing or updating 'rubocop' gem
Error: invalid option: --no-ri
```

(Note: The above steps will not touch an existing Homebrew installation, and won’t even require Homebrew to be installed.)

This commit replaces the deprecated options with the new `--no-document` option, which has been around since Rubygems 2.0.0. It is therefore safe for use on all supported platforms.

[1]: https://blog.rubygems.org/2013/02/24/2.0.0-released.html
[2]: https://github.com/rubygems/rubygems/pull/2354
[3]: https://rubygems.org/gems/rubygems-update/versions
2019-01-08 17:04:30 +01:00
Mike McQuaid
efc3c0c4c0
Use bundle install in more places.
This provides a more consistent version for `rubocop` than relying on
`Homebrew.install_gem_setup_path!` (and we really want `brew style` to
provide consistent output).
2019-01-08 15:08:21 +00:00
William Woodruff
b7d84f2d9e
build: Propagate entire ErrorDuringExecution
Fixes https://github.com/Homebrew/brew/issues/5427.
2018-12-23 11:26:12 -05:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
16618d0fc7 Use ActiveSupport’s #pluralize and #to_sentence. 2018-10-07 23:10:56 +02:00
Markus Reiter
7a991985a4 Run tests with HOMEBREW_DEVELOPER unset. 2018-09-19 19:43:45 +02:00