aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
AgeCommit message (Collapse)Author
2018-02-09utils: only look for gems in GEM_HOME.Mike McQuaid
This avoids issues where a gem is installed but cannot be found. Fixes #3355. Fixes #3760.
2018-02-05utils: no .metadata deprecations.Mike McQuaid
Otherwise running on old casks can produce deprecations. Fixes #3738.
2018-01-26Always install Gems into bundler location.Mike McQuaid
2018-01-24utils: reduce odeprecated warnings.Mike McQuaid
Fix the code so we don't actually output `odeprecated` warnings for `HOMEBREW_CACHE`d or `.brew`d formulae.
2018-01-21utils: no deprecations for cached formulae.Mike McQuaid
`HOMEBREW_CACHE`d and `.brew`ed formulae cannot be updated so don't complain about their deprecation.
2018-01-17utils: tell developers to submit odeprecated PRs.Mike McQuaid
Rather than just telling them to submit an issue as it's likely that as these folks will be able to submit a PR.
2017-12-24utils: stop debug exploding when zsh is usedDominyk Tiller
2017-12-12Remove with_system_pathShaun Jackman
The method with_system_path is no longer needed, since environment filtering uses a default PATH.
2017-12-12Do not specify absolute paths to utilitiesShaun Jackman
Specifying an absolute path to utilities is no longer needed, since environment filtering uses a default PATH.
2017-11-17diagnostic: fix paths usage.Mike McQuaid
- Don't allow taking an argument. This doesn't work and never has as it caches the result regardless of the argument. - Don't rely on the PATH to check for external commands.
2017-11-05utils: correctly handle empty user gem env.Mike McQuaid
2017-10-29Tweak use of with_envMike McQuaid
- Use it in more places where it saves code - Allow using symbolic keys for a cleaner interface - Use `HOMEBREW_GEM_*` instead of `GEM_OLD_*`
2017-10-18Use “squiggly” heredocs.Markus Reiter
2017-10-08Clean up code style and remove `.rubocop_todo.yml`.Markus Reiter
2017-09-29Use `PATH` where possible.Markus Reiter
2017-09-16List cask full-namesDan Wendorf
`brew cask list` supports the `--full-name` flag which will include the tap name for casks not part of the core caskroom/cask tap. For example, if cask "foo-beta" is installed from the caskroom/versions cask, `brew cask list --full-name` will report the name as "caskroom/versions/foo-beta".
2017-09-04audit: Add a global flag to silent warning when auditingGautham Goli
2017-07-21Enable more deprecations.Mike McQuaid
It's been long enough that these have been commented out so let's enable them globally.
2017-07-15run_as_not_developer: use with_env helperMisty De Meo
2017-07-15Add `with_env` helper to set temporary ENV varsMisty De Meo
2017-06-14Move `require?` to `utils`.Markus Reiter
2017-06-12Merge pull request #2769 from MikeMcQuaid/rubocop-no-perl-backrefs1.2.3Mike McQuaid
rubocop: don’t allow Perl regex backrefs.
2017-06-12Autocorrect Rubocop Style/SpecialGlobalVars.Mike McQuaid
2017-06-10Autocorrect Rubocop Style/PerlBackrefs.Mike McQuaid
2017-06-07edit: tweak default editors.Mike McQuaid
Add `atom` (not my editor of choice [TextMate for life!]) but widely used enough to probably warrant it. Also, reorder based on my best guestimates of current usage and cleanup the editor code while we're here.
2017-06-02Re-revert "Fix operator spacing."Markus Reiter
2017-06-01don't try to find the full path of the editor in 'brew edit'adrian
fixes #2709
2017-06-01Revert "Fix operator spacing."ilovezfs
2017-05-31Fix operator spacing.Markus Reiter
2017-05-18Merge pull request #2537 from reitermarkus/pathname-to_strMarkus Reiter
Remove `to_s` from some `Pathname`s.
2017-05-13More environment filtering tweaksMike McQuaid
- only document HOMEBREW_* variables in the manpage (although still read from all the original environment variables). - resort manpage environment variables in alphabetical order - check the original path for trailing slashes
2017-05-08Remove `to_s` from some `Pathname`s.Markus Reiter
2017-05-07Revert "Merge pull request #2597 from MikeMcQuaid/vendor-gems"Mike McQuaid
This reverts commit 3e4547f52e7ebec633f8bfefc8a396d944edf908, reversing changes made to 6edf9382bcc1240ad6f97c8b752cfe56cef9965d.
2017-05-07Revert "Merge pull request #2603 from MikeMcQuaid/tweak-gem-vendoring"Mike McQuaid
This reverts commit 2372872974d1049c2beafe7dedb7f8f882502058, reversing changes made to 3e4547f52e7ebec633f8bfefc8a396d944edf908.
2017-05-07Tweak Gem vendoring.Mike McQuaid
If people have `HOMEBREW_RUBY_PATH` set then things explode in a rather confusing fashion. Instead, run `bundle` for them with the arguments that they'd want. Also, move `macho` requires into the module itself; it's a pain having to do everything for Bundler before requiring `pathname` which is a core Ruby class.
2017-05-07Vendor all Homebrew's gems.Mike McQuaid
Homebrew's actually ended up using a fair few gems. While we want to avoid Bundler at runtime (and this PR still does that, in fact uses Bundler even less at runtime than it did before) writing our own version to use at build-time seems redundant.
2017-05-03Remove `existing` from PATH when adding `Gem.bindir`.Markus Reiter
2017-05-03utils: create GEM_HOME when installing Gems.Mike McQuaid
It may not exist before Gem installation which means that the resulting installed gem will not be found in the PATH.
2017-04-30Rename `PATH#validate` to `PATH#existing`.Markus Reiter
2017-04-30Make `PATH` enumerable.Markus Reiter
2017-04-30Use `PATH` where possible.Markus Reiter
2017-04-30Remove `Array#to_path_s`.Markus Reiter
2017-04-30Use `to_path_s` in `install_gem_setup_path!`.Markus Reiter
2017-04-24Remove puts_hash, require ppMike McQuaid
I wasn’t aware this existed when I created puts_hash so: may as well remove it.
2017-04-24utils: make which_editor handle editor args.Mike McQuaid
Handle cases like e.g. `EDITOR="subl -w"`.
2017-04-23Fix audit version_scheme and revision checks.Mike McQuaid
Another attempt at fixing `brew audit` issues around detecting `revision` and `version_scheme` changes correctly. First done in #1754 and #2086 (reverted in #2099 and #2100). To ease future debugging a `ph` helper has been added to print a hash and a series of RSpec tests to verify that the `revision`, `version_scheme` and `version` formula version audits behave as expected. Fixes #1731.
2017-04-23Merge pull request #2524 from MikeMcQuaid/more-env-filtering-fixesMike McQuaid
Hide sensitive tokens from install/test/post.
2017-04-22utils: fix which_editor.Mike McQuaid
Handle when there's no editor variable specified or it's specified but empty.
2017-04-22Hide sensitive tokens from install/test/post.Mike McQuaid
Hide these tokens to avoid malicious subprocesses e.g. sending them over the network. Also, support using these tokens with environment filtering and clear `HOMEBREW_PATH` from subprocesses to stop them sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s PATH for e.g. `brew doctor` etc.
2017-04-21Fix `brew edit` with environment filtering.Mike McQuaid
For many people `brew edit` makes use of the `EDITOR` variable to pick a sensible editor. With environment filtering enabled unless this editor is found in the default system PATH it'll fall back to e.g. `vim`. Instead, ensure that we export the original, pre-filtering `PATH` as `HOMEBREW_PATH` and use that internally to locate the editor. In future this same approach will likely be used for requirements to be able to find tools, too, and for other variables which we want to expose to Homebrew itself but not other build tools. Note that `HOMEBREW_PATH` is the same as `PATH` when build filtering hasn't been enabled.