Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 03:07:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 03:07:49 +0300
commit77237c5a6b9044f58beabc54d3589e5fa09cbfba (patch)
treef43188047fe8955f6cf78e05ae9c2e8f6a019e0b /lib/gitlab/path_regex.rb
parent2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/path_regex.rb')
-rw-r--r--lib/gitlab/path_regex.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/gitlab/path_regex.rb b/lib/gitlab/path_regex.rb
index 9606e3e134c..db094bfe973 100644
--- a/lib/gitlab/path_regex.rb
+++ b/lib/gitlab/path_regex.rb
@@ -237,8 +237,32 @@ module Gitlab
}x
end
+ def full_snippets_repository_path_regex
+ %r{\A(#{personal_snippet_repository_path_regex}|#{project_snippet_repository_path_regex})\z}
+ end
+
+ def personal_and_project_snippets_path_regex
+ %r{#{personal_snippet_path_regex}|#{project_snippet_path_regex}}
+ end
+
private
+ def personal_snippet_path_regex
+ /snippets/
+ end
+
+ def personal_snippet_repository_path_regex
+ %r{#{personal_snippet_path_regex}/\d+}
+ end
+
+ def project_snippet_path_regex
+ %r{#{full_namespace_route_regex}/#{project_route_regex}/snippets}
+ end
+
+ def project_snippet_repository_path_regex
+ %r{#{project_snippet_path_regex}/\d+}
+ end
+
def single_line_regexp(regex)
# Turns a multiline extended regexp into a single line one,
# because `rake routes` breaks on multiline regexes.