Permalink
Browse files

Added generator back for Rails 3.1 apps with asset pipeline turned of

  • Loading branch information...
1 parent 5e21f80 commit ad784f26934231f0fd886af2b27155c809e77cfc Daniel Spangenberg committed Nov 20, 2011
View
7 .gitignore
@@ -1,2 +1,5 @@
-pkg/*
-tmp
+spec/support/*/Gemfile.lock
+spec/support/*/public/javascripts
+.rvmrc
+.bundle
+imports/*kg/*
View
9 lib/generators/mootools/install/install_generator.rb
@@ -1,6 +1,7 @@
require 'rails'
-if ::Rails.version < "3.1"
+# Supply generator for Rails 3.0.x or if asset pipeline is not enabled
+if ::Rails.version < "3.1" || !::Rails.application.config.assets.enabled
module Mootools
module Generators
class InstallGenerator < ::Rails::Generators::Base
@@ -45,9 +46,11 @@ class InstallGenerator < ::Rails::Generators::Base
desc "Just show instructions so people will know what to do when mistakenly using generator for Rails 3.1 apps"
def do_nothing
- say_status("deprecated", "You are using Rails 3.1, so this generator is no longer needed. The necessary files are already in your asset pipeline.")
+ say_status("deprecated", "You are using Rails 3.1 with the asset pipeline enabled, so this generator is not needed.")
+ say_status("", "The necessary files are already in your asset pipeline.")
say_status("", "Just add `//= require mootools` and `//= require mootools_ujs` to your app/assets/javascripts/application.js")
- say_status("", "If you upgraded your app from Rails 3.0 and still have mootools.js, rails.js, or mootools-more.js in your javascripts, be sure to remove them.")
+ say_status("", "If you upgraded your app from Rails 3.0 and still have mootools.js, rails.js, or mootools_ujs.js in your javascripts, be sure to remove them.")
+ say_status("", "If you do not want the asset pipeline enabled, you may turn it off in application.rb and re-run this generator.")
# ok, nothing
end
end
View
BIN pkg/mootools-rails-1.0.0.gem
Binary file not shown.

0 comments on commit ad784f2

Please sign in to comment.