class Dandy::TemplateLoader

Public Class Methods

new(dandy_config) click to toggle source
# File lib/dandy/loaders/template_loader.rb, line 3
def initialize(dandy_config)
  @directory = File.join(dandy_config[:path][:views], '**/*')
end

Public Instance Methods

load_templates() click to toggle source
# File lib/dandy/loaders/template_loader.rb, line 7
def load_templates
  result = {}

  files = Dir.glob(@directory).reject {|file_path| File.directory? file_path}
  files.each do |file|
    path = File.join Dir.pwd, file
    content = File.read(path)
    result[file] = content
  end

  result
end