Sha256: d54a0d6ec20fc0cc3b397ff255e71c131464675ec85ac76a5fb7f4c0272ed633
Contents?: true
Size: 855 Bytes
Versions: 17
Compression:
Stored size: 855 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 build(dst_path) template_name = entry.rootname[/^.*\/([^\/]*)$/, 1] template_code = read(entry[:source_path]) replace_static_url(template_code) writelines dst_path, "SC.TEMPLATES[#{template_name.inspect}] = SC.Handlebars.compile(#{template_code.to_json});" end def sc_static_match /\{\{(sc_static|static_url|sc_target)\(\s*['"]([^"']*?)['"]\s*\)\}\}/ end def static_url(url='') url end end end
Version data entries
17 entries across 17 versions & 1 rubygems