Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
5ff3c6d590cf
Commit
6cfe41d5
authored
May 18, 2018
by
Grzegorz Bizon
Browse files
Simplify pattern lexeme fabrication and matcher
parent
2929a2de53a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb
View file @
5ff3c6d5
...
...
@@ -6,7 +6,7 @@ module Lexeme
require_dependency
're2'
class
Pattern
<
Lexeme
::
Value
PATTERN
=
%r{^
(?<regexp>
/.+/[ismU]*
)
$}
.
freeze
PATTERN
=
%r{^/.+/[ismU]*$}
.
freeze
def
initialize
(
regexp
)
@value
=
regexp
...
...
@@ -23,7 +23,7 @@ def evaluate(variables = {})
end
def
self
.
build
(
string
)
new
(
string
.
match
(
PATTERN
)[
:regexp
]
)
new
(
string
)
end
end
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