aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
AgeCommit message (Collapse)Author
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.
2017-03-11Deprecate `#plural`.Markus Reiter
2017-03-11Add `Formatter::pluralize`.Markus Reiter
2017-03-04Use `Gem.bindir` instead of `#{Gem.dir}/bin`.Markus Reiter
2017-02-27Merge pull request #1708 from joshka/feature/install-tap-cmd-completionsMike McQuaid
install tap cmd completions
2017-02-26Install tap command completions and manpagesJoshua McKinney
Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
2017-02-25Add 'B' for bytes to cleanup command outputJeppe Toustrup
When `brew cleanup` is run it prints out a message like the following: > This operation has freed approximately 222M of disk space. The '222M' refers to megabytes but the normal acronym for megabytes would be 'MB'. The 'B' is also missing from kilobytes and gigabytes in the output, so that's what this commit adds.
2017-02-20Added support for returning HTTP status codes and for git and svn URLsDavid Broder-Rodgers
2017-01-23emoji: remove hack required for Ruby 1.8.7Alyssa Ross
Since this hack is no longer required, and `Emoji.tick` and `.cross` are only called in one place, I think it's better to just inline them there rather than having methods on `Emoji` that just return a one-character String.
2016-12-30Add option to disable methods on specific date.Markus Reiter
2016-12-10which_all: don't assume path is a string.Mike McQuaid
Fixes #1635.
2016-11-20compat: deprecate Utils::JSON in favor of corelib JSON.William Woodruff
2016-11-14utils: fix capture_stderr styleAlyssa Ross
2016-11-14Warn developers when uninstalling a dependencyAlyssa Ross
Suggested in #1084. Made the existing warning output entirely to STDERR, because previously the first line went to STDERR and subsequent ones went to STDOUT.