Commit Graph
404 Commits
Author SHA1 Message Date
Markus ReiterandGitHub f0dc1d96c5 Merge pull request #2537 from reitermarkus/pathname-to_str
Remove `to_s` from some `Pathname`s.
2017-05-18 09:39:07 +02:00
Mike McQuaid 8205e61e64 More environment filtering tweaks
- 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-13 11:42:01 +01:00
Markus Reiter 5828eefd01 Remove to_s from some Pathnames. 2017-05-08 13:37:28 +02:00
Mike McQuaid 57db2e539e Revert "Merge pull request #2597 from MikeMcQuaid/vendor-gems"
This reverts commit 3e4547f52e, reversing
changes made to 6edf9382bc.
2017-05-07 17:28:39 +01:00
Mike McQuaid e1bbab6ca6 Revert "Merge pull request #2603 from MikeMcQuaid/tweak-gem-vendoring"
This reverts commit 2372872974, reversing
changes made to 3e4547f52e.
2017-05-07 17:28:37 +01:00
Mike McQuaid 33f83be10e Tweak Gem vendoring.
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-07 15:33:54 +01:00
Mike McQuaid ee253e465b Vendor all Homebrew's gems.
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-07 13:52:57 +01:00
Markus Reiter 24b190cc14 Remove existing from PATH when adding Gem.bindir. 2017-05-03 10:18:07 +02:00
Mike McQuaid 5b19563937 utils: create GEM_HOME when installing Gems.
It may not exist before Gem installation which means that the resulting
installed gem will not be found in the PATH.
2017-05-03 08:26:30 +01:00
Markus Reiter 4d5d6a65e3 Rename PATH#validate to PATH#existing. 2017-04-30 21:11:28 +02:00
Markus Reiter 22f624b373 Make PATH enumerable. 2017-04-30 21:11:28 +02:00
Markus Reiter f8ad9d7efd Use PATH where possible. 2017-04-30 21:11:27 +02:00
Markus Reiter 314483f75c Remove Array#to_path_s. 2017-04-30 21:11:27 +02:00
Markus Reiter e221d0481a Use to_path_s in install_gem_setup_path!. 2017-04-30 21:11:27 +02:00
Mike McQuaid 6b0afa3e9c Remove puts_hash, require pp
I wasn’t aware this existed when I created puts_hash so: may as well
remove it.
2017-04-24 11:45:32 +01:00
Mike McQuaid 3e40059f8d utils: make which_editor handle editor args.
Handle cases like e.g. `EDITOR="subl -w"`.
2017-04-24 08:49:11 +01:00
Mike McQuaid d5155256ce Fix audit version_scheme and revision checks.
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-23 18:56:22 +01:00
Mike McQuaidandGitHub 11acadaa50 Merge pull request #2524 from MikeMcQuaid/more-env-filtering-fixes
Hide sensitive tokens from install/test/post.
2017-04-23 09:45:47 +01:00
Mike McQuaid 688034d22a utils: fix which_editor.
Handle when there's no editor variable specified or it's specified but
empty.
2017-04-22 17:29:59 +01:00
Mike McQuaid d02b4f321d Hide sensitive tokens from install/test/post.
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-22 16:31:19 +01:00
Mike McQuaid 69c7a20896 Fix brew edit with environment filtering.
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-04-21 18:26:12 +01:00
Markus Reiter 44d367edca Deprecate #plural. 2017-03-11 21:16:37 +01:00
Markus Reiter c594ffefbc Add Formatter::pluralize. 2017-03-11 21:12:51 +01:00
Markus Reiter ef5f58a14b Use Gem.bindir instead of #{Gem.dir}/bin. 2017-03-04 19:30:34 +01:00
Mike McQuaidandGitHub 0a8c8f90b6 Merge pull request #1708 from joshka/feature/install-tap-cmd-completions
install tap cmd completions
2017-02-27 08:42:17 +00:00
Joshua McKinney 25396d9c4d Install tap command completions and manpages
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-26 15:40:52 -06:00
Jeppe Toustrup ebaf3cdc6a Add 'B' for bytes to cleanup command output
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-25 11:30:46 +00:00
David Broder-Rodgers ed9f775b77 Added support for returning HTTP status codes and for git and svn URLs 2017-02-20 19:24:19 +00:00
Alyssa Ross 13488183bd emoji: remove hack required for Ruby 1.8.7
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.
2017-01-23 17:56:33 +00:00
Markus Reiter 0f8cb4ba27 Add option to disable methods on specific date. 2016-12-30 14:01:43 +01:00
Mike McQuaid 384174e542 which_all: don't assume path is a string.
Fixes #1635.
2016-12-10 13:19:01 +00:00
William Woodruff 54d18cee17 compat: deprecate Utils::JSON in favor of corelib JSON. 2016-11-20 15:02:47 -05:00
Alyssa Ross 14099ffaf3 utils: fix capture_stderr style 2016-11-14 12:28:45 +00:00
Alyssa Ross 3c310b2e3d Warn developers when uninstalling a dependency
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.
2016-11-14 12:13:34 +00:00
Markus Reiter 198bf4d3bd Convert puts_columns to puts Formatter.columns. 2016-10-15 17:13:38 +02:00
Markus Reiter 6e10f91371 Refactor puts_columns. 2016-10-15 17:13:37 +02:00
Markus Reiter b306f14b97 Rename FormulaMethodDeprecatedError to MethodDeprecatedError. 2016-10-08 13:26:10 +02:00
Markus Reiter 23dec587fd Make core_tap_version_string reusable. 2016-10-04 14:45:11 +02:00
Markus ReiterandGitHub cafe149780 Merge pull request #1145 from reitermarkus/module-function
Use `module_function` for `Homebrew` module.
2016-10-04 10:31:49 +02:00
Markus Reiter 9690c94f9d Fix Style/GuardClause style offense. 2016-10-02 00:24:47 +02:00
Markus Reiter 0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Markus Reiter 75e8b59aad Add Formatter module. 2016-10-01 20:00:49 +02:00
Markus Reiter 6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00
Markus Reiter 58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Mike McQuaid f0e9292acd Use git describe to get the HOMEBREW_VERSION.
For tagged commits produces the output:
- `1.0.1`

For untagged commits with a dirty tree produces the output:
- `1.0.1-19-g23efbc5-dirty`

Performance:
```
git describe --tags --dirty 2> /dev/null
0.07s user 0.01s system 96% cpu 0.086 total
```

This means we can tag any commit without needing to manually remember
to bump the revision every time.
2016-09-22 08:56:40 +01:00
Mike McQuaid 0d76dfadcc utils: fix completions/manpages/docs linking. 2016-09-20 10:41:42 +01:00
Alyssa Ross 4c773725c7 Use user GEM_HOME for installing gems
Save the value of GEM_HOME before unsetting it,
and resetting it when setting up a gem environment.

Fixes #944.
2016-09-19 19:09:55 +01:00
Mike McQuaid 569dbf4d05 utils: skip migration of broken formulae symlinks.
Closes https://github.com/Homebrew/homebrew-core/issues/4973
2016-09-19 10:40:18 +01:00
Mike McQuaidandGitHub 59b7f16bfd Merge pull request #989 from MikeMcQuaid/rubocop-final
Rubocop: apply auto-corrections and don't use hash-rockets
2016-09-18 13:28:15 +01:00
Zhiming Wang 58b17a0cfc utils: convert formula name from pathname to string
`name` is passed as argument to Formulary.factory which could later be
downcased at formulary.rb:349, but Pathname doesn't have a downcase
method. Converting `name` to String as it should be fixes the problem.

Fixes #1000.
2016-09-17 23:55:28 -04:00