209 Commits

Author SHA1 Message Date
Mike McQuaid
1f963267b6 Update Rubocop style.
Another look at the current Rubocop rules and how they fit with our
existing and desired future style. Almost all of these changes were
automatic. Split some rules between formulae/brew where brew doesn't
have millions of cases that need fixed.
2016-10-22 13:32:46 +01:00
Andrew Janke
e72f1139ad Formatter: identifier: only reset color, not full styling 2016-10-17 00:45:37 -04:00
Markus Reiter
581a1245bf Move Formatter.columns into utils/formatter. 2016-10-15 17:22:10 +02:00
Markus Reiter
198bf4d3bd Convert puts_columns to puts Formatter.columns. 2016-10-15 17:13:38 +02:00
Markus Reiter
429327cac8 Use proc to fallback to puts. 2016-10-15 17:13:38 +02:00
Markus Reiter
5ee6df6d82 Fallback to $stdout.tty? unless respond_to?(:tty?). 2016-10-15 17:13:38 +02:00
Markus Reiter
4bfeaaf212 puts_columns only has to be defined inside module Kernel. 2016-10-15 17:13:38 +02:00
Markus Reiter
6e10f91371 Refactor puts_columns. 2016-10-15 17:13:37 +02:00
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