aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formulary.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/formulary.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/formulary.rb')
-rw-r--r--Library/Homebrew/formulary.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index ea2ad5d02..a0ccb9ba0 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -59,7 +59,7 @@ module Formulary
def self.class_s(name)
class_name = name.capitalize
- class_name.gsub!(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase }
+ class_name.gsub!(/[-_.\s]([a-zA-Z0-9])/) { Regexp.last_match(1).upcase }
class_name.tr!("+", "x")
class_name.sub!(/(.)@(\d)/, "\\1AT\\2")
class_name
@@ -168,7 +168,7 @@ module Formulary
super
rescue MethodDeprecatedError => e
if url =~ %r{github.com/([\w-]+)/homebrew-([\w-]+)/}
- e.issues_url = "https://github.com/#{$1}/homebrew-#{$2}/issues/new"
+ e.issues_url = "https://github.com/#{Regexp.last_match(1)}/homebrew-#{Regexp.last_match(2)}/issues/new"
end
raise
end