diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-01-14 16:27:31 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-01-14 16:27:31 +0300 |
commit | 67e90a123f4086b9110f081b204be2250459bbc7 (patch) | |
tree | d9392a54942caddd55eef89cff623b7f0871d49d /lib/gitlab/config | |
parent | 8b185467e4e9d1ef09143964b8a0f5fada2852f3 (diff) |
Make fabrication of default config entry more readable
Diffstat (limited to 'lib/gitlab/config')
-rw-r--r-- | lib/gitlab/config/entry/factory.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab/config/entry/factory.rb b/lib/gitlab/config/entry/factory.rb index 39edfa332b4..089a20dd324 100644 --- a/lib/gitlab/config/entry/factory.rb +++ b/lib/gitlab/config/entry/factory.rb @@ -53,10 +53,12 @@ module Gitlab # If entry has a default value we fabricate concrete node # with default value. # - if @entry.default(@attributes).nil? - fabricate(Entry::Undefined) - else - fabricate(@entry, @entry.default(@attributes)) + @entry.default(@attributes).yield_self do |default| + if default.nil? + fabricate(Entry::Undefined) + else + fabricate(@entry, default) + end end end |