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:
authorJames Lopez <james@jameslopez.es>2018-11-16 13:03:45 +0300
committerJames Lopez <james@jameslopez.es>2018-11-16 13:03:45 +0300
commitf837281ff6f2e27a838eaa40a908ca6b9b47d2a0 (patch)
tree97eab377dfc4bee62c8e07cc1465de285c78b25c /lib/gitlab/file_detector.rb
parent71f4ec45c029a2b6101f6eaf849da79289915583 (diff)
Update regex to use union
Diffstat (limited to 'lib/gitlab/file_detector.rb')
-rw-r--r--lib/gitlab/file_detector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb
index 4e749068f93..2e78fc0e9c5 100644
--- a/lib/gitlab/file_detector.rb
+++ b/lib/gitlab/file_detector.rb
@@ -8,7 +8,7 @@ module Gitlab
module FileDetector
PATTERNS = {
# Project files
- readme: %r{\A(readme|index)(|\.#{Gitlab::MarkupHelper::EXTENSIONS.join('|\.')})$[^\/]*\z}i,
+ readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?$[^\/]*\z}i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i,