Sha256: 2f9e74116532660b6ba48b843566a1f45010848b33b1c487061c7c5c420ee80c
Contents?: true
Size: 610 Bytes
Versions: 13
Compression:
Stored size: 610 Bytes
Contents
# Based on https://github.com/josh/ruby-coffee-script require 'execjs' require 'pathname' module HandlebarsAssets class Handlebars class << self def precompile(*args) context.call('Handlebars.precompile', *args) end private def context @context ||= ExecJS.compile(source) end def source @source ||= path.read end def path @path ||= assets_path.join(HandlebarsAssets::Config.compiler) end def assets_path @assets_path ||= Pathname(HandlebarsAssets::Config.compiler_path) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems