diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-03-31 14:11:51 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2010-03-31 14:11:51 -0500 |
commit | fc3a39b599fbbed86a153b9742258db020eefa3c (patch) | |
tree | b388b189cb1723119abef12f0f4e22cfadac4621 /railties/lib/rails/generators | |
parent | db28d407f76a790a31e27bf51560e23425dd6944 (diff) | |
download | rails-fc3a39b599fbbed86a153b9742258db020eefa3c.tar.gz rails-fc3a39b599fbbed86a153b9742258db020eefa3c.tar.bz2 rails-fc3a39b599fbbed86a153b9742258db020eefa3c.zip |
Add --skip-bundler option to rails application generator
NOTE: This does not fix the bundler activation issue. The "bundler"
gem will still be installed and activated when you install rails.
Diffstat (limited to 'railties/lib/rails/generators')
3 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index fccae9190a..0af7f2aa56 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -31,6 +31,9 @@ module Rails::Generators class_option :edge, :type => :boolean, :default => false, :desc => "Setup the application with Gemfile pointing to Rails repository" + class_option :skip_bundler, :type => :boolean, :default => false, + :desc => "Skip Bundler files" + class_option :skip_activerecord, :type => :boolean, :aliases => "-O", :default => false, :desc => "Skip ActiveRecord files" @@ -71,7 +74,7 @@ module Rails::Generators copy_file "gitignore", ".gitignore" unless options[:skip_git] template "Rakefile" template "config.ru" - template "Gemfile" + template "Gemfile" unless options[:skip_bundler] end def create_app_files diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index dc20ffb2fa..a355aac7a6 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -11,9 +11,11 @@ require "active_resource/railtie" require "rails/test_unit/railtie" <% end -%> +<% unless options[:skip_bundler] -%> # Auto-require default libraries and those for the current Rails environment. Bundler.require :default, Rails.env +<% end -%> module <%= app_const_base %> class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb index 3cb561d41f..0c7ae74b0a 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb @@ -1,3 +1,6 @@ +<% if options[:skip_bundler] -%> +require 'rubygems' +<% else -%> # Use Bundler (preferred) begin require File.expand_path('../../.bundle/environment', __FILE__) @@ -6,3 +9,4 @@ rescue LoadError require 'bundler' Bundler.setup end +<% end -%> |