From 7a0aff1080ba475f495353cf8686fbe928b6ebde Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 10 Jun 2017 20:23:20 +0300 Subject: Autocorrect Rubocop Style/PerlBackrefs. --- Library/Homebrew/cmd/info.rb | 2 +- Library/Homebrew/cmd/install.rb | 2 +- Library/Homebrew/cmd/search.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 826f31bbd..98200a0b4 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -79,7 +79,7 @@ module Homebrew def github_remote_path(remote, path) if remote =~ %r{^(?:https?://|git(?:@|://))github\.com[:/](.+)/(.+?)(?:\.git)?$} - "https://github.com/#{$1}/#{$2}/blob/master/#{path}" + "https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/blob/master/#{path}" else "#{remote}/#{path}" end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 423b47884..e413bac6f 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -80,7 +80,7 @@ module Homebrew if name !~ HOMEBREW_TAP_FORMULA_REGEX && name !~ HOMEBREW_CASK_TAP_CASK_REGEX next end - tap = Tap.fetch($1, $2) + tap = Tap.fetch(Regexp.last_match(1), Regexp.last_match(2)) tap.install unless tap.installed? end end diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 2b35dfc36..b2d069744 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -93,7 +93,7 @@ module Homebrew def query_regexp(query) case query - when %r{^/(.*)/$} then Regexp.new($1) + when %r{^/(.*)/$} then Regexp.new(Regexp.last_match(1)) else /.*#{Regexp.escape(query)}.*/i end rescue RegexpError -- cgit v1.2.3