diff options
Diffstat (limited to 'config/environments')
-rw-r--r-- | config/environments/development.rb | 47 | ||||
-rw-r--r-- | config/environments/production.rb | 46 | ||||
-rw-r--r-- | config/environments/staging.rb | 30 | ||||
-rw-r--r-- | config/environments/test.rb | 40 |
4 files changed, 88 insertions, 75 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index c43cdb049..54ab2977f 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,29 +1,30 @@ -# Settings specified here will take precedence over those in config/environment.rb +Alaveteli::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb -config.log_level = :info + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the webserver when you make code changes. + config.cache_classes = false -# In the development environment your application's code is reloaded on -# every request. This slows down response time but is perfect for development -# since you don't have to restart the webserver when you make code changes. -config.cache_classes = false + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_controller.perform_caching = false -config.action_view.debug_rjs = true + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + config.action_mailer.perform_deliveries = true + # Use mailcatcher in development + config.action_mailer.delivery_method = :smtp # so is queued, rather than giving immediate errors + config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 } -# Don't care if the mailer can't send -config.action_mailer.raise_delivery_errors = false -config.action_mailer.perform_deliveries = true -# Use mailcatcher in development -config.action_mailer.delivery_method = :smtp # so is queued, rather than giving immediate errors -config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 } + # Writes useful log files to debug memory leaks, of the sort where have + # unintentionally kept references to objects, especially strings. + # require 'memory_profiler' + # MemoryProfiler.start :string_debug => true, :delay => 10 - -# Writes useful log files to debug memory leaks, of the sort where have -# unintentionally kept references to objects, especially strings. -# require 'memory_profiler' -# MemoryProfiler.start :string_debug => true, :delay => 10 + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log +end diff --git a/config/environments/production.rb b/config/environments/production.rb index 097944196..0c1929366 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,26 +1,34 @@ -# Settings specified here will take precedence over those in config/environment.rb +Alaveteli::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb -# The production environment is meant for finished, "live" apps. -# Code is not reloaded between requests -config.cache_classes = true + # The production environment is meant for finished, "live" apps. + # Code is not reloaded between requests + config.cache_classes = true -# Use a different logger for distributed setups -# config.logger = SyslogLogger.new + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new -# Full error reports are disabled and caching is turned on -config.action_controller.consider_all_requests_local = false -config.action_controller.perform_caching = true + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true -# Enable serving of images, stylesheets, and javascripts from an asset server -# config.action_controller.asset_host = "http://assets.example.com" + # Enable serving of images, stylesheets, and javascripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" -# Disable delivery errors, bad email addresses will be ignored -# config.action_mailer.raise_delivery_errors = false -config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors -require 'rack/ssl' -if ::Configuration::force_ssl - config.middleware.insert_after ActionController::Failsafe, ::Rack::SSL - # For Rails 3.x this will need to change to - #config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL + config.active_support.deprecation = :notify + + if !AlaveteliConfiguration.exception_notifications_from.blank? && !AlaveteliConfiguration.exception_notifications_to.blank? + middleware.use ExceptionNotifier, + :sender_address => AlaveteliConfiguration::exception_notifications_from, + :exception_recipients => AlaveteliConfiguration::exception_notifications_to + end + + require 'rack/ssl' + if AlaveteliConfiguration::force_ssl + config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL + end end diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 84a8f5965..0bb0db71a 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -1,19 +1,21 @@ -# Settings specified here will take precedence over those in config/environment.rb +Alaveteli::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb -# The production environment is meant for finished, "live" apps. -# Code is not reloaded between requests -config.cache_classes = true + # The production environment is meant for finished, "live" apps. + # Code is not reloaded between requests + config.cache_classes = true -# Use a different logger for distributed setups -# config.logger = SyslogLogger.new + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new -# Full error reports are disabled and caching is turned on -config.action_controller.consider_all_requests_local = false -config.action_controller.perform_caching = true + # Full error reports are disabled and caching is turned on + config.action_controller.consider_all_requests_local = false + config.action_controller.perform_caching = true -# Enable serving of images, stylesheets, and javascripts from an asset server -# config.action_controller.asset_host = "http://assets.example.com" + # Enable serving of images, stylesheets, and javascripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" -# Disable delivery errors, bad email addresses will be ignored -# config.action_mailer.raise_delivery_errors = false -config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors +end diff --git a/config/environments/test.rb b/config/environments/test.rb index 784ea18d3..df39e8873 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,25 +1,27 @@ -# Settings specified here will take precedence over those in config/environment.rb +Alaveteli::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb -require 'patches/fixtures_constraint_disabling' + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! -config.cache_classes = true + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_controller.perform_caching = false + # Tell ActionMailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test -# Tell ActionMailer not to deliver emails to the real world. -# The :test delivery method accumulates sent emails in the -# ActionMailer::Base.deliveries array. -config.action_mailer.delivery_method = :test - -# Disable request forgery protection in test environment -config.action_controller.allow_forgery_protection = false + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end |