summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-13 14:00:14 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-13 14:00:14 +0100
commit0cf0a7a898f06fc2a154683e76dc9199832c01c8 (patch)
tree53444ffaea62bfc5d10f552e6031d8f8128656dc /lib
parenta4a29e2ee1970d939a8b9ea9853261120c2eff3d (diff)
downloadgitlab-ce-0cf0a7a898f06fc2a154683e76dc9199832c01c8.tar.gz
DRY project-level predefined variables
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/variables/collection/item.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb
index d6540e86fc5..1ed07cedd55 100644
--- a/lib/gitlab/ci/variables/collection/item.rb
+++ b/lib/gitlab/ci/variables/collection/item.rb
@@ -14,6 +14,10 @@ module Gitlab
}
end
+ def [](key)
+ @variable.fetch(key)
+ end
+
def ==(other)
to_hash == self.class.fabricate(other).to_hash
end
@@ -39,6 +43,8 @@ module Gitlab
self.new(resource.to_hash)
when ::Ci::PipelineVariable
self.new(resource.to_hash)
+ when ::Ci::GroupVariable
+ self.new(resource.to_hash)
when self
resource.dup
else