diff options
| author | Mike McQuaid | 2017-06-12 16:47:28 +0100 |
|---|---|---|
| committer | GitHub | 2017-06-12 16:47:28 +0100 |
| commit | ed9942fbd1ec4243f0a92ab8f9b2411c8b1fb091 (patch) | |
| tree | da996e44297436c16df99318b70ea08b80a3461d /Library/Homebrew/diagnostic.rb | |
| parent | 22c431d221ca25413f3b63374d75173bedbe9e66 (diff) | |
| parent | 7a0aff1080ba475f495353cf8686fbe928b6ebde (diff) | |
| download | brew-1.2.3.tar.bz2 | |
Merge pull request #2769 from MikeMcQuaid/rubocop-no-perl-backrefs1.2.3
rubocop: don’t allow Perl regex backrefs.
Diffstat (limited to 'Library/Homebrew/diagnostic.rb')
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 2741184cc..8be357b0d 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -49,7 +49,7 @@ module Homebrew case line.chomp # regex matches: /dev/disk0s2 489562928 440803616 48247312 91% / when /^.+\s+[0-9]+\s+[0-9]+\s+[0-9]+\s+[0-9]{1,3}%\s+(.+)/ - vols << $1 + vols << Regexp.last_match(1) end end end @@ -919,11 +919,11 @@ module Homebrew return unless which "python" `python -V 2>&1` =~ /Python (\d+)\./ # This won't be the right warning if we matched nothing at all - return if $1.nil? - return if $1 == "2" + return if Regexp.last_match(1).nil? + return if Regexp.last_match(1) == "2" <<-EOS.undent - python is symlinked to python#{$1} + python is symlinked to python#{Regexp.last_match(1)} This will confuse build scripts and in general lead to subtle breakage. EOS end |
