lib/generators/bootstrap/install/install_generator.rb in twitter-bootstrap-rails-2.2.8 vs lib/generators/bootstrap/install/install_generator.rb in twitter-bootstrap-rails-3.2.0
- old
+ new
@@ -3,12 +3,13 @@
module Bootstrap
module Generators
class InstallGenerator < ::Rails::Generators::Base
source_root File.expand_path("../templates", __FILE__)
- desc "This generator installs Twitter Bootstrap to Asset Pipeline"
+ desc "This generator installs Bootstrap to Asset Pipeline"
argument :stylesheets_type, :type => :string, :default => 'less', :banner => '*less or static'
+ class_option :'no-coffeescript', :type => :boolean, :default => false, :desc => 'Skips coffeescript replacement into app generators'
def add_assets
js_manifest = 'app/assets/javascripts/application.js'
@@ -58,11 +59,10 @@
end
def cleanup_legacy
# Remove old requires (if any) that included twitter/bootstrap directly:
gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap\s*\n|, "")
- gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*twitter/bootstrap_responsive\s*\n|, "")
if File.exist?('app/assets/stylesheets/bootstrap_override.css.less')
puts <<-EOM
Warning:
app/assets/stylesheets/bootstrap_override.css.less exists
It should be removed, as it has been superceded by app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -74,9 +74,10 @@
def use_less?
(defined?(Less) && (stylesheets_type!='static') ) || (stylesheets_type=='less')
end
def use_coffeescript?
+ return false if options[:'no-coffeescript']
::Rails.configuration.app_generators.rails[:javascript_engine] == :coffee
end
end
end
end