gitlab-org--gitlab-foss/lib/gitlab/ci/config.rb
2016-06-15 14:09:21 +02:00

32 lines
558 B
Ruby

module Gitlab
module Ci
##
# Base GitLab CI Configuration facade
#
class Config
##
# Temporary delegations that should be removed after refactoring
#
delegate :before_script, to: :@global
def initialize(config)
@config = Loader.new(config).load!
@global = Node::Global.new(@config)
@global.process!
end
def valid?
errors.none?
end
def errors
@global.errors.map(&:to_s)
end
def to_hash
@config
end
end
end
end