25 Commits

Author SHA1 Message Date
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Issy Long
1295904986
sorbet: Autogenerate the RBI file for utils/tty.rb
- Sort of. It's not via Parlour, because I read the docs and all it says
  about dynamically generating things is "of course it's better to do
  that", no examples. I tried my best, but Bo's work on `attr.rb` was
  mind-boggling.
- Instead, let's add a simple but functional generator script that I
  actually understand, as an alternative to maintaining these RBI files
  for dynamic methods manually, so that we can get rid of some use of
  `srb rbi hidden-definitions` since that's deprecated.
- TODO: Run this script as part of `brew typecheck --update` so it gets
  updated with all the other RBI files periodically.
- Follow up to PR 14651.
2023-03-06 21:46:04 +00:00
Mike McQuaid
e95ce6967a
brew style --fix 2023-02-24 13:50:07 +00:00
Markus Reiter
7348185347 Reorder global. 2020-11-30 00:00:02 +01:00
Markus Reiter
61b79318ed Move include Kernel into .rbi files again and split up existing .rbi files. 2020-10-10 19:10:58 +02:00
Markus Reiter
fc7a34585f Inline type annotations for Tty. 2020-10-10 15:49:18 +02:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
nandahkrishna
56a8f8f99d
livecheck: fix TTY output for progress bar 2020-09-18 02:41:25 +05:30
nandahkrishna
cf293d0ef5
livecheck: progress bar for JSON output
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Co-authored-by: Dustin Rodrigues <dust.rod@gmail.com>
2020-09-18 02:40:51 +05:30
nandahkrishna
c1909e80b4
utils/tty: fix TTY handling for stderr 2020-09-17 04:18:13 +05:30
Markus Reiter
d8eb508500 Document Tty. 2020-08-26 03:13:58 +02:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Markus Reiter
9df563f25f Add Tty::color?. 2019-10-04 23:39:25 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
9db17ab5bc Allow forcing colored output. 2018-08-02 16:03:44 +02:00
Markus Reiter
13d9305fad Cache Tty.width, since it is used heavily because of ohai. 2018-06-15 13:56:08 +02:00
lukertty
f308aa4800
Tty.width: use tput cols when stty size returns 0;
bin/brew: add 'COLUMNS' and 'LINES' to env variables

Signed-off-by: lukertty <lukertty@gmail.com>
2018-05-30 12:29:24 +08:00
joshua stein
7388acb86e Tty: if HOMEBREW_NO_COLOR env var is present, disable color
bin/brew will recognize NO_COLOR variable and copy it to
HOMEBREW_NO_COLOR
2018-02-12 14:19:25 -06:00
Mike McQuaid
2cf2c020ba tty: handle non-tty stdin.
When stdin is not a tty then the message `stty: stdin isn't a terminal`
will be produced. Silence this message and fall back to `tput` when it
fails and default to 80 if we get no results at all.

Follow-up from #2714.
2017-06-07 06:57:50 +01:00
Enrico Ghirardi
a9c83f14a7
Use stty instead of tput to get terminal width
Fixes https://github.com/Homebrew/brew/issues/2707
2017-06-02 17:00:52 +02:00
Markus Reiter
6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00