From 884bc3fec880c5b41958035b0ddfa0bc20700edf Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Tue, 23 Dec 2014 08:12:09 -0600 Subject: [PATCH] Rename serve_static_assets to serve_static_files --- bin/rails | 4 ++++ bin/rake | 4 ++++ bin/spring | 2 +- config/environments/production.rb | 5 +++-- config/environments/test.rb | 6 +++--- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/rails b/bin/rails index 5191e6927..4d608edeb 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489f..8017a0271 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/spring b/bin/spring index 253ec37c3..7f24d96fb 100755 --- a/bin/spring +++ b/bin/spring @@ -7,7 +7,7 @@ unless defined?(Spring) require "rubygems" require "bundler" - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) ENV["GEM_HOME"] = "" Gem.paths = ENV diff --git a/config/environments/production.rb b/config/environments/production.rb index 05bed2620..860277c3e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -20,8 +20,9 @@ # NGINX, varnish or squid. # config.action_dispatch.rack_cache = true - # Disable Rails's static asset server (Apache or NGINX will already do this). - config.serve_static_assets = false + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier diff --git a/config/environments/test.rb b/config/environments/test.rb index 19f714fd0..5c6dadfee 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -12,8 +12,8 @@ # preloads Rails for running tests, you may have to set it to true. config.eager_load = false - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. @@ -32,7 +32,7 @@ config.action_mailer.delivery_method = :test config.action_mailer.default_url_options = {host: 'localhost:3000'} - # Randomize the order test cases are executed + # Randomize the order test cases are executed. config.active_support.test_order = :random # Print deprecation notices to the stderr.