summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config.rb
blob: b48d3592f1699c6473700703b299b3ccd3e6968c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Gitlab
  module Ci
    ##
    # Base GitLab CI Configuration facade
    #
    class Config
      delegate :valid?, :errors, to: :@global

      ##
      # 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 to_hash
        @config
      end
    end
  end
end