25 Commits

Author SHA1 Message Date
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
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
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
Douglas Eichelberger
dead4de3fc Resolve Lint/EmptyBlock todos 2023-01-26 21:18:24 -08:00
Mike McQuaid
6a25229567
brew style --fix 2023-01-02 19:18:51 +00:00
Bo Anderson
f174d4363f
extend/pathname: limit write override to a refinement 2021-05-04 14:20:20 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
3dc82bc8bf
Commit 'brew style --fix' results. 2019-07-23 17:09:57 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Shaun Jackman
5cb458d687 install_symlink_p: Fix when dest includes a symlink
install_symlink_p does not work as intended when dst includes a symlink in its path.
relative_path_from requires that both src and dst be real paths without symlinks.

From https://ruby-doc.org/stdlib-2.3.7/libdoc/pathname/rdoc/Pathname.html#method-i-relative_path_from
This method doesn't access the filesystem. It assumes no symlinks.
2019-03-16 23:11:59 -07:00
Shaun Jackman
3bcffeae15 tests: Disable tests that require being non-root
Set the environment variable USER=root which is required by
brew tests --only=utils/user

Fix these tests:
rspec ./test/diagnostic_checks_spec.rb:26 # Homebrew::Diagnostic::Checks #check_access_directories
rspec ./test/pathname_spec.rb:120 # Pathname#ensure_writable makes a file writable and restores permissions
rspec ./test/utils/user_spec.rb:22 # User#gui? when the current user is in a console session gui? should equal true
rspec ./test/utils/user_spec.rb:6 # User should eq nil
2019-02-16 12:55:09 -08:00
Markus Reiter
c430baaee8 Don’t treat .7z as part of a version. 2018-09-29 10:32:18 +02:00
Mike McQuaid
ead23d1f4c
Use ActiveSupport File.atomic_write
nd delete our own implementation.
2018-09-18 09:20:40 +01:00
Markus Reiter
8b5fa6824b Fix brew cleanup. 2018-08-11 18:03:49 +02:00
Mike McQuaid
256dfc1af9 Move methods from FileUtils to Formula
These don't need to live on FileUtils and don't really make sense there
either.
2018-07-14 18:13:23 +01:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Josh Soref
70ce9fe7f9 spelling: intermediate 2017-09-10 16:35:30 +00:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Markus Reiter
a554902380 Add mktmpdir helper method. 2017-02-28 15:06:32 +01:00
Naoto Kaneko
928eaca267 Merge branch 'master' into exclude-executable-metafiles
Added tests in keg_test and pathname_test was
moved into keg_spec and pathname_spec.
2017-02-27 14:23:53 +09:00
Jeppe Toustrup
ebaf3cdc6a Add 'B' for bytes to cleanup command output
When `brew cleanup` is run it prints out a message like the following:

> This operation has freed approximately 222M of disk space.

The '222M' refers to megabytes but the normal acronym for megabytes would be
'MB'. The 'B' is also missing from kilobytes and gigabytes in the output, so
that's what this commit adds.
2017-02-25 11:30:46 +00:00
Markus Reiter
85ff9add18 Convert Pathname test to spec. 2017-02-23 05:40:31 +01:00