Permalink
Browse files

Fixed asset paths.

  • Loading branch information...
1 parent a0f970a commit e689502c04354fef8ed0a9dff2c278048c2fe7e6 @ghempton ghempton committed Jul 21, 2012
Showing with 7 additions and 9 deletions.
  1. +0 −6 lib/ember/rails/engine.rb
  2. +7 −3 lib/ember_rails.rb
@@ -17,12 +17,6 @@ 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
-
- # Add the gem's vendored ember to the end of the asset search path
- variant = app.config.ember.variant
-
- ember_path = File.expand_path("../../../../vendor/ember/#{variant}", __FILE__)
- app.config.assets.paths.unshift ember_path
end
end
end
View
@@ -19,8 +19,12 @@ class Railtie < ::Rails::Railtie
end
initializer "ember_rails.setup_vendor", :after => "ember_rails.setup", :group => :all do |app|
- # Add the gem's vendored ember to the end of the asset search path
if variant = app.config.ember.variant
+ # Add the gem's vendored ember to the end of the asset search path
+ ember_path = File.expand_path("../../vendor/ember/#{variant}", __FILE__)
+ app.config.assets.paths.push(ember_path.to_s)
+
+ # Allow a local variant override
ember_path = app.root.join("vendor/assets/ember/#{variant}")
app.config.assets.paths.unshift(ember_path.to_s) if ember_path.exist?
else
@@ -35,8 +39,8 @@ class Railtie < ::Rails::Railtie
end
initializer "ember_rails.find_ember", :after => "ember_rails.setup_vendor", :group => :all do |app|
- config.ember.ember_location = location_for(app, "ember.js")
- config.ember.handlebars_location = location_for(app, "handlebars.js")
+ config.ember.ember_location ||= location_for(app, "ember.js")
+ config.ember.handlebars_location ||= location_for(app, "handlebars.js")
end
def location_for(app, file)

0 comments on commit e689502

Please sign in to comment.