environment.rb 3.33 KB
Newer Older
1
#-- encoding: UTF-8
2 3
#-- copyright
# ChiliProject is a project management system.
4
#
Holger Just's avatar
Holger Just committed
5
# Copyright (C) 2010-2013 the ChiliProject Team
6
#
7 8 9 10
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
11
#
12 13 14
# See doc/COPYRIGHT.rdoc for more details.
#++

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
15 16
# Be sure to restart your web server when you modify this file.

17
# Uncomment below to force Rails into production mode when
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
18
# you don't control web/app server and can't set it the proper way
19
# ENV['RAILS_ENV'] ||= 'production'
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
20

21 22 23
# use RACK_ENV if we are running as a simple rack app
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] if ENV['RACK_ENV']

24
# Specifies gem version of Rails to use when vendor/rails is not present
25
RAILS_GEM_VERSION = '2.3.16' unless defined? RAILS_GEM_VERSION
26

27 28 29 30 31
if RUBY_VERSION >= '1.9'
  Encoding.default_external = 'UTF-8'
  Encoding.default_internal = 'UTF-8'
end

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
32 33 34
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

35 36 37 38 39 40 41
# Load Engine plugin if available
begin
  require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
rescue LoadError
  # Not available
end

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
42 43
Rails::Initializer.run do |config|
  # Settings in config/environments/* take precedence those specified here
44

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
45 46 47
  # Skip frameworks you're not going to use
  # config.frameworks -= [ :action_web_service, :action_mailer ]

48
  # Add additional load paths for sweepers
49
  config.autoload_paths += %W( #{RAILS_ROOT}/app/sweepers )
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
50

51
  # Force all environments to use the same logger level
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
52 53 54 55 56
  # (by default production uses :info, the others :debug)
  # config.log_level = :debug

  # Enable page/fragment caching by setting a file-based store
  # (remember to create the caching directory and make it readable to the application)
57
  # config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
58

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
59 60
  # Activate observers that should always be running
  # config.active_record.observers = :cacher, :garbage_collector
61
  config.active_record.observers = :journal_observer, :message_observer, :issue_observer, :news_observer, :document_observer, :comment_observer
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
62 63 64

  # Make Active Record use UTC-base instead of local time
  # config.active_record.default_timezone = :utc
65

Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
66 67 68
  # Use Active Record's schema dumper instead of SQL when creating the test database
  # (enables use of different database adapters for development and test environments)
  # config.active_record.schema_format = :ruby
69

70
  # Deliveries are disabled by default. Do NOT modify this section.
71
  # Define your email configuration in configuration.yml instead.
72 73
  # It will automatically turn deliveries on
  config.action_mailer.perform_deliveries = false
74

75 76 77
  # Insert vendor/chiliproject_plugins at the top of the plugin load paths
  config.plugin_paths.insert(0, File.join(Rails.root, "vendor", "chiliproject_plugins"))

78 79 80 81
  # Use redmine's custom plugin locater
  require File.join(RAILS_ROOT, "lib/redmine_plugin_locator")
  config.plugin_locators << RedminePluginLocator

82
  # Load any local configuration that is kept out of source control
Gregor Schmidt's avatar
Gregor Schmidt committed
83
  # (e.g. patches).
84 85 86
  if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
    instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
  end
Jean-Philippe Lang's avatar
Jean-Philippe Lang committed
87
end