gitlab-org--gitlab-foss/lib/gitlab/ci/config/entry/variables.rb
Grzegorz Bizon 8b185467e4 Refactor only/except configuration policies
This commit refactors only/except policies so that these policies could
be self-contained. This also adds some changes to YAML configuration
library to provide more context to default entry value fabrication
process.
2019-01-14 14:22:13 +01:00

28 lines
573 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents environment variables.
#
class Variables < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, variables: true
end
def self.default(**)
{}
end
def value
Hash[@config.map { |key, value| [key.to_s, value.to_s] }]
end
end
end
end
end
end