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
3c5846cd
Commit
3c5846cd
authored
Jan 15, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code related to setting default config values
parent
7b712d35
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
lib/gitlab/ci/config/entry/policy.rb
lib/gitlab/ci/config/entry/policy.rb
+1
-1
lib/gitlab/config/entry/simplifiable.rb
lib/gitlab/config/entry/simplifiable.rb
+2
-0
spec/lib/gitlab/config/entry/configurable_spec.rb
spec/lib/gitlab/config/entry/configurable_spec.rb
+3
-3
No files found.
lib/gitlab/ci/config/entry/policy.rb
View file @
3c5846cd
...
...
@@ -65,7 +65,7 @@ module Gitlab
end
def
value
default
.
to_h
.
deep_merge
(
@
subject
.
value
.
to_h
)
default
.
to_h
.
deep_merge
(
subject
.
value
.
to_h
)
end
end
end
...
...
lib/gitlab/config/entry/simplifiable.rb
View file @
3c5846cd
...
...
@@ -6,6 +6,8 @@ module Gitlab
class
Simplifiable
<
SimpleDelegator
EntryStrategy
=
Struct
.
new
(
:name
,
:condition
)
attr_reader
:subject
def
initialize
(
config
,
**
metadata
)
unless
self
.
class
.
const_defined?
(
:UnknownStrategy
)
raise
ArgumentError
,
'UndefinedStrategy not available!'
...
...
spec/lib/gitlab/config/entry/configurable_spec.rb
View file @
3c5846cd
...
...
@@ -30,11 +30,11 @@ describe Gitlab::Config::Entry::Configurable do
end
describe
'configured entries'
do
let
(
:
another
)
{
double
(
'another
'
,
default:
nil
)
}
let
(
:
entry_class
)
{
double
(
'entry_class
'
,
default:
nil
)
}
before
do
entry
.
class_exec
(
another
)
do
|
another
|
entry
:object
,
another
,
description:
'test object'
entry
.
class_exec
(
entry_class
)
do
|
entry_class
|
entry
:object
,
entry_class
,
description:
'test object'
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