aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
AgeCommit message (Collapse)Author
2016-04-02--version/config: show core tap informationXu Cheng
2016-03-28utils, gist-logs: improve/fix credential handling.Mike McQuaid
The API used (`Net::HTTP::Post`) does not handle basic authentication credentials in the same way as `open` so fix both cases so they work. Also, do some general usability tweaks to point out to people what could be wrong with their tokens or credentials to help them debug. Closes Homebrew/homebrew#50410. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-20Add advice about keychain credentialsTim D. Smith
Fixes Homebrew/homebrew#50050. Closes Homebrew/homebrew#50059.
2016-03-10utils: API Git credential tweaks.Mike McQuaid
- Use empty array when `git credential-osxkeychain` lookup fails to cache and avoid rerunning it when there's no valid results. - Redirect `stderr` to avoid printing errors when there's a failure or no `git credential-osxkeychain` installed. Closes Homebrew/homebrew#49954. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-09utils: use string arg to IO.popen.Mike McQuaid
Closes Homebrew/homebrew#49882.
2016-03-08Set HOMEBREW_API_TOKEN from Git when available.Mike McQuaid
As requested in Homebrew/homebrew#46578. Falls back to existing functionality. Closes Homebrew/homebrew#46578. Closes Homebrew/homebrew#49846. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-01brew search: properly handle 503 errors.Felix Bünemann
This avoids crashing with an unknown key error, if the GitHub api response does not contain the ratelimit headers, e.g. when GitHub is down. It also tries to display the JSON error message in addition to the HTTP status. Closes Homebrew/homebrew#48538. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-06utils: inject Ruby path when running GemsMartin Afanasjew
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-04utils: extend brewed_curl recommended usage to 10.8Dominyk Tiller
Closes Homebrew/homebrew#47646. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-03utils: add which_allXu Cheng
Similar to which, except it returns all of paths where binary is found. i.e. it's equivalent to `which -a`.
2015-12-30utils: improve disk_usage_readableXu Cheng
* Avoid parallel assignment. * Avoid string manipulation.
2015-12-30utils: add readable disk space, numbers methods.Rakesh
2015-12-22Reimplement #pretty_durationSebastian Staudt
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-14pretty_duration: fixed for int argumentsBaptiste Fontaine
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-07Use `(installed)` and emoji ticks consistently.Mike McQuaid
Across info, search and update. Closes Homebrew/homebrew#45131. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-20utils: native rewrite of install_gem_setup_path!Martin Afanasjew
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-01download_strategy: silence curl on Travis CI.Mike McQuaid
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-10-20underline url in Error messageXu Cheng
2015-10-20Provide better link when rate limit exceeded error is thrownPatrick Stadler
Closes Homebrew/homebrew#45134. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-18remove unnecessary require statementsXu Cheng
2015-10-16utils: improve highlighting in multi-column outputMartin Afanasjew
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-14utils: highlight items in column-wise outputMartin Afanasjew
Closes Homebrew/homebrew#44343. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-14utils: re-implement and improve column-wise outputMartin Afanasjew
2015-09-09Homebrew.git_*: check git availableXu Cheng
2015-09-09utils: add Homebrew.git_originXu Cheng
2015-09-08Improve description searching and add a cache.Dan Martinez
Closes Homebrew/homebrew#42281. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-08quiet_system: don't print cmd even when verbose modeXu Cheng
It's kinda annoying that quiet_system wasn't really quiet. This commit fixes that.
2015-09-02homebrew_version_string: check git availableXu Cheng
2015-09-02add git utilsXu Cheng
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-08-29More API documentation.Mike McQuaid
And remove the documented stuff from the `example-formula.rb`. Closes Homebrew/homebrew#43241. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-25include git sha1 in --version outputTim D. Smith
HOMEBREW_VERSION doesn't change very often; the repository state is more interesting. Closes Homebrew/homebrew#41886.
2015-08-16which: don't fail on malformed paths in PATHBaptiste Fontaine
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-29interactive_shell: create .zshrc when necessaryXu Cheng
Closes Homebrew/homebrew#42190. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-17use ohai headers at the top of search resultsAlex Dunn
Closes Homebrew/homebrew#41832.
2015-07-08Audit GitHub repository notability.Mike McQuaid
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-03Make HOMEBREW_GITHUB_API_TOKEN copy/paste friendlyOsman Surkatty
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-06-24Make warnings yellow (previously red)Radek Simko
Closes Homebrew/homebrew#41003. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-06-13Remove some 10.5 hacksJack Nagel
2015-06-04utils: prefer keg curl over system on 10.6Ryan Hendrickson
Closes Homebrew/homebrew#39927. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-05-29interactive_shell: use Formula#full_nameXu Cheng
2015-05-18test-bot: don't complain bottle errors when installing gcc and hgXu Cheng
Closes Homebrew/homebrew#39626. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-14Install specific Rubocop version.Mike McQuaid
Closes Homebrew/homebrew#39620.
2015-05-05Update links to GitHub's personal access tokenAlex Muller
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-04-30utils: tweak access token text.Mike McQuaid
Closes Homebrew/homebrew#39214.
2015-04-15move safe_fork into a standalone methodXu Cheng
2015-03-24add method to detect shell profile file based on users' preference shellXu Cheng
Closes Homebrew/homebrew#38017. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-14Remove unused argumentJack Nagel
2015-01-05Emit warning when no editor is setJack Nagel
Closes Homebrew/homebrew#34647.
2015-01-05utils: install_gem_setup_path! now checks PATH.Mike McQuaid
Check the executable is present to give a better error message if it isn't. Closes Homebrew/homebrew#35541.