Sha256: c5dc31a3d97296fd73f8a034b8f8d3f3fbd466a16ec93803cf34b62b8c5342fc
Contents?: true
Size: 785 Bytes
Versions: 14
Compression:
Stored size: 785 Bytes
Contents
# =========================================================================== # Project: Abbot - SproutCore Build Tools # Copyright: ©2011 Strobe Inc. # and contributors # =========================================================================== require "sproutcore/builders/base" require "fileutils" require "json" module SC class Builder::Handlebars < Builder::Base def readlines(src_path) if File.exist?(src_path) && !File.directory?(src_path) File.read(src_path) else "" end end def build(dst_path) template_name = entry.rootname[/^.*\/([^\/]*)$/, 1] writelines dst_path, "SC.TEMPLATES[#{template_name.inspect}] = SC.Handlebars.compile(#{readlines(entry[:source_path]).to_json})" end end end
Version data entries
14 entries across 14 versions & 1 rubygems