Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e79123fe
Commit
e79123fe
authored
Dec 27, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve package name regex
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
fbdd411e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
ee/lib/ee/gitlab/regex.rb
ee/lib/ee/gitlab/regex.rb
+1
-1
ee/spec/lib/gitlab/regex_spec.rb
ee/spec/lib/gitlab/regex_spec.rb
+2
-0
No files found.
ee/lib/ee/gitlab/regex.rb
View file @
e79123fe
...
...
@@ -14,7 +14,7 @@ module EE
end
def
package_name_regex
@package_name_regex
||=
%r{
\A
(([
\w\-\.\@
]*)/)*([
\w\-\.
]*)
\z
}
.
freeze
@package_name_regex
||=
%r{
\A
\@
?(([
\w\-\.
]*)/)*([
\w\-\.
]*)
\z
}
.
freeze
end
def
maven_path_regex
...
...
ee/spec/lib/gitlab/regex_spec.rb
View file @
e79123fe
...
...
@@ -27,7 +27,9 @@ describe Gitlab::Regex do
it
{
is_expected
.
to
match
(
'foo'
)
}
it
{
is_expected
.
to
match
(
'foo/bar'
)
}
it
{
is_expected
.
to
match
(
'@foo/bar'
)
}
it
{
is_expected
.
to
match
(
'com/mycompany/app/my-app'
)
}
it
{
is_expected
.
not_to
match
(
'$foo/bar'
)
}
it
{
is_expected
.
not_to
match
(
'@foo/@/bar'
)
}
it
{
is_expected
.
not_to
match
(
'my package name'
)
}
it
{
is_expected
.
not_to
match
(
'!!()()'
)
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment