Commit 67e90a12 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Make fabrication of default config entry more readable

parent 8b185467
......@@ -150,7 +150,7 @@ module Gitlab
stage: stage_value,
cache: cache_value,
only: only_value,
except: except_value.to_h,
except: except_value,
variables: variables_defined? ? variables_value : nil,
environment: environment_defined? ? environment_value : nil,
environment_name: environment_defined? ? environment_value[:name] : nil,
......
......@@ -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
 
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment