2016-06-03 12:20:34 +00:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
class Config
|
2016-06-06 06:20:55 +00:00
|
|
|
class LoaderError < StandardError; end
|
2016-06-03 12:20:34 +00:00
|
|
|
|
2016-06-06 10:23:27 +00:00
|
|
|
delegate :valid?, :errors, to: :@global
|
|
|
|
|
2016-06-07 12:23:47 +00:00
|
|
|
##
|
|
|
|
# Temporary delegations that should be removed after refactoring
|
|
|
|
#
|
|
|
|
delegate :before_script, to: :@global
|
|
|
|
|
2016-06-03 12:20:34 +00:00
|
|
|
def initialize(config)
|
2016-06-08 09:38:56 +00:00
|
|
|
@config = Loader.new(config).load!
|
2016-06-03 12:20:34 +00:00
|
|
|
|
2016-06-07 10:13:22 +00:00
|
|
|
@global = Node::Global.new(@config)
|
2016-06-06 10:23:27 +00:00
|
|
|
@global.process!
|
2016-06-03 12:20:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def to_hash
|
|
|
|
@config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|