Sha256: e2a89f3bd76d07bb4f80764bfb67561ac1488ca523bd4b98318e0466dfcb0133
Contents?: true
Size: 619 Bytes
Versions: 7
Compression:
Stored size: 619 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('javascripts', 'handlebars.js') end def assets_path @assets_path ||= Pathname(__FILE__).dirname.join('..','..','vendor','assets') end end end end
Version data entries
7 entries across 7 versions & 1 rubygems