fix "enter" in guard
- you must run guard from the root of the project for this stuff to compile Change-Id: I8d35448f2c54c4ff59cfbcb792af1911f96ea8e4 Reviewed-on: https://gerrit.instructure.com/27669 Reviewed-by: Derek DeVries <ddevries@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Derek DeVries <ddevries@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
f5ee7dbfc3
commit
b154b15f01
|
@ -36,10 +36,10 @@ class EmberHbs
|
|||
|
||||
def compile_template(name, template_string)
|
||||
require "execjs"
|
||||
handlebars_source = File.read(Rails.root.join('public/javascripts/bower/handlebars/handlebars.js'))
|
||||
handlebars_source = File.read('./public/javascripts/bower/handlebars/handlebars.js')
|
||||
# execjs has no "exports" and global "var foo" does not land on "this.foo"
|
||||
shims = "; this.Handlebars = Handlebars; exports = {};"
|
||||
precompiler_source = File.read(Rails.root.join('public/javascripts/bower/ember/ember-template-compiler.js'))
|
||||
precompiler_source = File.read('./public/javascripts/bower/ember/ember-template-compiler.js')
|
||||
context = ExecJS.compile(handlebars_source + shims + precompiler_source)
|
||||
precompiled = context.eval "exports.precompile(#{template_string.inspect}).toString()", template_string
|
||||
template_module = <<-END
|
||||
|
|
|
@ -133,7 +133,7 @@ JS
|
|||
|
||||
# Compiles and caches the handlebars JavaScript
|
||||
def set_context
|
||||
handlebars_source = File.read(Rails.root.join('public/javascripts/bower/handlebars/handlebars.js'))
|
||||
handlebars_source = File.read('public/javascripts/bower/handlebars/handlebars.js')
|
||||
@context = ExecJS.compile handlebars_source
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue