Permalink
Browse files

Merge pull request #60 from josepjaume/patch-3

Use the `development` variant by default
  • Loading branch information...
2 parents 14ae7ee + a1cb472 commit fb7517cc587ce8bc4b8f8e08e86d2337dd568531 @tchak tchak committed Jun 12, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/ember_rails.rb
View
@@ -20,9 +20,18 @@ class Railtie < ::Rails::Railtie
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
- variant = app.config.ember.variant
- ember_path = app.root.join("vendor/assets/ember/#{variant}")
- app.config.assets.paths.unshift(ember_path.to_s) if ember_path.exist?
+ if variant = app.config.ember.variant
+ ember_path = app.root.join("vendor/assets/ember/#{variant}")
+ app.config.assets.paths.unshift(ember_path.to_s) if ember_path.exist?
+ else
+ warn "No ember.js variant was specified in your config environment."
+ warn "You can set a specific variant in your application config in "
+ warn "order for sprockets to locate ember's assets:"
+ warn ""
+ warn " config.ember.variant = :development"
+ warn ""
+ warn "Valid values are :development and :production"
+ end
end
initializer "ember_rails.find_ember", :after => "ember_rails.setup_vendor", :group => :all do |app|

0 comments on commit fb7517c

Please sign in to comment.