aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/global.rb
AgeCommit message (Collapse)Author
2017-06-28Refactor using `Forwardable` and `DelegateClass`.Markus Reiter
2017-06-12Autocorrect Rubocop Style/SpecialGlobalVars.Mike McQuaid
2017-04-30Make `PATH` enumerable.Markus Reiter
2017-04-30Use `PATH` where possible.Markus Reiter
2017-04-30Add `PATH` class.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-23Fix and remove various TODOs.Mike McQuaid
Fix those that can be done so without tearing Homebrew to pieces and remove the comments for those that can never be done.
2017-04-23global: set HOMEBREW_PATH if unset.Mike McQuaid
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-02-21brew uninstal alias for brew uninstallilovezfs
If `brew instal` is permissible, `brew uninstal` should be, too.
2017-02-12Use HTTPS for the homepage.Mike McQuaid
2017-01-26audit: improve homepage audit reliability.Mike McQuaid
Try first with an (exact, actual) browser user agent from Safari and then try again with the default Homebrew `curl` user agent.
2017-01-07Allow `brew audit` to fake a Safari user-agent.Mike McQuaid
This allows us to detect if homepages such as e.g. `aiccu` which blocks `curl` are up or not.
2016-12-29curl: make curl_args more configurable.Mike McQuaid
Allow configuring whether output should be shown or the default the default user agent is used.
2016-11-14Remove `flat_map` compatibility layer.Markus Reiter
2016-10-02Use `module_function` for commands.Markus Reiter
2016-09-23Style/Alias: Prefer `alias`.Markus Reiter
2016-09-17Improve rescue nesting.Mike McQuaid
2016-09-17rubocop --auto-correct all remaining files.Mike McQuaid
But remove some manual `.freeze`s on constants that shouldn't be constants.
2016-09-16Move LinkedKegs/PinnedKegs/Locks from Library.Mike McQuaid
These don't make sense to be tied to the `HOMEBREW_REPOSITORY` but instead should live in the `HOMEBREW_PREFIX` as they all relate to its state.
2016-09-15Use constants for LinkedKegs/PinnedKegs/Locks.Mike McQuaid
These definitions are scattered throughout the codebase which makes it hard to refactor them later (my goal is to move them outside of HOMEBREW_LIBRARY). Unify their definitions for clearer code and easier movement later.
2016-08-18remove ruby 1.8 compatible codesXu Cheng
2016-08-17global: raise unless Ruby 2.Mike McQuaid
2016-08-12global: add Homebrew.raise_deprecation_exceptionsMike McQuaid
2016-07-12github: produce better curl error messages. (#441)Mike McQuaid
* global: add RUBY_TWO global variable. * test-bot: use RUBY_TWO global variable. * github: produce better curl error messages. If we don't know why curl has failed then ensure that the error messages that it produced are included as part of the user output.
2016-07-07Use GitRepositoryExtension for HOMEBREW_REPOSITORYMartin Afanasjew
2016-07-07Add GitRepositoryExtensionMartin Afanasjew
Add an extension for accessing Git-related meta data that can be mixed in into a Pathname object (e.g. `HOMBREW_REPOSITORY` or the path of a `Tap` instance). The goal here is to eliminate code duplication.
2016-07-04Revert "Revert "Test officially supported cmd taps. (#390)""Mike McQuaid
This reverts commit dba1958bd79c1c9d18f215dfc2b806ea62edd1c8.
2016-07-04Revert "Test officially supported cmd taps. (#390)"Martin Afanasjew
This reverts commit 252c701c59227c385ef6178fe99523cca8c843bb. Taps installed prior to running the test suite are not visible to the test suite as most Homebrew paths are redefined as to not mess up the local installation.
2016-07-04Test officially supported cmd taps. (#390)Mike McQuaid
All of these taps use Homebrew internal APIs (or will shortly) and we autoinstall them all from `brew $CMD`. We should adjust our CI to ensure that we never accidentally break these taps when making changes to core code so that these taps can rely more on this core code rather than having to e.g. vendor equivalent code that never changes on our end.
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-26HOMEBREW_CURL_ARGS: add -R to preserve remote timestampXu Cheng
Reference from `man curl` > -R, --remote-time > When used, this will make curl attempt to figure out the time- > stamp of the remote file, and if that is available make the > local file get that same timestamp.
2016-04-12Homebrew (opt-in) Analytics tweaks. (#57)Mike McQuaid
- add `HOMEBREW_PRODUCT` global variable - only differentiate between `/usr/local` and `non-/usr/local` Homebrew prefixes to avoid sharing sensitive user information - note if e.g. build errors are occurring under CI - Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out when this is enabled for everyone) - Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics that are sent - Move Bash analytics code to `Library/Homebrew/utils/analytics.sh` - Add documentation for our analytics and why/what/when/how and opt-out - Only official Homebrew commands are reported - Ruby analytics are now reported in a forked, background process
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-02audit/test-bot/pull: fix for core/formula separationXu Cheng
All formulae are in taps now.
2016-03-11Fix `brew update` user agent.Mike McQuaid
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately filtered. Closes Homebrew/homebrew#49961. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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-15Move internal command aliases from Ruby to Bash.Mike McQuaid
This means that internal command aliases can be used for Bash commands (such as the new, Bash-based `brew update`). Fixes Homebrew/homebrew#49182. Closes Homebrew/homebrew#49184. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-13pull: use tap objectXu Cheng
Fix the regression introduced by Homebrew/homebrew#46735.
2015-10-18MacOS: full_version addedBaptiste Fontaine
Closes Homebrew/homebrew#44988. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-06backport flat_map for Ruby 1.8Xu Cheng
Code is copied from https://github.com/marcandre/backports/blob/master/lib/backports/1.9.2/enumerable/flat_map.rb (MIT License by Marc-Andre Lafortune) Closes Homebrew/homebrew#42543. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-03add `brew command`Xu Cheng
Closes Homebrew/homebrew#41034. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-19Remove backports for Ruby 1.8.6Jack Nagel
refs. Homebrew/linuxbrew#438, mistydemeo/tigerbrew#327, mistydemeo/tigerbrew#334
2015-06-16"Mac OS X" -> "OS X" in copyJack Nagel
2015-04-29Extract runtime configuration from global.rbJack Nagel
This allows global.rb to be safely loaded in the test environment.
2015-04-21Inline error messageJack Nagel
2014-12-08Document Formula attributes.Mike McQuaid
The beginnings of some decent API documentation. Also, tweak `.yardopts` to better fix our internal style.
2014-07-21Ruby 1.8 doesn't have the \h regexp metacharacterJack Nagel
2014-07-19Improve pull request URL regexpJack Nagel
- use a regexp literal and avoid escaping forward slashes - escape the period in "github.com" - match only hex characters in the commit part - allow hyphen in usernames and repo names, matching what we allow for tap names - avoid unnecessary capture