aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap_constants.rb
diff options
context:
space:
mode:
authorTsukasa OMOTO2014-05-14 16:43:52 +0900
committerJack Nagel2014-05-14 11:12:51 -0500
commit724a7f84d853e978b694555ee61198c75fe409b1 (patch)
tree0fb6cb7d9801b6e83ae9695800e0da17a0c9b2b4 /Library/Homebrew/tap_constants.rb
parenta224d96687c14076c1924360ca5f04d4c668e830 (diff)
downloadhomebrew-724a7f84d853e978b694555ee61198c75fe409b1.tar.bz2
Taps: cleanup regexps around Taps
Closes #29139. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/tap_constants.rb')
-rw-r--r--Library/Homebrew/tap_constants.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/tap_constants.rb b/Library/Homebrew/tap_constants.rb
new file mode 100644
index 000000000..1757ab80e
--- /dev/null
+++ b/Library/Homebrew/tap_constants.rb
@@ -0,0 +1,8 @@
+# match expressions when taps are given as ARGS, e.g. someuser/sometap
+HOMEBREW_TAP_ARGS_REGEX = %r{^([\w-]+)/(homebrew-)?([\w-]+)$}
+# match taps' formula, e.g. someuser/sometap/someformula
+HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w-]+)$}
+# match taps' directory path, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap
+HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/([\w-]+)/([\w-]+)}
+# match taps' formula path, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula
+HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{/(.*)}.source)