Sha256: 3d8e0eb9eaeb50164624582dacedbfeb438c55f582565b0274669461133a7917
Contents?: true
Size: 582 Bytes
Versions: 9
Compression:
Stored size: 582 Bytes
Contents
require "yaml" module Middleman::Features::Data class << self def registered(app) app.helpers Middleman::Features::Data::Helpers end alias :included :registered end module Helpers def data @@data ||= Middleman::Features::Data::DataObject.new(self) end end class DataObject def initialize(app) @app = app end def method_missing(path) file_path = File.join(@app.class.root, "data", "#{path}.yml") if File.exists? file_path return YAML.load_file(file_path) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems