Permalink
Browse files

Merge pull request #78 from ghempton/asset-paths

Fixed asset paths.
  • Loading branch information...
2 parents 9ffa439 + e689502 commit d76bd792c053853de48081bf10b44707804f4571 @tchak tchak committed Aug 4, 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
@@ -20,8 +20,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
@@ -36,8 +40,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 d76bd79

Please sign in to comment.