mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 -%>
|
||||
|
||||
Reference in New Issue
Block a user