merged/lib/merged.rb

22 lines
513 B
Ruby
Raw Normal View History

require "merged/version"
require "merged/engine"
module Merged
2022-12-08 15:34:20 +01:00
def self.load_data
2022-12-10 18:22:44 +01:00
["card_style" , "section_style"].each do |kind|
2022-12-08 15:34:20 +01:00
# loading egine definitions first, can be overriden
load_from kind , Engine.root.join("config/merged/#{kind}.yaml")
end
2022-12-10 18:22:44 +01:00
Option.load
2022-12-08 15:34:20 +01:00
Page.load_pages
Image.load_images
end
def self.load_from( kind , path )
return unless File.exists?(path)
clazz = "Merged::#{kind.camelcase}".constantize
clazz.load(YAML.load_file( path ))
end
end