module Dsc
Constants
- UndefinedAttribute
- VERSION
Public Class Methods
load_file(file_path, env: "development", optional: [])
click to toggle source
# File lib/dsc.rb, line 11 def self.load_file(file_path, env: "development", optional: []) optional_hash = optional.map { |key| [key, nil] }.to_h config_yaml = ERB.new(File.read(file_path)).result config_hash = optional_hash.merge(YAML::load(config_yaml)[env]) Dsc::Mash.new(config_hash) end