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
Jérome Perrin
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
lib/gitlab/ci/config/node/configurable.rb
lib/gitlab/ci/config/node/configurable.rb
+1
-7
lib/gitlab/ci/config/node/validators.rb
lib/gitlab/ci/config/node/validators.rb
+8
-0
spec/lib/gitlab/ci/config/node/validators/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
included
do
validations
do
validate
:hash_config_value
def
hash_config_value
unless
self
.
config
.
is_a?
(
Hash
)
errors
.
add
(
:config
,
'should be a configuration entry hash'
)
end
end
validates
:config
,
hash:
true
end
end
...
...
lib/gitlab/ci/config/node/validators.rb
View file @
44b00a1e
...
...
@@ -12,6 +12,14 @@ module Gitlab
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
...
...
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