diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-14 18:55:38 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-19 14:09:39 +0100 |
commit | c3bd3bfc6e1990f4774bcd678deef1eb202a2680 (patch) | |
tree | 89d59fa8513716b5b00a49a293752c9f7533e869 /lib | |
parent | 321506c7431788e23e12a196ee1b77c0af2ea5f6 (diff) | |
download | gitlab-ce-c3bd3bfc6e1990f4774bcd678deef1eb202a2680.tar.gz |
Improve variables supportimprove-variables-support
This ensures that variables accept only string,
alongside also improves kubernetes_namespace,
improving validation and default value being set.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/variables/collection/item.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 2bb09684441..2ef54658a11 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -53,4 +53,8 @@ module Gitlab def self.pre_release? VERSION.include?('pre') end + + def self.version_info + Gitlab::VersionInfo.parse(Gitlab::VERSION) + end end diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb index fdf852e8788..cf8958e34c2 100644 --- a/lib/gitlab/ci/variables/collection/item.rb +++ b/lib/gitlab/ci/variables/collection/item.rb @@ -6,8 +6,8 @@ module Gitlab class Collection class Item def initialize(key:, value:, public: true, file: false) - raise ArgumentError, "`value` must be of type String, while it was: #{value.class}" unless - value.is_a?(String) || value.nil? + raise ArgumentError, "`#{key}` must be of type String, while it was: #{value.class}" unless + value.is_a?(String) @variable = { key: key, value: value, public: public, file: file |