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
44b00a1e
Commit
44b00a1e
authored
Jun 17, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract CI entry config hash validation to validator
parent
2a87a55f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
configurable.rb
lib/gitlab/ci/config/node/configurable.rb
+1
-7
validators.rb
lib/gitlab/ci/config/node/validators.rb
+8
-0
array_of_strings_validator_spec.rb
...config/node/validators/array_of_strings_validator_spec.rb
+0
-0
No files found.
lib/gitlab/ci/config/node/configurable.rb
View file @
44b00a1e
...
@@ -19,13 +19,7 @@ module Gitlab
...
@@ -19,13 +19,7 @@ module Gitlab
included
do
included
do
validations
do
validations
do
validate
:hash_config_value
validates
:config
,
hash:
true
def
hash_config_value
unless
self
.
config
.
is_a?
(
Hash
)
errors
.
add
(
:config
,
'should be a configuration entry hash'
)
end
end
end
end
end
end
...
...
lib/gitlab/ci/config/node/validators.rb
View file @
44b00a1e
...
@@ -12,6 +12,14 @@ module Gitlab
...
@@ -12,6 +12,14 @@ module Gitlab
end
end
end
end
end
end
class
HashValidator
<
ActiveModel
::
EachValidator
def
validate_each
(
record
,
attribute
,
value
)
unless
value
.
is_a?
(
Hash
)
record
.
errors
.
add
(
attribute
,
'should be a configuration entry hash'
)
end
end
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/config/node/validators/array_of_strings_validator_spec.rb
deleted
100644 → 0
View file @
2a87a55f
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