aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
AgeCommit message (Collapse)Author
2016-09-24Fix Style/GuardClause.Markus Reiter
2016-09-22Use git describe to get the HOMEBREW_VERSION.Mike McQuaid
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-20utils: fix completions/manpages/docs linking.Mike McQuaid
2016-09-19Use user GEM_HOME for installing gemsAlyssa Ross
Save the value of GEM_HOME before unsetting it, and resetting it when setting up a gem environment. Fixes #944.
2016-09-19utils: skip migration of broken formulae symlinks.Mike McQuaid
Closes https://github.com/Homebrew/homebrew-core/issues/4973
2016-09-18Merge pull request #989 from MikeMcQuaid/rubocop-finalMike McQuaid
Rubocop: apply auto-corrections and don't use hash-rockets
2016-09-17utils: convert formula name from pathname to stringZhiming Wang
`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-17utils: create missing kegs directories if needed.Mike McQuaid
2016-09-17utils: remove bad symlink if it already exists.Mike McQuaid
2016-09-17Improve legacy symlink migration.Mike McQuaid
Read the old symlinks and migrate them across rather than assuming a unlink/link will work fine (as users have conflicts.)
2016-09-17rubocop --auto-correct all hash-rocket usage.Mike McQuaid
2016-09-17Move LinkedKegs migration.Mike McQuaid
Move the `LinkedKegs` migration into `utils.rb` so it can also be called from `brew.rb` on startup.
2016-09-15utils: link_src_dst_dirs: paths not files.Mike McQuaid
This can ask for you to remove directories (e.g. `/usr/local/share/homebrew`) so don’t call this files to avoid confusion.
2016-09-11utils: fix Rubocop warnings.Mike McQuaid
2016-09-06update-report: also link docs, completions.Mike McQuaid
These are more files in the HOMEBREW_REPOSITORY that we want to link to the HOMEBREW_PREFIX.
2016-09-06utils: split link_path_manpages method.Mike McQuaid
Pull more logic into the more generic `link_src_dst_dirs` to be used to do more linkage.
2016-09-04Merge pull request #201 from gregory-nisbet/feature-env-shellsMike McQuaid
--env: support more shells, allow explicit shell selection
2016-09-01utils: fix link_path_manpages message indentation.Mike McQuaid
Otherwise looks weird with multiple items.
2016-08-26Fix missing `magenta` in Tty.Markus Reiter
2016-08-24utils: add link_path_manpages method.Mike McQuaid
2016-08-18remove ruby 1.8 compatible codesXu Cheng
2016-08-14Merge pull request #702 from MikeMcQuaid/silence-audit-revisionsMike McQuaid
Silence auditing formula revisions deprecations
2016-08-12oh1: Add a truncate optionShaun Jackman
2016-08-12utils: check raise deprecation exceptions value.Mike McQuaid
2016-08-10move shell_profile to compat/utils.rb & deprecateGreg Nisbet
2016-08-02utils: add with_custom_locale helperDominyk Tiller
2016-07-31utils: tell people to report deprecations to tap.Mike McQuaid
This should hopefully avoid Homebrew/brew or Homebrew/homebrew-core having these exceptions reported to us.
2016-07-30utils: fix option handling in 'odisabled'Martin Afanasjew
Options passed to `odisabled` were completely ignored. Instead, merge them with the defaults that distinguish `odisabled` from `odeprecated`.
2016-07-30utils: provide a better location in 'odeprecated'Martin Afanasjew
Try to find a formula in the backtrace to make the warning message more helpful in identifying the culprit, as the formula is not always the immediate caller of a deprecated method. Provide some sane fallbacks if there's not formula in the call stack.
2016-07-29utils: add API removal messaging methods.Mike McQuaid
Add new `odeprecated` and `odisabled` methods to print API removal messages. Currently these are just used by things in `compat/`.
2016-07-09emoji: extract logic into generic OS classes. (#450)Mike McQuaid
2016-07-07Use GitRepositoryExtension for HOMEBREW_REPOSITORYMartin Afanasjew
2016-07-05gist-logs: truncate log files to be gist-friendly (#279)Andrew Janke
Truncates each log file to about 1 MB. This avoids upload and download errors with the gists, and respects GitHub's suggested size limits.
2016-07-04utils: output what files `edit` is opening. (#444)Mike McQuaid
Since we've moved all formulae to taps it's not necessarily obvious what the path for the files are otherwise.
2016-06-03Use `curl` for the GitHub API (#295)Mike McQuaid
* Move GitHub API module to utils/github.rb. * Move curl method to utils/curl.rb. * global: use long curl arguments and an array. This makes the code more self-documenting. * utils/curl: support reading curl's output. * utils/github: use curl instead of open-uri. It has far better proxy support. * pull: set Homebrew user agent. * gist-logs: remove trailing whitespace. * gist-logs: use first instead of [0]. Easier to read. * gist-logs: use curl-based GitHub.open method.
2016-05-28bottle/test-bot: deep merge bottle JSON hashes.Mike McQuaid
2016-05-26utils: avoid using 'gem' as an identifier (#278)Martin Afanasjew
Avoid breaking code highlighting of some editors (e.g. Sublime Text) when `gem` is used as an identifier. This messes up the highlighting below the first use and makes working with the file rather annoying.
2016-05-08Add support for testing generic OS.Mike McQuaid
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that neither Mac nor Linux-specific code is loaded. This allows easier testing of cross-platform code on OS X and will make it easier to port Homebrew to platforms other than OS X and Linux.
2016-05-03Tty: Avoid truncating if not sensibleScore_Under
This causes truncate to simply return the original string if the terminal is not very wide, or if the terminal is unsupported.
2016-05-02Update Homebrew/homebrew references in commentsMartin Afanasjew
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew` depending on context.
2016-04-21brew-audit: pull style checks in to main audit outputAndrew Janke
This collects all violations for each formula in a single place, instead of doing `brew style` outputs for all formulae first, and then the other audit checks. Closes #112. Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18brew test, install, update-test: add --keep-tmp optionAndrew Janke
Also enables sandbox for --interactive and --debug use of install and test, using automatic retention. Closes #66. Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-07curl: fall back to /usr/bin/curl when HOMEBREW_CURL doesn't existXu Cheng
This can happen when `HOMEBREW_CURL` is set to brewed curl, but during `brew resinstall curl`, brewed curl's symlink is temporary unlinked. So let's fallback to /usr/bin/curl in this case.
2016-04-04utils: add analytics functions.Mike McQuaid
2016-04-04Make Homebrew user agent consistent, use a slash.Mike McQuaid
Generally it seems user agents are all `software/version` but ours is not. Also, set the user agent in a way that it's shared between Bash and Ruby code. Closes https://github.com/Homebrew/legacy-homebrew/pull/50480.
2016-04-04GitHub: fix issues/pr searchingXu Cheng
Closes #6.
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>