d2b708ac43
With this approach it would be easier to add different sources of configuration, that we do not necessairly have to be in YAML format.
21 lines
362 B
Ruby
21 lines
362 B
Ruby
module Gitlab
|
|
module Ci
|
|
class Config
|
|
class ParserError < StandardError; end
|
|
|
|
def initialize(config)
|
|
parser = Parser.new(config)
|
|
|
|
unless parser.valid?
|
|
raise ParserError, 'Invalid configuration format!'
|
|
end
|
|
|
|
@config = parser.parse
|
|
end
|
|
|
|
def to_hash
|
|
@config
|
|
end
|
|
end
|
|
end
|
|
end
|