lib/institutions.rb in institutions-0.0.4 vs lib/institutions.rb in institutions-0.0.5
- old
+ new
@@ -1,8 +1,10 @@
# Order of paths, then order of files dictates overrides.
module Institutions
+ require 'yaml'
+ require 'erb'
require 'require_all'
require_rel 'institutions'
# Default paths/files for the module.
DEFAULT_LOADPATH = "./config"
@@ -69,10 +71,10 @@
raise NameError.new("No load path was specified.") if loadpaths.nil?
raise NameError.new("No files named #{filenames} exist to load in the configured load paths, #{loadpaths}. ") if filenames.empty?
@institutions = {}
loadfiles.each do |loadfile|
# Loop through institutions in the yaml
- YAML.load_file(loadfile).each_pair do |code, elements|
+ YAML.load(ERB.new(File.read(loadfile)).result).each_pair do |code, elements|
code = code.to_sym
# Merge the new elements or add a new Institution
@institutions.has_key?(code) ?
@institutions[code].merge(elements) :
@institutions[code] =
\ No newline at end of file