Commit 6bda4c8e41eaf49ddc83ff9a718aa4778515bf4a
1 parent
6fd87a4c
Exists in
master
and in
22 other branches
Environments updated to Rails 3 standard
Showing
4 changed files
with
128 additions
and
52 deletions
Show diff stats
config/environment.rb
| 1 | -# Be sure to restart your web server when you modify this file. | 1 | +# Load the rails application |
| 2 | +require File.expand_path('../application', __FILE__) | ||
| 2 | 3 | ||
| 3 | # Uncomment below to force Rails into production mode when | 4 | # Uncomment below to force Rails into production mode when |
| 4 | # you don't control web/app server and can't set it the proper way | 5 | # you don't control web/app server and can't set it the proper way |
| 5 | #ENV['RAILS_ENV'] ||= 'production' | 6 | #ENV['RAILS_ENV'] ||= 'production' |
| 6 | 7 | ||
| 7 | -# Specifies gem version of Rails to use when vendor/rails is not present | ||
| 8 | -RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION | ||
| 9 | - | ||
| 10 | -# Bootstrap the Rails environment, frameworks, and default configuration | ||
| 11 | -require File.join(File.dirname(__FILE__), 'boot') | ||
| 12 | - | ||
| 13 | # extra directories for controllers organization | 8 | # extra directories for controllers organization |
| 14 | extra_controller_dirs = %w[ | 9 | extra_controller_dirs = %w[ |
| 15 | app/controllers/my_profile | 10 | app/controllers/my_profile |
config/environments/development.rb
| 1 | -# Settings specified here will take precedence over those in config/environment.rb | 1 | +Rails3::Application.configure do |
| 2 | + # Settings specified here will take precedence over those in config/application.rb | ||
| 2 | 3 | ||
| 3 | -# In the development environment your application's code is reloaded on | ||
| 4 | -# every request. This slows down response time but is perfect for development | ||
| 5 | -# since you don't have to restart the webserver when you make code changes. | ||
| 6 | -config.cache_classes = false | 4 | + # In the development environment your application's code is reloaded on |
| 5 | + # every request. This slows down response time but is perfect for development | ||
| 6 | + # since you don't have to restart the webserver when you make code changes. | ||
| 7 | + config.cache_classes = false | ||
| 7 | 8 | ||
| 8 | -# Log error messages when you accidentally call methods on nil. | ||
| 9 | -config.whiny_nils = true | 9 | + # Log error messages when you accidentally call methods on nil. |
| 10 | + config.whiny_nils = true | ||
| 10 | 11 | ||
| 11 | -# Show full error reports and disable caching | ||
| 12 | -config.action_controller.consider_all_requests_local = true | ||
| 13 | -config.action_view.debug_rjs = true | ||
| 14 | -config.action_controller.perform_caching = false | 12 | + # Show full error reports and disable caching |
| 13 | + config.action_controller.consider_all_requests_local = true | ||
| 14 | + config.action_controller.perform_caching = false | ||
| 15 | 15 | ||
| 16 | -# Don't care if the mailer can't send | ||
| 17 | -config.action_mailer.raise_delivery_errors = false | 16 | + # Don't care if the mailer can't send |
| 17 | + config.action_mailer.raise_delivery_errors = false | ||
| 18 | + | ||
| 19 | + # Print deprecation notices to the Rails logger | ||
| 20 | + config.active_support.deprecation = :log | ||
| 21 | + | ||
| 22 | + # Only use best-standards-support built into browsers | ||
| 23 | + config.action_dispatch.best_standards_support = :builtin | ||
| 24 | + | ||
| 25 | + # Raise exception on mass assignment protection for Active Record models | ||
| 26 | + config.active_record.mass_assignment_sanitizer = :strict | ||
| 27 | + | ||
| 28 | + # Log the query plan for queries taking more than this (works | ||
| 29 | + # with SQLite, MySQL, and PostgreSQL) | ||
| 30 | + config.active_record.auto_explain_threshold_in_seconds = 0.5 | ||
| 31 | + | ||
| 32 | + # Do not compress assets | ||
| 33 | + config.assets.compress = false | ||
| 34 | + | ||
| 35 | + # Expands the lines which load the assets | ||
| 36 | + config.assets.debug = true | ||
| 37 | +end |
config/environments/production.rb
| 1 | -# Settings specified here will take precedence over those in config/environment.rb | 1 | +Rails3::Application.configure do |
| 2 | + # Settings specified here will take precedence over those in config/application.rb | ||
| 2 | 3 | ||
| 3 | -# The production environment is meant for finished, "live" apps. | ||
| 4 | -# Code is not reloaded between requests | ||
| 5 | -config.cache_classes = true | 4 | + # The production environment is meant for finished, "live" apps. |
| 5 | + # Code is not reloaded between requests | ||
| 6 | + config.cache_classes = true | ||
| 6 | 7 | ||
| 7 | -# Use a different logger for distributed setups | ||
| 8 | -# config.logger = SyslogLogger.new | 8 | + # Full error reports are disabled and caching is turned on |
| 9 | + config.consider_all_requests_local = false | ||
| 10 | + config.action_controller.perform_caching = true | ||
| 9 | 11 | ||
| 10 | -# Full error reports are disabled and caching is turned on | ||
| 11 | -config.action_controller.consider_all_requests_local = false | ||
| 12 | -config.action_controller.perform_caching = true | ||
| 13 | -config.action_view.cache_template_loading = true | 12 | + # Disable Rails's static asset server (Apache or nginx will already do this) |
| 13 | + config.serve_static_assets = false | ||
| 14 | 14 | ||
| 15 | -# Enable serving of images, stylesheets, and javascripts from an asset server | ||
| 16 | -# config.action_controller.asset_host = "http://assets.example.com" | 15 | + # Compress JavaScripts and CSS |
| 16 | + config.assets.compress = true | ||
| 17 | 17 | ||
| 18 | -# Disable delivery errors, bad email addresses will be ignored | ||
| 19 | -# config.action_mailer.raise_delivery_errors = false | 18 | + # Don't fallback to assets pipeline if a precompiled asset is missed |
| 19 | + config.assets.compile = false | ||
| 20 | + | ||
| 21 | + # Generate digests for assets URLs | ||
| 22 | + config.assets.digest = true | ||
| 23 | + | ||
| 24 | + # Defaults to nil and saved in location specified by config.assets.prefix | ||
| 25 | + # config.assets.manifest = YOUR_PATH | ||
| 26 | + | ||
| 27 | + # Specifies the header that your server uses for sending files | ||
| 28 | + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache | ||
| 29 | + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx | ||
| 30 | + | ||
| 31 | + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
| 32 | + # config.force_ssl = true | ||
| 33 | + | ||
| 34 | + # See everything in the log (default is :info) | ||
| 35 | + # config.log_level = :debug | ||
| 36 | + | ||
| 37 | + # Prepend all log lines with the following tags | ||
| 38 | + # config.log_tags = [ :subdomain, :uuid ] | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + # # Use a different logger for distributed setups | ||
| 42 | + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | ||
| 43 | + | ||
| 44 | + # Use a different cache store in production | ||
| 45 | + config.cache_store = :mem_cache_store, "localhost" | ||
| 46 | + | ||
| 47 | + # Enable serving of images, stylesheets, and javascripts from an asset server | ||
| 48 | + # config.action_controller.asset_host = "http://assets.example.com" | ||
| 49 | + | ||
| 50 | + # Disable delivery errors, bad email addresses will be ignored | ||
| 51 | + # config.action_mailer.raise_delivery_errors = false | ||
| 52 | + | ||
| 53 | + # Enable threaded mode | ||
| 54 | + # config.threadsafe! | ||
| 55 | + | ||
| 56 | + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to | ||
| 57 | + # the I18n.default_locale when a translation can not be found) | ||
| 58 | + config.i18n.fallbacks = true | ||
| 59 | + | ||
| 60 | + # Send deprecation notices to registered listeners | ||
| 61 | + config.active_support.deprecation = :notify | ||
| 62 | + | ||
| 63 | + # Log the query plan for queries taking more than this (works | ||
| 64 | + # with SQLite, MySQL, and PostgreSQL) | ||
| 65 | + # config.active_record.auto_explain_threshold_in_seconds = 0.5 | ||
| 66 | +end | ||
| 20 | 67 | ||
| 21 | -config.cache_store = :mem_cache_store, "localhost" |
config/environments/test.rb
| 1 | -# Settings specified here will take precedence over those in config/environment.rb | 1 | +Rails3::Application.configure do |
| 2 | + # Settings specified here will take precedence over those in config/application.rb | ||
| 2 | 3 | ||
| 3 | -# The test environment is used exclusively to run your application's | ||
| 4 | -# test suite. You never need to work with it otherwise. Remember that | ||
| 5 | -# your test database is "scratch space" for the test suite and is wiped | ||
| 6 | -# and recreated between test runs. Don't rely on the data there! | ||
| 7 | -config.cache_classes = true | 4 | + # The test environment is used exclusively to run your application's |
| 5 | + # test suite. You never need to work with it otherwise. Remember that | ||
| 6 | + # your test database is "scratch space" for the test suite and is wiped | ||
| 7 | + # and recreated between test runs. Don't rely on the data there! | ||
| 8 | + config.cache_classes = true | ||
| 8 | 9 | ||
| 9 | -# Log error messages when you accidentally call methods on nil. | ||
| 10 | -config.whiny_nils = true | 10 | + # Configure static asset server for tests with Cache-Control for performance |
| 11 | + config.serve_static_assets = true | ||
| 12 | + config.static_cache_control = "public, max-age=3600" | ||
| 11 | 13 | ||
| 12 | -# Show full error reports and disable caching | ||
| 13 | -config.action_controller.consider_all_requests_local = true | ||
| 14 | -config.action_controller.perform_caching = false | 14 | + # Log error messages when you accidentally call methods on nil |
| 15 | + config.whiny_nils = true | ||
| 15 | 16 | ||
| 16 | -# Disable request forgery protection in test environment | ||
| 17 | -config.action_controller.allow_forgery_protection = false | 17 | + # Show full error reports and disable caching |
| 18 | + config.consider_all_requests_local = true | ||
| 19 | + config.action_controller.perform_caching = false | ||
| 18 | 20 | ||
| 19 | -# Tell ActionMailer not to deliver emails to the real world. | ||
| 20 | -# The :test delivery method accumulates sent emails in the | ||
| 21 | -# ActionMailer::Base.deliveries array. | ||
| 22 | -config.action_mailer.delivery_method = :test | 21 | + # Raise exceptions instead of rendering exception templates |
| 22 | + config.action_dispatch.show_exceptions = false | ||
| 23 | + | ||
| 24 | + # Disable request forgery protection in test environment | ||
| 25 | + config.action_controller.allow_forgery_protection = false | ||
| 26 | + | ||
| 27 | + # Tell ActionMailer not to deliver emails to the real world. | ||
| 28 | + # The :test delivery method accumulates sent emails in the | ||
| 29 | + # ActionMailer::Base.deliveries array. | ||
| 30 | + config.action_mailer.delivery_method = :test | ||
| 31 | + | ||
| 32 | + # Raise exception on mass assignment protection for Active Record models | ||
| 33 | + config.active_record.mass_assignment_sanitizer = :strict | ||
| 34 | + | ||
| 35 | + # Print deprecation notices to the stderr | ||
| 36 | + config.active_support.deprecation = :stderr | ||
| 37 | +end | ||
| 23 | \ No newline at end of file | 38 | \ No newline at end of file |