mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
This makes use of `ActiveModel::Validations` encapsulated in a separate class that is accessible from a node object.
33 lines
548 B
Ruby
33 lines
548 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?
|
|
@global.valid?
|
|
end
|
|
|
|
def errors
|
|
@global.errors
|
|
end
|
|
|
|
def to_hash
|
|
@config
|
|
end
|
|
end
|
|
end
|
|
end
|