class LB::Project::Config

Configuration

Constants

ERROR_MSG
RequiredString

Public Class Methods

load(path, klass = LB::Project::Config) click to toggle source
# File lib/lb/project/config.rb, line 15
def self.load(path, klass = LB::Project::Config)
  raise ArgumentError, ERROR_MSG unless klass <= LB::Project::Config

  raise ArgumentError, not_found_msg(path) unless File.exist?(path)

  yaml = YAML.load_file(path)
  klass.new(yaml.transform_keys!(&:to_sym))
end
not_found_msg(path) click to toggle source
# File lib/lb/project/config.rb, line 24
def self.not_found_msg(path)
  "load failed: config file '#{path}' does not exist!"
end