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
eb151e77
Commit
eb151e77
authored
Jul 04, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract CI configuration entry node factory method
parent
b4f03e8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
lib/gitlab/ci/config/node/factory.rb
lib/gitlab/ci/config/node/factory.rb
+12
-8
No files found.
lib/gitlab/ci/config/node/factory.rb
View file @
eb151e77
...
@@ -21,20 +21,24 @@ module Gitlab
...
@@ -21,20 +21,24 @@ module Gitlab
def
create!
def
create!
raise
InvalidFactory
unless
@attributes
.
has_key?
(
:value
)
raise
InvalidFactory
unless
@attributes
.
has_key?
(
:value
)
fabricate
.
tap
do
|
entry
|
entry
.
key
=
@attributes
[
:key
]
entry
.
parent
=
@attributes
[
:parent
]
entry
.
description
=
@attributes
[
:description
]
end
end
private
def
fabricate
##
##
# We assume that unspecified entry is undefined.
# We assume that unspecified entry is undefined.
# See issue #18775.
# See issue #18775.
#
#
if
@attributes
[
:value
].
nil?
if
@attributes
[
:value
].
nil?
node
,
value
=
Node
::
Undefined
,
@node
Node
::
Undefined
.
new
(
@node
)
else
else
node
,
value
=
@node
,
@attributes
[
:value
]
@node
.
new
(
@attributes
[
:value
])
end
node
.
new
(
value
).
tap
do
|
entry
|
entry
.
key
=
@attributes
[
:key
]
entry
.
parent
=
@attributes
[
:parent
]
entry
.
description
=
@attributes
[
:description
]
end
end
end
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