diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-13 08:50:12 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-13 08:50:12 +0200 |
commit | 7c8f3b0cfc38838755a21641e402b3ef7a1f9d0b (patch) | |
tree | 0d34247e119cb70daa7b6a4aeb12299284950be6 /lib | |
parent | cc373a35504bc1f92f1a040c87a712a6480757ec (diff) | |
download | gitlab-ce-7c8f3b0cfc38838755a21641e402b3ef7a1f9d0b.tar.gz |
Duplicate CI config node factory on class level
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config/node/configurable.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/node/entry.rb | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab/ci/config/node/configurable.rb b/lib/gitlab/ci/config/node/configurable.rb index 650c6efba63..f2383e07aa7 100644 --- a/lib/gitlab/ci/config/node/configurable.rb +++ b/lib/gitlab/ci/config/node/configurable.rb @@ -37,7 +37,9 @@ module Gitlab end class_methods do - attr_reader :allowed_nodes + def allowed_nodes + Hash[@allowed_nodes.map { |key, factory| [key, factory.dup] } ] + end private diff --git a/lib/gitlab/ci/config/node/entry.rb b/lib/gitlab/ci/config/node/entry.rb index 2f327fa9bf3..e5692e72947 100644 --- a/lib/gitlab/ci/config/node/entry.rb +++ b/lib/gitlab/ci/config/node/entry.rb @@ -27,8 +27,8 @@ module Gitlab end def compose! - allowed_nodes.each do |key, factory| - @nodes[key] = create_node(key, factory.dup) + allowed_nodes.each do |key, essence| + @nodes[key] = create_node(key, essence) end end @@ -62,7 +62,7 @@ module Gitlab private - def create_node(key, factory) + def create_node(key, essence) raise NotImplementedError end end |