Sha256: e13b7b5181f66675c37a9e5e957bf7e42e4c49130ff04fbdd8240f31be599f19
Contents?: true
Size: 535 Bytes
Versions: 9
Compression:
Stored size: 535 Bytes
Contents
module KumoKeisei class FileLoader def initialize(options) @config_dir_path = options[:config_dir_path] end def load_config!(file_name, context = nil) erb_result = ERB.new(File.read(file_path(file_name))).result(context) YAML.load(erb_result) end def load_config(file_name) path = file_path(file_name) return {} unless File.exist?(path) load_config!(file_name) end private def file_path(file_name) File.join(@config_dir_path, file_name) end end end
Version data entries
9 entries across 9 versions & 1 rubygems