diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 28 | ||||
-rw-r--r-- | config/environment.rb | 2 | ||||
-rw-r--r-- | config/environments/development.rb | 14 | ||||
-rw-r--r-- | config/environments/production.rb | 17 | ||||
-rw-r--r-- | config/environments/test.rb | 5 | ||||
-rw-r--r-- | config/test.yml | 2 |
6 files changed, 66 insertions, 2 deletions
diff --git a/config/application.rb b/config/application.rb index 245a60782..f2b662abc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -6,7 +6,7 @@ require File.dirname(__FILE__) + '/../lib/configuration' # 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) +Bundler.require(:default, :assets, Rails.env) if defined?(Bundler) module Alaveteli class Application < Rails::Application @@ -75,5 +75,31 @@ module Alaveteli # Insert a bit of middleware code to prevent uneeded cookie setting. require "#{Rails.root}/lib/whatdotheyknow/strip_empty_sessions" config.middleware.insert_before ::ActionDispatch::Cookies, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + + # Change the path that assets are served from + # config.assets.prefix = "/assets" + + # These additional precompiled Javascript files are actually + # manifests that require the real javascript files: + config.assets.precompile += ['admin.js', + 'profile-photos.js', + 'stats.js'] + # ... while these are individual files that can't easily be + # grouped: + config.assets.precompile += ['jquery.fancybox-1.3.4.pack.js', + 'jquery.Jcrop.css', + 'excanvas.min.js', + 'fonts.css', + 'print.css', + 'admin.css', + 'ie6.css', + 'ie7.css'] + end end diff --git a/config/environment.rb b/config/environment.rb index 196680b23..05f25a29e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,7 @@ + # Load the rails application require File.expand_path('../application', __FILE__) +ActiveSupport::Deprecation.silenced = true # Initialize the rails application Alaveteli::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index a912dd5de..dbf8d7b2a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -32,4 +32,18 @@ Alaveteli::Application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + end diff --git a/config/environments/production.rb b/config/environments/production.rb index 0c1929366..a3e3cebd2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -31,4 +31,21 @@ Alaveteli::Application.configure do if AlaveteliConfiguration::force_ssl config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL end + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Choose the compressors to use + # config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :yui + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs. + config.assets.digest = true + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + end diff --git a/config/environments/test.rb b/config/environments/test.rb index df39e8873..97c2d4f7c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -24,4 +24,9 @@ Alaveteli::Application.configure do # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + 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 end diff --git a/config/test.yml b/config/test.yml index b26ca99d4..599e1e81a 100644 --- a/config/test.yml +++ b/config/test.yml @@ -116,7 +116,7 @@ HTML_TO_PDF_COMMAND: /usr/local/bin/wkhtmltopdf-amd64 # Exception notifications EXCEPTION_NOTIFICATIONS_FROM: do-not-reply-to-this-address@example.com -EXCEPTION_NOTIFICATIONS_TO: +EXCEPTION_NOTIFICATIONS_TO: exception-recipient@example.com MAX_REQUESTS_PER_USER_PER_DAY: 2 |