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
d532a9cb
Commit
d532a9cb
authored
Feb 21, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add variables to pipeline expressions evaluator
parent
35354826
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
lib/gitlab/ci/pipeline/expression/statement.rb
lib/gitlab/ci/pipeline/expression/statement.rb
+4
-1
spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
+4
-0
No files found.
lib/gitlab/ci/pipeline/expression/statement.rb
View file @
d532a9cb
...
...
@@ -17,7 +17,10 @@ module Gitlab
def
initialize
(
statement
,
pipeline
)
@pipeline
=
pipeline
@lexer
=
Expression
::
Lexer
.
new
(
statement
)
@variables
=
pipeline
.
variables
# TODO
@variables
=
pipeline
.
variables
.
map
do
|
variable
|
{
variable
.
key
=>
variable
.
value
}
end
end
def
tokens
...
...
spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
View file @
d532a9cb
...
...
@@ -8,6 +8,10 @@ describe Gitlab::Ci::Pipeline::Expression::Statement do
described_class
.
new
(
text
,
pipeline
)
end
before
do
pipeline
.
variables
.
build
([
key:
'VARIABLE'
,
value:
'my variable'
])
end
describe
'#tokens'
do
it
'returns raw tokens'
do
expect
(
subject
.
tokens
.
size
).
to
eq
2
...
...
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