aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-06-12 16:47:28 +0100
committerGitHub2017-06-12 16:47:28 +0100
commited9942fbd1ec4243f0a92ab8f9b2411c8b1fb091 (patch)
treeda996e44297436c16df99318b70ea08b80a3461d /Library/Homebrew/exceptions.rb
parent22c431d221ca25413f3b63374d75173bedbe9e66 (diff)
parent7a0aff1080ba475f495353cf8686fbe928b6ebde (diff)
downloadbrew-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/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index a5388c2f4..23a123c44 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -182,7 +182,7 @@ class TapFormulaAmbiguityError < RuntimeError
@paths = paths
@formulae = paths.map do |path|
path.to_s =~ HOMEBREW_TAP_PATH_REGEX
- "#{Tap.fetch($1, $2)}/#{path.basename(".rb")}"
+ "#{Tap.fetch(Regexp.last_match(1), Regexp.last_match(2))}/#{path.basename(".rb")}"
end
super <<-EOS.undent
@@ -202,7 +202,7 @@ class TapFormulaWithOldnameAmbiguityError < RuntimeError
@taps = possible_tap_newname_formulae.map do |newname|
newname =~ HOMEBREW_TAP_FORMULA_REGEX
- "#{$1}/#{$2}"
+ "#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
end
super <<-EOS.undent
@@ -504,7 +504,7 @@ class CurlDownloadStrategyError < RuntimeError
def initialize(url)
case url
when %r{^file://(.+)}
- super "File does not exist: #{$1}"
+ super "File does not exist: #{Regexp.last_match(1)}"
else
super "Download failed: #{url}"
end