39 Commits

Author SHA1 Message Date
Patrick Linnane
5b8568defa
system_command_spec: specify exception
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-08-05 09:17:23 -07:00
Bo Anderson
19617cb161
system_command: add reset_uid option 2024-07-17 06:33:03 +01:00
Douglas Eichelberger
c1a4a806e1 rm unused OutputAsTTY helper 2024-03-30 18:44:39 -07:00
Douglas Eichelberger
820d320835 Remove and refactor rspec-its use 2024-03-17 22:47:37 -07:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Markus Reiter
00c976ce38
Fix test. 2023-10-11 09:42:22 +02:00
Markus Reiter
4b7aed84fa
Add test for print_stdout: :debug. 2023-10-10 03:42:22 +02:00
Ilya Kulakov
6a4322833f sudo: Fix tests. 2023-04-28 11:22:54 -07:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Mike McQuaid
63d8de3600
brew style --fix 2023-04-07 19:10:22 +01:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Ilya Kulakov
9ff7ceb563 sudo: pass env variables without /usr/bin/env
Using /usr/bin/env as a frontend for the actual command
prevents sudoers from restricting allowed commands and configuring
detailed command environment.
2023-02-13 22:10:35 -08:00
Douglas Eichelberger
f126f0d39b Refactor away rspec/wait 2023-01-25 10:07:42 -08:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Caleb Xu
227b8148eb
system_command: redact secrets in stdout/stderr
We already redact secrets when printing the command-line invocation
itself. Make sure that stdout/stderr doesn't leak secrets either.
2021-11-10 10:36:16 -05:00
Issy Long
e1ad07190e
rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Markus Reiter
b1b4518998 Fix sudo prompt. 2020-12-19 19:41:24 +01:00
Markus Reiter
2dd40720f0 Add test for SystemCommand with SIGINT handler. 2020-12-18 16:48:49 +01:00
Markus Reiter
3db55d13d6 Improve handling of SIGINT. 2020-12-18 16:48:49 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Bob Wombat Hogg
1a32ba3d2b system_command_spec: Make part of bash error regex optional 2020-04-05 11:05:30 -04:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Mike McQuaid
8a8fc68264
Ruby 2.6.3 brew tests fixes 2019-10-08 17:39:31 +01:00
Cheng XU
1d957c2029
system_command: automatically find secrets from ENV 2019-07-18 15:10:15 +08:00
Cheng XU
9232ca4508
system_command: allow redacting secrets in the log
Add a new argument `secrets` to specify secret tokens, so we can redact them in the log.
2019-07-18 15:06:32 +08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaid
78eba5b815
Autofix RuboCop RSpec failures 2018-09-20 13:36:42 +01:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Markus Reiter
ad7054cc88 Fix executable with spaces. 2018-08-29 19:30:08 +02:00
Markus Reiter
8ae284e871 Use SystemCommand for curl. 2018-08-01 01:04:42 +02:00
ilovezfs
cd2b85c40f
Revert "Use SystemCommand for curl." 2018-07-29 21:45:04 -07:00
Markus Reiter
355df64d93 Use SystemCommand for curl. 2018-07-29 01:23:33 +02:00
Markus Reiter
1d167a6b9f Reraise SystemCallError as ErrorDuringExecution. 2018-07-24 16:44:27 +02:00
Markus Reiter
bcf05f1a48 Remove :cask from SystemCommand specs. 2018-07-22 21:11:47 +02:00
Markus Reiter
28384ba518 Rename Hbc::SystemCommand to SystemCommand. 2018-07-22 21:11:47 +02:00