diff options
Diffstat (limited to 'railties/lib/rails')
7 files changed, 23 insertions, 9 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 44635ff4f6..5c7de616be 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -132,7 +132,7 @@ module Rails middleware.use('::Rack::Lock', :if => lambda { !allow_concurrency }) middleware.use('::Rack::Runtime') middleware.use('::Rails::Rack::Logger') - middleware.use('::ActionDispatch::ShowExceptions', lambda { consider_all_requests_local }) + middleware.use('::ActionDispatch::ShowExceptions', lambda { consider_all_requests_local }, :if => lambda { action_dispatch.show_exceptions }) middleware.use("::ActionDispatch::RemoteIp", lambda { action_dispatch.ip_spoofing_check }, lambda { action_dispatch.trusted_proxies }) middleware.use('::Rack::Sendfile', lambda { action_dispatch.x_sendfile_header }) middleware.use('::ActionDispatch::Callbacks', lambda { !cache_classes }) diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index fccae9190a..fbad3c9ef1 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_gemfile, :type => :boolean, :default => false, + :desc => "Don't create a Gemfile" + 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_gemfile] 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..bd4fedcdec 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -11,8 +11,9 @@ require "active_resource/railtie" require "rails/test_unit/railtie" <% end -%> -# Auto-require default libraries and those for the current Rails environment. -Bundler.require :default, Rails.env +# If you have a Gemfile, require the gems listed there, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) if defined?(Bundler) module <%= app_const_base %> class Application < Rails::Application 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..3971a07012 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb @@ -1,8 +1,14 @@ -# Use Bundler (preferred) +# Use locked gems if present. begin require File.expand_path('../../.bundle/environment', __FILE__) + rescue LoadError + # Otherwise, use RubyGems. require 'rubygems' - require 'bundler' - Bundler.setup + + # And set up the gems listed in the Gemfile. + if File.exist?(File.expand_path('../../Gemfile', __FILE__)) + require 'bundler' + Bundler.setup + end end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 0b87b241ec..beb28e2229 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -14,6 +14,9 @@ config.consider_all_requests_local = true config.action_controller.perform_caching = false + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false diff --git a/railties/lib/rails/generators/rails/app/templates/public/index.html b/railties/lib/rails/generators/rails/app/templates/public/index.html index 836da1b689..9fb304a66b 100644 --- a/railties/lib/rails/generators/rails/app/templates/public/index.html +++ b/railties/lib/rails/generators/rails/app/templates/public/index.html @@ -82,7 +82,8 @@ #about-content { background-color: #ffd; border: 1px solid #fc0; - margin-left: -11px; + margin-left: -55px; + margin-right: -10px; } #about-content table { margin-top: 10px; diff --git a/railties/lib/rails/version.rb b/railties/lib/rails/version.rb index 1dd8fa0ec7..7c47cbeabd 100644 --- a/railties/lib/rails/version.rb +++ b/railties/lib/rails/version.rb @@ -3,7 +3,7 @@ module Rails MAJOR = 3 MINOR = 0 TINY = 0 - BUILD = "beta1" + BUILD = "beta2" STRING = [MAJOR, MINOR, TINY, BUILD].join('.') end |