lib/uptriever/config.rb in uptriever-0.1.0 vs lib/uptriever/config.rb in uptriever-0.1.1
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require "yaml"
+require "erb"
module Uptriever
class Config
def self.parse(path) = new(path).documents
@@ -38,10 +39,12 @@
end
end
private
- def config = @config ||= YAML.load_file(config_path)
+ def config
+ @config ||= YAML.load(ERB.new(File.read(config_path)).result)
+ end
def unwrap_pages(items)
items.flat_map do |item|
if item.is_a?(String)
Dir.glob(File.expand_path(File.join(root_dir, item))).map { {"source" => _1} }