508 Commits

Author SHA1 Message Date
Martin Afanasjew
8dc1e05ff8 utils: inject Ruby path when running Gems
Particularly the `bundler` Gem requires the right Ruby binary to be in
the PATH to work correctly if the Ruby binary used to run Homebrew is
overridden via `HOMEBREW_RUBY_PATH` and thus intentionally not prefixed
to the PATH (as that would affect formulae with a Ruby dependency).

The workaround here is to prefix this path only when a Gem is activated
via `Homebrew.install_gem_setup_path!` (currently used in `brew man`,
`brew style`, and `brew tests`).
2016-01-06 06:21:42 +01:00
Dominyk Tiller
e7738d067f utils: extend brewed_curl recommended usage to 10.8
Closes Homebrew/homebrew#47646.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-04 03:10:10 +00:00
Xu Cheng
66c0b06d72 utils: add which_all
Similar to which, except it returns all of paths where binary is found.
i.e. it's equivalent to `which -a`.
2016-01-03 21:00:11 +08:00
Xu Cheng
d043b9d40f utils: improve disk_usage_readable
* Avoid parallel assignment.
* Avoid string manipulation.
2015-12-30 16:56:05 +08:00
Rakesh
a96a9004f4 utils: add readable disk space, numbers methods. 2015-12-30 08:10:36 +00:00
Sebastian Staudt
f0a370ea12 Reimplement #pretty_duration
Also reuse this improved implementation in the GitHub rate limit errors.

Closes Homebrew/homebrew#44721.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-22 12:46:03 +01:00
Baptiste Fontaine
f1ac9b5776 pretty_duration: fixed for int arguments
Without this the returned string is not as accurate if the method is
called with an int larger than 120.

Closes Homebrew/homebrew#47002.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-14 16:34:12 +01:00
Mike McQuaid
bf2315b1f4 Use (installed) and emoji ticks consistently.
Across info, search and update.

Closes Homebrew/homebrew#45131.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07 14:56:30 +00:00
Martin Afanasjew
fde1614670 utils: native rewrite of install_gem_setup_path!
Setting the environment variable `HOMEBREW_RUBY_PATH` allows one to run
Homebrew with a non-standard Ruby, even one that is not in `PATH`. This
creates the problem that the `gem` in `PATH` might not be the right one
to call, possibly leading to confusing results as the wrong RubyGems
installation is queried/manipulated.

Closes Homebrew/homebrew#46185.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-20 14:00:45 +00:00
Mike McQuaid
68896d14aa download_strategy: silence curl on Travis CI.
Use one of the Travis CI default environment variables:
http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables

Closes Homebrew/homebrew#44446.
Closes https://github.com/travis-ci/travis-ci/issues/4936.

Closes Homebrew/homebrew#45561.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-01 00:18:51 -07:00
Xu Cheng
8207c48a23 underline url in Error message 2015-10-20 19:03:24 +08:00
Patrick Stadler
3dda14f5bd Provide better link when rate limit exceeded error is thrown
Closes Homebrew/homebrew#45134.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-20 08:38:53 +01:00
Xu Cheng
06806f860d remove unnecessary require statements 2015-10-18 22:57:42 +08:00
Martin Afanasjew
4ac345ca61 utils: improve highlighting in multi-column output
The yellow background made the text unreadable for light-on-dark color
schemes. Fix by making the highlighted text just bold.

Fixes Homebrew/homebrew#45028.

Closes Homebrew/homebrew#45030.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-16 16:08:43 +01:00
Martin Afanasjew
4cf703d5d8 utils: highlight items in column-wise output
Closes Homebrew/homebrew#44343.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-14 15:07:57 +01:00
Martin Afanasjew
c3e7a64648 utils: re-implement and improve column-wise output 2015-10-14 15:07:57 +01:00
Xu Cheng
31ddce85e7 Homebrew.git_*: check git available 2015-09-09 12:19:17 +08:00
Xu Cheng
1b531492ca utils: add Homebrew.git_origin 2015-09-09 12:19:16 +08:00
Dan Martinez
8374374168 Improve description searching and add a cache.
Closes Homebrew/homebrew#42281.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-08 15:23:37 +01:00
Xu Cheng
e3299bb7a3 quiet_system: don't print cmd even when verbose mode
It's kinda annoying that quiet_system wasn't really quiet. This commit
fixes that.
2015-09-08 17:36:28 +08:00
Xu Cheng
8d5c445daa homebrew_version_string: check git available 2015-09-02 15:24:52 +08:00
Xu Cheng
71f794260b add git utils
Two methods:
* `Utils.git_available?` checks whether git is installed.
* `Utils.ensure_git_installed!` installs git for users who don't install
  Xcode or CLT.
2015-09-02 15:24:52 +08:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
Tim D. Smith
143709e679 include git sha1 in --version output
HOMEBREW_VERSION doesn't change very often; the repository state is more
interesting.

Closes Homebrew/homebrew#41886.
2015-08-25 00:13:53 -07:00
Baptiste Fontaine
c631fc3013 which: don't fail on malformed paths in PATH 2015-08-16 17:03:05 +02:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
70025458f3 interactive_shell: create .zshrc when necessary
Closes Homebrew/homebrew#42190.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-29 16:23:10 +08:00
Alex Dunn
c7e986d65e use ohai headers at the top of search results
Closes Homebrew/homebrew#41832.
2015-07-17 18:33:34 -07:00
Mike McQuaid
51a1792e7a Audit GitHub repository notability.
This stuff seems to be taken better when coming from a script rather
than from a human. Feel free to disagree about the specific numbers
chosen here.
2015-07-08 14:53:48 +01:00
Osman Surkatty
310afba026 Make HOMEBREW_GITHUB_API_TOKEN copy/paste friendly
A simple change that allows for easy copy/pasting. Right now if you were to double click on the text it will also inadvertently copy the trailing period. This change will alleviate the unnecessary gymnastics of not capturing the trailing period.

/most_pedantic_pull_request_ever

Closes Homebrew/homebrew#41257.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-03 14:42:43 +08:00
Radek Simko
7069509545 Make warnings yellow (previously red)
Closes Homebrew/homebrew#41003.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-06-24 16:39:55 +01:00
Jack Nagel
be9c5d5d16 Remove some 10.5 hacks 2015-06-13 17:18:17 -04:00
Ryan Hendrickson
aa49da2600 utils: prefer keg curl over system on 10.6
Closes Homebrew/homebrew#39927.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-04 11:46:25 +01:00
Xu Cheng
b931b98d35 interactive_shell: use Formula#full_name 2015-05-29 17:02:23 +08:00
Xu Cheng
471c5502f5 test-bot: don't complain bottle errors when installing gcc and hg
Closes Homebrew/homebrew#39626.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-18 19:48:06 +08:00
Mike McQuaid
0a2dd832b9 Install specific Rubocop version.
Closes Homebrew/homebrew#39620.
2015-05-14 16:05:00 +01:00
Alex Muller
83bcde2317 Update links to GitHub's personal access token
The link for the page that allows creation of API tokens has changed
from /settings/applications to /settings/tokens. Also the wording
on that page calls them "personal access tokens", so update
Homebrew to be consistent with that.

Closes Homebrew/homebrew#39378.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2015-05-05 15:46:42 -07:00
Mike McQuaid
01c6c73709 utils: tweak access token text.
Closes Homebrew/homebrew#39214.
2015-04-30 18:39:10 +01:00
Xu Cheng
06f72ab38f move safe_fork into a standalone method 2015-04-15 19:51:54 +08:00
Xu Cheng
453990f1aa add method to detect shell profile file based on users' preference shell
Closes Homebrew/homebrew#38017.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-24 21:18:32 +08:00
Jack Nagel
b03faffcc1 Remove unused argument 2015-03-14 17:59:06 -04:00
Jack Nagel
04f600bb50 Emit warning when no editor is set
Closes Homebrew/homebrew#34647.
2015-01-05 15:23:35 -05:00
Mike McQuaid
dc16371e19 utils: install_gem_setup_path! now checks PATH.
Check the executable is present to give a better error message if it isn't.

Closes Homebrew/homebrew#35541.
2015-01-05 19:14:55 +00:00
Jack Nagel
a52143c63c Remove readline and zlib hacks 2015-01-03 22:39:07 -05:00
Mike McQuaid
39fb39288f utils: always set PATH in install_gem_setup_path. 2015-01-02 14:13:32 +00:00
Mike McQuaid
167dac74b7 utils: tweak install_gem_setup_path to not warn.
If the `Gem.user_dir/bin` is not already in the PATH it'll complain
unnecessarily (as we add it to the PATH ourselves) so just add it to the
PATH before running the install.
2015-01-02 13:37:06 +00:00
Mike McQuaid
9e8103cf38 Add Homebrew.install_gem_setup_path! function.
This uses the logic from tests.rb in man.rb too so that this can be
shared in a few places.
2015-01-02 12:42:02 +00:00
Mike McQuaid
645e82df83 Remove {start,stop}doc as we're using Yard now. 2014-12-06 09:14:20 +00:00
Jack Nagel
6f6484f0d8 Friendlier error message for EOFError raised inside Net::HTTP
Closes Homebrew/homebrew#34312.
Closes Homebrew/homebrew#34358.
2014-11-20 22:28:11 -06:00
Tim D. Smith
facb82e4bc Shows time since last commit in brew config
Closes Homebrew/homebrew#32936.
2014-10-05 16:17:57 -07:00