gitlab-org--gitlab-foss/lib/gitlab/ci/config.rb
Grzegorz Bizon d2b708ac43 Extract CI config YAML parser to a separate class
With this approach it would be easier to add different sources of
configuration, that we do not necessairly have to be in YAML format.
2016-06-03 21:10:50 +02:00

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