FIX: HTMLBars compilation was broken in production mode

This commit is contained in:
Robin Ward
2015-05-07 10:52:31 -04:00
parent 098556c78d
commit d9e5302a16
6 changed files with 22 additions and 47330 deletions

View File

@ -3,11 +3,11 @@ module Ember
class Template < Tilt::Template
# Wrap in an IIFE in development mode to get the correct filename
def compile_ember_handlebars(string)
def compile_ember_handlebars(string, ember_template = 'Handlebars')
if ::Rails.env.development?
"(function() { try { return Ember.Handlebars.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()"
"(function() { try { return Ember.#{ember_template}.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()"
else
"Handlebars.compile(#{indent(string).inspect});"
"Ember.#{ember_template}.compile(#{indent(string).inspect});"
end
end
end