Module: Proteus::Config

Included in:
BackendInfo
Defined in:
lib/proteus/config/config.rb

Defined Under Namespace

Classes: ConfigValidator

Instance Method Summary collapse

Instance Method Details

#configObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/proteus/config/config.rb', line 3

def config
  unless @config
    @config = YAML.load(File.read(File.expand_path(config_path))).with_indifferent_access
    begin
      validator = ConfigValidator.new(@config)
    rescue Proteus::Validators::ValidationError => validation_error
      say "ConfigValidator: #{validation_error.message} [#{config_path}] #{"\u2718".encode('utf-8')}", :red
      exit 1
    end
  end

  @config
end