aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap_constants.rb
diff options
context:
space:
mode:
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)