aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-02-01 22:20:34 -0600
committerJack Nagel2012-02-01 22:52:14 -0600
commit7f6908afb3a83c1fb5f40e97f23de6790a5231dc (patch)
tree86bc9768249e4f0be39ea30ca4c5b6a71a4ddce5 /Library
parent7e6dd757e276c9a2a765a3edfe0ce9c579e72495 (diff)
downloadhomebrew-7f6908afb3a83c1fb5f40e97f23de6790a5231dc.tar.bz2
keg: make locale directory regexp a constant
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index e6ef3e6a8..c91f90e17 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -7,6 +7,8 @@ class Keg < Pathname
raise "#{to_s} is not a directory" unless directory?
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]+(@.+)?)?/
INFOFILE_RX = %r[/share/info/[^.].*?\.info$]
# if path is a file in a keg then this will return the containing Keg object
@@ -70,9 +72,7 @@ class Keg < Pathname
link_dir('include') {:link}
link_dir('share') do |path|
- # locale-specific directories have the form
- # language[_territory][.codeset][@modifier]
- if path.to_s =~ /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
+ if path.to_s =~ LOCALEDIR_RX
:mkpath
elsif share_mkpaths.include? path.to_s
:mkpath