Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a warning message if there isn't a variant defined

  • Loading branch information...
commit a1cb472cacf73b170f63de0d191d9f50e5608157 1 parent 14ae7ee
@josepjaume josepjaume authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/ember_rails.rb
View
15 lib/ember_rails.rb
@@ -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|
Please sign in to comment.
Something went wrong with that request. Please try again.