The \w character class already includes underscore
Newer versions of Ruby issue a warning for repeated character classes.
This commit is contained in:
parent
61dd796f25
commit
d8c15c8fbf
@ -107,7 +107,7 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tap_args
|
def tap_args
|
||||||
ARGV.first =~ %r{^([\w_-]+)/(homebrew-)?([\w_-]+)$}
|
ARGV.first =~ %r{^([\w-]+)/(homebrew-)?([\w-]+)$}
|
||||||
raise "Invalid tap name" unless $1 && $3
|
raise "Invalid tap name" unless $1 && $3
|
||||||
[$1, $3]
|
[$1, $3]
|
||||||
end
|
end
|
||||||
@ -122,7 +122,7 @@ module Homebrew extend self
|
|||||||
|
|
||||||
def tap_ref(path)
|
def tap_ref(path)
|
||||||
case path.to_s
|
case path.to_s
|
||||||
when %r{^#{HOMEBREW_LIBRARY}/Taps/([\w_-]+)/([\w_-]+)/(.+)}
|
when %r{^#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)/(.+)}
|
||||||
"#$1/#$2/#{File.basename($3, '.rb')}"
|
"#$1/#$2/#{File.basename($3, '.rb')}"
|
||||||
when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)}
|
when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)}
|
||||||
"Homebrew/homebrew/#{File.basename($1, '.rb')}"
|
"Homebrew/homebrew/#{File.basename($1, '.rb')}"
|
||||||
|
|||||||
@ -219,7 +219,7 @@ class Report < Hash
|
|||||||
def tapped_formula_for key
|
def tapped_formula_for key
|
||||||
fetch(key, []).select do |path|
|
fetch(key, []).select do |path|
|
||||||
case path.relative_path_from(HOMEBREW_REPOSITORY).to_s
|
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)
|
valid_formula_location?($1)
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
@ -250,7 +250,7 @@ class Report < Hash
|
|||||||
case path.relative_path_from(HOMEBREW_REPOSITORY).to_s
|
case path.relative_path_from(HOMEBREW_REPOSITORY).to_s
|
||||||
when %r{^Library/Formula}
|
when %r{^Library/Formula}
|
||||||
path.basename(".rb").to_s
|
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")}"
|
"#$1/#$3/#{path.basename(".rb")}"
|
||||||
end
|
end
|
||||||
end.compact.sort
|
end.compact.sort
|
||||||
|
|||||||
@ -85,8 +85,8 @@ HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY
|
|||||||
|
|
||||||
HOMEBREW_CURL_ARGS = '-f#LA'
|
HOMEBREW_CURL_ARGS = '-f#LA'
|
||||||
|
|
||||||
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w_-]+)/([\w_-]+)/([\w_-]+)$}
|
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w-]+)$}
|
||||||
HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/([\w_-]+)/([\w_-]+)}
|
HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)}
|
||||||
HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source \
|
HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source \
|
||||||
+ %r{/(.*)}.source)
|
+ %r{/(.*)}.source)
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ HOMEBREW_WWW = 'http://example.com'
|
|||||||
HOMEBREW_CURL_ARGS = '-fsLA'
|
HOMEBREW_CURL_ARGS = '-fsLA'
|
||||||
HOMEBREW_VERSION = '0.9-test'
|
HOMEBREW_VERSION = '0.9-test'
|
||||||
|
|
||||||
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w_-]+)/([\w_-]+)/([\w_-]+)$}
|
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w-]+)$}
|
||||||
|
|
||||||
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
|
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
|
||||||
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
|
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user