101 Commits

Author SHA1 Message Date
Markus Reiter
884b268506 Use Formatter for all URLs. 2016-10-01 20:00:49 +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
Alyssa Ross
e0d39cc3ef analytics: don't report commands run by Homebrew
Fixes #788.
2016-10-01 15:18:09 +01:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Markus Reiter
25d5f74f3e Fix Style/ModuleFunction. 2016-09-23 17:36:27 +02:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Mike McQuaid
b85ee1cb8f Update documentation links. 2016-09-20 10:41:42 +01:00
Mike McQuaid
3f9cce0a03 Use new "macOS" naming where appropriate.
Not quite a mass replacement as I've used OS X and Mac OS X where
describing specific older versions and added compatibility methods
for things in the DSL.
2016-09-18 19:57:19 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
e3609b6fd4 Move LinkedKegs/PinnedKegs/Locks from Library.
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-16 13:51:56 +01:00
Mike McQuaid
94f763e9c7 utils/shell: 2016-09-11 19:13:01 +01:00
Mike McQuaid
aa3d53f249 utils/shell: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Mike McQuaid
ecf46b841b utils/inreplace: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Mike McQuaid
1f2abbdd6e utils/hash: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Mike McQuaid
6cfb841524 utils/github: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Mike McQuaid
3bf5e779ab utils/curl: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Misty De Meo
e40d70c761 Utils::Shell: convert to use module_function 2016-09-05 14:45:29 +10:00
Mike McQuaid
dfcbefff73 Merge pull request #201 from gregory-nisbet/feature-env-shells
--env: support more shells, allow explicit shell selection
2016-09-04 21:23:33 +01:00
Dominyk Tiller
ff377bebc0
bottles: translate foo@1.2 to foo:1.2 2016-08-29 19:48:23 +01:00
Mike McQuaid
ed5e2ea300 utils/curl: assume Ruby 2. 2016-08-17 10:27:45 +01:00
Greg Nisbet
dcc3377aa3 move shell_profile to compat/utils.rb & deprecate 2016-08-10 23:21:30 -07:00
Greg Nisbet
bf63c08d50 tests for shell-specific diagnostic message 2016-08-10 23:21:30 -07:00
Greg Nisbet
f0cc815d86 Multi-shell diagnostic check 2016-08-10 23:21:30 -07:00
Greg Nisbet
9a29a306cf resolve conflict in diagnostic.rb 2016-08-10 23:19:09 -07:00
Mike McQuaid
4eaa40ae1f Enable vendored Ruby 2.0. 2016-08-10 20:06:14 +01:00
Martin Afanasjew
5f4111d24a utils/analytics.sh: tweak output in debug mode
Avoid some duplication (thereby also shortening line length) and put
everything in a single string for output via `echo`.
2016-08-09 21:24:39 +02:00
Mike McQuaid
18e933016c analytics.rb: URL encode reported data. 2016-08-09 19:41:30 +01:00
Mike McQuaid
2e360112e4 analytics.*: use curl --data for readability. 2016-08-09 19:41:30 +01:00
Mike McQuaid
222b730415 analytics.*: output curl command in debug mode. 2016-08-09 19:41:30 +01:00
Martin Afanasjew
b75516425b utils/analytics.sh: fix style inconsistencies 2016-08-08 16:00:12 +02:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Mike McQuaid
c3739dc441 utils/bottles: don't rely on tar wildcards, location.
This doesn’t work quite as-is on Linux’s GNU tar.
2016-07-29 21:21:02 -06:00
Mike McQuaid
541e8f28df bottles: more porting to generic layer. 2016-07-27 15:05:42 -06:00
Martin Afanasjew
87540ada6a utils/github: fix reverted order of credentials
We always return the token/password first and, if applicable, the user
name is the second element in the returned array.

Closes #581.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-07-27 21:27:25 +02:00
Martin Afanasjew
bdc1991d77 utils/github: fix broken pipe error
Closes #573.
2016-07-27 21:27:25 +02:00
Mike McQuaid
265c126349 analytics.sh: use full uuidgen path on OS X.
Fixes #575.
2016-07-24 16:35:57 -06:00
ilovezfs
45bfd2b94a inreplace: support for audit arg in non-block form
Provides feature parity between the block and non-block forms of
inreplace by creating a four-argument version of the non-block form,
where the fourth argument is an optional Boolean value, defaulting to
true, which specifies whether a failed inreplace should cause an
InreplaceError error to be raised. The fourth argument is passed along
to StringInreplaceExtension#gsub!, which already supports an optional
audit_result argument.

This resolves the Catch-22 that single replacements aren't permissible
in the block form (in that they now cause `brew audit` to complain), but
the audit_result argument is not available in the non-block form.

Closes #552.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-07-18 09:24:08 -07:00
Mike McQuaid
a02be9eea2 ENV: move to new paths. (#507)
Move some stuff formerly in `Library/ENV` around:
- Move `Library/ENV/$XCODE_VERSION` to `Library/Homebrew/env/super` as they are
  all superenv wrappers and all symlinks to the same version. We never needed
  the "separate shims for separate versions" functionality and it just adds
  confusion.
- Move `Library/ENV/pkgconfig` to `Library/Homebrew/env/pkgconfig` to get more
  things under `Library/Homebrew`
- Move `Library/ENV/scm` to `Library/scm` as these wrappers are not actually
  used by or related to superenv (or stdenv) in any way.
2016-07-15 19:03:45 +01:00
Mike McQuaid
23306ab434 github: produce better curl error messages. (#441)
* 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-12 19:46:29 +01:00
Mike McQuaid
5a2eaf9a12 ruby.sh: allow forcing the usage of the vendored Ruby. 2016-07-12 08:51:36 +01:00
Mike McQuaid
b418fe94c8 ruby.sh: fix original setup ruby path name. 2016-07-12 08:51:36 +01:00
Xu Cheng
dff6bfde9a
ruby.sh: add test flag 2016-07-11 21:12:57 +08:00
Xu Cheng
534bf08ec3
brew.sh: new HOMEBREW_RUBY_PATH resolution logic
* Use vendor Ruby if it's present
* Install vendor Ruby for system without Ruby 2.x
2016-07-11 21:12:56 +08:00
Andrew Janke
f4b3dadb64 gist-logs: close temp file before passing to curl (#418)
Ensures that the data gets written to disk so curl can see it, avoiding
intermittent JSON parsing errors in gist creation.
2016-07-03 17:21:13 -04:00
Martin Afanasjew
1c27a75ca4 utils/lock.sh: remove redundant 'local' 2016-06-29 22:38:42 +02:00
Martin Afanasjew
b1811f2ef3 analytics: make Linux UUID generation more robust
Not every Linux system has a pre-installed `uuidgen` command (Debian
has a package `uuid-runtime` but doesn't install it by default). In
contrast, `/proc/sys/kernel/random/uuid` is always available on a modern
Linux system and produces type/version 4 UUIDs, just like `uuidgen`.

Closes #416.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-06-29 21:07:25 +02:00
Martin Afanasjew
271023c5e1 analytics: handle UUID generation errors
Avoid writing an empty UUID to the Git configuration file and disable
analytics temporarily to avoid sending bogus data with an invalid UUID.
2016-06-29 21:07:25 +02:00
Martin Afanasjew
324a34d8ea utils/git: provide git_path and git_version 2016-06-19 22:12:34 +02:00
Xu Cheng
8d64b6a02d introduce global lock directory (#337)
Since #292, HOMEBREW_CACHE was moved to a per-user directory. This makes
it unsuitable to store global lock files on multiple users environment.

Therefore, introducing a global lock directory `/Library/Lock.d` to
store lock files from formula lockers as well as `brew update`.
2016-06-08 17:29:03 +08:00