Skip to content

Commit

Permalink
Merge pull request #17888 from Homebrew/bin-pathname-audit-bugs
Browse files Browse the repository at this point in the history
rubocops/text: Allow all "#{bin}/foo" interpolated strings with spaces
  • Loading branch information
issyl0 authored Jul 28, 2024
2 parents 6509dc1 + f0084e6 commit df6b06c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/rubocops/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def path_starts_with?(path, starts_with, bin: false)
end

def path_starts_with_bin?(path, starts_with)
return false if path.include?(" ")

path_starts_with?(path, starts_with, bin: true)
end

Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/test/rubocops/text/strict_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class Foo < Formula
class Foo < Formula
test do
shell_output("\#{bin}/foo --version")
assert_match "help", shell_output("\#{bin}/foo-something --help 2>&1")
assert_match "OK", shell_output("\#{bin}/foo-something_else --check 2>&1")
end
end
RUBY
Expand Down

0 comments on commit df6b06c

Please sign in to comment.