BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d7e12511
Commit
d7e12511
authored
Jun 09, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method that returns allowed nodes in Ci config
parent
99ee39bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
configurable.rb
lib/gitlab/ci/config/node/configurable.rb
+1
-1
entry.rb
lib/gitlab/ci/config/node/entry.rb
+7
-7
global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+3
-3
No files found.
lib/gitlab/ci/config/node/configurable.rb
View file @
d7e12511
...
...
@@ -24,7 +24,7 @@ module Gitlab
end
end
def
key
s
def
allowed_node
s
self
.
class
.
nodes
||
{}
end
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
d7e12511
...
...
@@ -28,7 +28,7 @@ module Gitlab
end
def
compose!
key
s
.
each
do
|
key
,
entry
|
allowed_node
s
.
each
do
|
key
,
entry
|
add_node
(
key
,
entry
)
end
end
...
...
@@ -46,23 +46,23 @@ module Gitlab
end
def
leaf?
key
s
.
none?
allowed_node
s
.
none?
end
def
has_config?
@value
.
is_a?
(
Hash
)
end
def
keys
{}
end
def
errors
@errors
+
nodes
.
map
(
&
:errors
).
flatten
end
def
allowed_nodes
{}
end
def
method_missing
(
name
,
*
args
)
super
unless
key
s
.
has_key?
(
name
)
super
unless
allowed_node
s
.
has_key?
(
name
)
raise
InvalidError
unless
valid?
@nodes
[
name
].
try
(
:value
)
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
d7e12511
...
...
@@ -3,13 +3,13 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Global
do
let
(
:global
)
{
described_class
.
new
(
hash
)
}
describe
'#
key
s'
do
describe
'#
allowed_node
s'
do
it
'can contain global config keys'
do
expect
(
global
.
key
s
).
to
include
:before_script
expect
(
global
.
allowed_node
s
).
to
include
:before_script
end
it
'returns a hash'
do
expect
(
global
.
key
s
).
to
be_a
Hash
expect
(
global
.
allowed_node
s
).
to
be_a
Hash
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