From d8c15c8fbf59ff3f21dcc1004d8e7cf0d3813cf4 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 3 May 2014 14:56:10 -0500 Subject: The \w character class already includes underscore Newer versions of Ruby issue a warning for repeated character classes. --- Library/Homebrew/cmd/tap.rb | 4 ++-- Library/Homebrew/cmd/update.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 15ebacb61..b24c70e87 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -107,7 +107,7 @@ module Homebrew extend self end def tap_args - ARGV.first =~ %r{^([\w_-]+)/(homebrew-)?([\w_-]+)$} + ARGV.first =~ %r{^([\w-]+)/(homebrew-)?([\w-]+)$} raise "Invalid tap name" unless $1 && $3 [$1, $3] end @@ -122,7 +122,7 @@ module Homebrew extend self def tap_ref(path) case path.to_s - when %r{^#{HOMEBREW_LIBRARY}/Taps/([\w_-]+)/([\w_-]+)/(.+)} + when %r{^#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)/(.+)} "#$1/#$2/#{File.basename($3, '.rb')}" when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)} "Homebrew/homebrew/#{File.basename($1, '.rb')}" diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index f89207966..45f8251ba 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -219,7 +219,7 @@ class Report < Hash def tapped_formula_for key fetch(key, []).select do |path| case path.relative_path_from(HOMEBREW_REPOSITORY).to_s - when %r{^Library/Taps/([\w_-]+/[\w_-]+/.*)} + when %r{^Library/Taps/([\w-]+/[\w-]+/.*)} valid_formula_location?($1) else false @@ -250,7 +250,7 @@ class Report < Hash case path.relative_path_from(HOMEBREW_REPOSITORY).to_s when %r{^Library/Formula} path.basename(".rb").to_s - when %r{^Library/Taps/([\w_-]+)/(homebrew-)?([\w_-]+)/(.*)\.rb} + when %r{^Library/Taps/([\w-]+)/(homebrew-)?([\w-]+)/(.*)\.rb} "#$1/#$3/#{path.basename(".rb")}" end end.compact.sort -- cgit v1.2.3