require 'fileutils' module Pyro module Assets def self.included(base) base.extend(ClassMethods) end module ClassMethods def template *args args = args.first templates = [] templates << "./lib/#{args[:src]}" if args[:src] if args[:dir] Dir.glob("./lib/#{args[:dir]}/**/*.{hbs, handlebars,x-handlebars}").each do |f| templates << f end end tags = '' templates.each do |t| contents = File.read t name = t.split('/').last.split('.').first tags << "\n\n" end tags end end end end