Skip to content
Browse files

switch from ember development to production based on rails environment

  • Loading branch information...
1 parent 44eedab commit 167de1fa68c9700d27bd4670183e6a7f83a2cc1e @tchak tchak committed
View
2 lib/ember/handlebars/source.rb
@@ -12,7 +12,7 @@ def vendor_path
path = ::Rails.root.nil? ? '' : ::Rails.root.join('vendor/assets/javascripts/ember.js')
if !File.exists?(path)
- path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts/ember.js'))
+ path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts/production/ember.js'))
end
end
View
8 lib/ember/rails/engine.rb
@@ -12,6 +12,14 @@ class Engine < ::Rails::Engine
app.assets.register_engine '.handlebars', Ember::Handlebars::Template
app.assets.register_engine '.hbs', Ember::Handlebars::Template
app.assets.register_engine '.hjs', Ember::Handlebars::Template
+
+ assets_path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts'))
+
+ if ::Rails.env.production?
+ app.assets.append_path File.join(assets_path, 'production')
+ else
+ app.assets.append_path File.join(assets_path, 'development')
+ end
end
end
end
View
0 ...r/assets/javascripts/ember-runtime-dev.js → .../javascripts/development/ember-runtime.js
File renamed without changes.
View
0 vendor/assets/javascripts/ember-dev.js → ...r/assets/javascripts/development/ember.js
File renamed without changes.
View
0 vendor/assets/javascripts/ember-runtime.js → ...s/javascripts/production/ember-runtime.js
File renamed without changes.
View
0 vendor/assets/javascripts/ember.js → ...or/assets/javascripts/production/ember.js
File renamed without changes.

0 comments on commit 167de1f

Please sign in to comment.
Something went wrong with that request. Please try again.