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

@ -42,7 +42,7 @@ gem 'active_model_serializers', '~> 0.8.3'
gem 'onebox'
gem 'ember-rails'
gem 'ember-source', '1.9.0.beta.4'
gem 'ember-source', '1.11.3.1'
gem 'handlebars-source', '2.0.0'
gem 'barber'
gem 'babel-transpiler'

View File

@ -45,10 +45,9 @@ GEM
babel-transpiler (0.6.0)
babel-source (>= 4.0, < 5)
execjs (~> 2.0)
barber (0.5.0)
ember-source
execjs
handlebars-source (>= 1.0.0.rc.4)
barber (0.9.0)
ember-source (>= 1.0, < 2)
execjs (>= 1.2, < 3)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
@ -68,23 +67,23 @@ GEM
docile (1.1.5)
dotenv (1.0.2)
email_reply_parser (0.5.8)
ember-data-source (0.14)
ember-source
ember-rails (0.14.1)
ember-data-source (1.0.0.beta.16.1)
ember-source (~> 1.8)
ember-handlebars-template (0.1.5)
barber (>= 0.9.0)
sprockets (>= 2.1, < 3.1)
ember-rails (0.18.2)
active_model_serializers
barber (>= 0.4.1)
ember-data-source
ember-source
execjs (>= 1.2)
handlebars-source
ember-data-source (>= 1.0.0.beta.5)
ember-handlebars-template (>= 0.1.1, < 1.0)
ember-source (>= 1.1.0)
jquery-rails (>= 1.0.17)
railties (>= 3.1)
ember-source (1.9.0.beta.4)
handlebars-source (~> 2.0)
ember-source (1.11.3.1)
erubis (2.7.0)
eventmachine (1.0.7)
excon (0.44.4)
execjs (2.4.0)
execjs (2.5.2)
exifr (1.1.3)
fabrication (2.9.8)
fakeweb (1.3.0)
@ -220,7 +219,7 @@ GEM
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.2)
minitest (5.6.0)
minitest (5.6.1)
mocha (1.1.0)
metaclass (~> 0.0.1)
mock_redis (0.14.0)
@ -295,7 +294,7 @@ GEM
qunit-rails (0.0.7)
railties
r2 (0.2.5)
rack (1.5.2)
rack (1.5.3)
rack-mini-profiler (0.9.3)
rack (>= 1.1.3)
rack-openid (1.3.1)
@ -467,7 +466,7 @@ DEPENDENCIES
certified
email_reply_parser
ember-rails
ember-source (= 1.9.0.beta.4)
ember-source (= 1.11.3.1)
eventmachine
fabrication (= 2.9.8)
fakeweb (~> 1.3.0)

View File

@ -1,7 +1,7 @@
<%
if Rails.env.development? || Rails.env.test?
require_asset ("ember-template-compiler.js")
require_asset ("ember.debug.js")
require_asset ("ember.custom.debug.js")
else
require_asset ("ember.prod.js")
end

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

File diff suppressed because it is too large Load Diff