aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/.rubocop_todo.yml10
-rw-r--r--Library/Homebrew/diagnostic.rb2
-rw-r--r--Library/Homebrew/keg.rb10
-rw-r--r--Library/Homebrew/version.rb2
4 files changed, 7 insertions, 17 deletions
diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml
index 58eb67657..c6a4f279e 100644
--- a/Library/.rubocop_todo.yml
+++ b/Library/.rubocop_todo.yml
@@ -271,16 +271,6 @@ Style/OpMethod:
- 'Homebrew/install_renamed.rb'
- 'Homebrew/options.rb'
-# Offense count: 7
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
-# SupportedStyles: slashes, percent_r, mixed
-Style/RegexpLiteral:
- Exclude:
- - 'Homebrew/diagnostic.rb'
- - 'Homebrew/keg.rb'
- - 'Homebrew/version.rb'
-
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles.
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 62e916ce1..743c653d2 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -754,7 +754,7 @@ module Homebrew
cd #{HOMEBREW_REPOSITORY}
git remote add origin https://github.com/Homebrew/brew.git
EOS
- elsif origin !~ /Homebrew\/brew(\.git)?$/
+ elsif origin !~ %r{Homebrew/brew(\.git)?$}
<<-EOS.undent
Suspicious git origin remote found.
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index e49c8126b..65ce6480a 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -62,7 +62,7 @@ class Keg
end
# locale-specific directories have the form language[_territory][.codeset][@modifier]
- LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
+ LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}
INFOFILE_RX = %r{info/([^.].*?\.info|dir)$}
TOP_LEVEL_DIRECTORIES = %w[bin etc include lib sbin share var Frameworks].freeze
ALL_TOP_LEVEL_DIRECTORIES = (TOP_LEVEL_DIRECTORIES + %w[lib/pkgconfig share/locale share/man opt]).freeze
@@ -323,13 +323,13 @@ class Keg
when "locale/locale.alias" then :skip_file
when INFOFILE_RX then :info
when LOCALEDIR_RX then :mkpath
- when /^icons\/.*\/icon-theme\.cache$/ then :skip_file
+ when %r{^icons/.*/icon-theme\.cache$} then :skip_file
# all icons subfolders should also mkpath
- when /^icons\// then :mkpath
+ when %r{^icons/} then :mkpath
when /^zsh/ then :mkpath
when /^fish/ then :mkpath
# Lua, Lua51, Lua53 all need the same handling.
- when /^lua\// then :mkpath
+ when %r{^lua/} then :mkpath
when %r{^guile/} then :mkpath
when *SHARE_PATHS then :mkpath
else :link
@@ -367,7 +367,7 @@ class Keg
# the :link strategy. However, for Foo.framework and
# Foo.framework/Versions we have to use :mkpath so that multiple formulae
# can link their versions into it and `brew [un]link` works.
- if relative_path.to_s =~ /[^\/]*\.framework(\/Versions)?$/
+ if relative_path.to_s =~ %r{[^/]*\.framework(/Versions)?$}
:mkpath
else
:link
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index b15fc3693..c0e5324ea 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -386,7 +386,7 @@ class Version
# e.g. http://mirrors.jenkins-ci.org/war/1.486/jenkins.war
# e.g. https://github.com/foo/bar/releases/download/0.10.11/bar.phar
- m = /\/(\d\.\d+(\.\d+)?)\//.match(spec_s)
+ m = %r{/(\d\.\d+(\.\d+)?)}.match(spec_s)
return m.captures.first unless m.nil?
# e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz