summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/node/configurable.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-09 10:53:56 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-09 10:53:56 +0200
commit6a319fd28790228295de19d8c786d1a807f73376 (patch)
tree9c2bab1bd179576f4d46bf5adc7981ea9f23b982 /lib/gitlab/ci/config/node/configurable.rb
parentd9d5042fd9edf2abd662566ddc4c65b6a9bdbb08 (diff)
downloadgitlab-ce-6a319fd28790228295de19d8c786d1a807f73376.tar.gz
Make it possible configure Ci entry description
Diffstat (limited to 'lib/gitlab/ci/config/node/configurable.rb')
-rw-r--r--lib/gitlab/ci/config/node/configurable.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/gitlab/ci/config/node/configurable.rb b/lib/gitlab/ci/config/node/configurable.rb
index 9c04a1cdc08..4b33fe025bb 100644
--- a/lib/gitlab/ci/config/node/configurable.rb
+++ b/lib/gitlab/ci/config/node/configurable.rb
@@ -11,14 +11,19 @@ module Gitlab
private
- def add_node(key, entry_class)
+ def add_node(key, metadata)
+ entry = create_entry(key, metadata[:class])
+ entry.description = metadata[:description]
+
+ @nodes[key] = entry
+ end
+
+ def create_entry(key, entry_class)
if @value.has_key?(key)
- entry = entry_class.new(@value[key], @root, self)
+ entry_class.new(@value[key], @root, self)
else
- entry = Node::Null.new(nil, @root, self)
+ Node::Null.new(nil, @root, self)
end
-
- @nodes[key] = entry
end
class_methods do
@@ -26,8 +31,10 @@ module Gitlab
private
- def add_node(symbol, entry_class)
- node = { symbol.to_sym => entry_class }
+ def add_node(symbol, entry_class, metadata)
+ node = { symbol.to_sym =>
+ { class: entry_class,
+ description: metadata[:description] } }
(@nodes ||= {}).merge!(node)
end