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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
59eeec3f
Commit
59eeec3f
authored
Jun 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make method that composes ci config entry private
parent
ebe14437
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
17 deletions
+8
-17
lib/gitlab/ci/config/node/configurable.rb
lib/gitlab/ci/config/node/configurable.rb
+1
-1
lib/gitlab/ci/config/node/entry.rb
lib/gitlab/ci/config/node/entry.rb
+6
-6
spec/lib/gitlab/ci/config/node/global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+0
-9
spec/lib/gitlab/ci/config/node/null_spec.rb
spec/lib/gitlab/ci/config/node/null_spec.rb
+1
-1
No files found.
lib/gitlab/ci/config/node/configurable.rb
View file @
59eeec3f
...
@@ -38,7 +38,7 @@ module Gitlab
...
@@ -38,7 +38,7 @@ module Gitlab
class_methods
do
class_methods
do
def
allowed_nodes
def
allowed_nodes
Hash
[
@allowed_nodes
.
map
{
|
key
,
factory
|
[
key
,
factory
.
dup
]
}
]
Hash
[
@allowed_nodes
.
map
{
|
key
,
factory
|
[
key
,
factory
.
dup
]
}]
end
end
private
private
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
59eeec3f
...
@@ -26,12 +26,6 @@ module Gitlab
...
@@ -26,12 +26,6 @@ module Gitlab
nodes
.
each
(
&
:validate!
)
nodes
.
each
(
&
:validate!
)
end
end
def
compose!
allowed_nodes
.
each
do
|
key
,
essence
|
@nodes
[
key
]
=
create_node
(
key
,
essence
)
end
end
def
nodes
def
nodes
@nodes
.
values
@nodes
.
values
end
end
...
@@ -62,6 +56,12 @@ module Gitlab
...
@@ -62,6 +56,12 @@ module Gitlab
private
private
def
compose!
allowed_nodes
.
each
do
|
key
,
essence
|
@nodes
[
key
]
=
create_node
(
key
,
essence
)
end
end
def
create_node
(
key
,
essence
)
def
create_node
(
key
,
essence
)
raise
NotImplementedError
raise
NotImplementedError
end
end
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
59eeec3f
...
@@ -18,15 +18,6 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -18,15 +18,6 @@ describe Gitlab::Ci::Config::Node::Global do
{
before_script:
[
'ls'
,
'pwd'
]
}
{
before_script:
[
'ls'
,
'pwd'
]
}
end
end
describe
'#compose!'
do
before
{
global
.
compose!
}
it
'instantiates entry nodes'
do
expect
(
global
.
nodes
.
first
)
.
to
be_an_instance_of
Gitlab
::
Ci
::
Config
::
Node
::
Script
end
end
describe
'#process!'
do
describe
'#process!'
do
before
{
global
.
process!
}
before
{
global
.
process!
}
...
...
spec/lib/gitlab/ci/config/node/null_spec.rb
View file @
59eeec3f
...
@@ -16,7 +16,7 @@ describe Gitlab::Ci::Config::Node::Null do
...
@@ -16,7 +16,7 @@ describe Gitlab::Ci::Config::Node::Null do
end
end
describe
'#value'
do
describe
'#value'
do
it
'returns nil
l
'
do
it
'returns nil'
do
expect
(
entry
.
value
).
to
be
nil
expect
(
entry
.
value
).
to
be
nil
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