diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-24 15:16:38 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-24 15:16:38 +0200 |
commit | 5f839770e720dc2f176c51d4635dceb6c34ff97a (patch) | |
tree | 396578cfe0a4ddb7df0adf176bfce3a6e2bf2905 /lib | |
parent | 70f9893ed697873e4c95de4f3ddb3ff8c4fb82f6 (diff) | |
download | gitlab-ce-5f839770e720dc2f176c51d4635dceb6c34ff97a.tar.gz |
Revert "Rename namespace_regex to namespace_path_regex."
This reverts commit c0116926c743818b2593474946abb40b56d8fefa.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/markdown/cross_project_reference.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/user_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/reference_extractor.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/regex.rb | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/markdown/cross_project_reference.rb b/lib/gitlab/markdown/cross_project_reference.rb index 261fc0feb0e..c436fabd658 100644 --- a/lib/gitlab/markdown/cross_project_reference.rb +++ b/lib/gitlab/markdown/cross_project_reference.rb @@ -3,7 +3,7 @@ module Gitlab # Common methods for ReferenceFilters that support an optional cross-project # reference. module CrossProjectReference - NAMING_PATTERN = Gitlab::Regex::NAMESPACE_PATH_REGEX_STR + NAMING_PATTERN = Gitlab::Regex::NAMESPACE_REGEX_STR PROJECT_PATTERN = "(?<project>#{NAMING_PATTERN}/#{NAMING_PATTERN})" # Given a cross-project reference string, get the Project record diff --git a/lib/gitlab/markdown/user_reference_filter.rb b/lib/gitlab/markdown/user_reference_filter.rb index d7885fdeefd..5fc8ed55fe2 100644 --- a/lib/gitlab/markdown/user_reference_filter.rb +++ b/lib/gitlab/markdown/user_reference_filter.rb @@ -22,7 +22,7 @@ module Gitlab end # Pattern used to extract `@user` user references from text - USER_PATTERN = /@(?<user>#{Gitlab::Regex::NAMESPACE_PATH_REGEX_STR})/ + USER_PATTERN = /@(?<user>#{Gitlab::Regex::NAMESPACE_REGEX_STR})/ def call replace_text_nodes_matching(USER_PATTERN) do |content| diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb index 1d6df9a29f1..949dd5d26b1 100644 --- a/lib/gitlab/reference_extractor.rb +++ b/lib/gitlab/reference_extractor.rb @@ -85,7 +85,7 @@ module Gitlab private - NAME_STR = Gitlab::Regex::NAMESPACE_PATH_REGEX_STR + NAME_STR = Gitlab::Regex::NAMESPACE_REGEX_STR PROJ_STR = "(?<project>#{NAME_STR}/#{NAME_STR})" REFERENCE_PATTERN = %r{ diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index e5f5482a223..0571574aa4f 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -2,13 +2,13 @@ module Gitlab module Regex extend self - NAMESPACE_PATH_REGEX_STR = '(?:[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_\-]|[a-zA-Z0-9_])'.freeze + NAMESPACE_REGEX_STR = '(?:[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_\-]|[a-zA-Z0-9_])'.freeze - def namespace_path_regex - @namespace_path_regex ||= /\A#{NAMESPACE_PATH_REGEX_STR}\z/.freeze + def namespace_regex + @namespace_regex ||= /\A#{NAMESPACE_REGEX_STR}\z/.freeze end - def namespace_path_regex_message + def namespace_regex_message "can contain only letters, digits, '_', '-' and '.'. " \ "Cannot start with '-' or end in '.'." \ end |