- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
Layout/InconsistentIndentation once the auto-fixer had got rid of the
"redundant begin"s.
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.
- 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
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.
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
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).