Replaced Rails environment variables with Merb equivalents.
[merb_radiant.git] / config / radiant_environment.rb
blob86a2340c917ff0d2af436e4aa936c7ab97820ed4
1 # Be sure to restart your web server when you modify this file.
3 # Radiant Gem Version
4 RADIANT_GEM_VERSION = '0.6.4'
6 # Uncomment below to force Rails into production mode when 
7 # you don't control web/app server and can't set it the proper way
8 # ENV['RAILS_ENV'] ||= 'production'
10 # Bootstrap the Rails environment, frameworks, and default configuration
11 require File.join(File.dirname(__FILE__), 'boot')
13 require 'radius'
15 Radiant::Initializer.run do |config|
16   # Settings in config/environments/* take precedence those specified here
17   
18   # Skip frameworks you're not going to use
19   config.frameworks -= [ :action_web_service, :action_mailer ]
21   # Add additional load paths for when Radiant is running in instance mode
22   config.load_paths += %w(
23     app/controllers
24     app/models
25     app/helpers
26     lib
27   ).map { |path| File.join(RADIANT_ROOT, path) }
28   config.controller_paths << File.join(RADIANT_ROOT, 'app', 'controllers')
29   config.view_path = File.join(RADIANT_ROOT, 'app', 'views')
30   
31   # Only load the extensions named here, in the order given. By default all plugins in vendor/extensions are
32   # loaded, in alphabetical order. :all can be used as a placeholder for all extensions not explicitly named. 
33   # config.extensions = [ :textile_filter, :markdown_filter, :all ] 
35   # Force all environments to use the same logger level 
36   # (by default production uses :info, the others :debug)
37   # config.log_level = :debug
39   # Use the database for sessions instead of the file system
40   # (create the session table with 'rake create_sessions_table')
41   # config.action_controller.session_store = :active_record_store
43   # Enable page/fragment caching by setting a file-based store
44   # (remember to create the caching directory and make it readable to the application)
45   # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/fragment_cache"
46   config.action_controller.page_cache_directory = "#{Merb.root}/cache"
48   # Make Active Record use UTC-base instead of local time
49   config.active_record.default_timezone = :utc
50   
51   # Activate observers that should always be running
52   config.active_record.observers = :user_action_observer
53   
54   # Make sure plugins are loaded from lib and vendor
55   config.plugin_paths = [
56     "#{Merb.root}/vendor/plugins",
57     "#{RADIANT_ROOT}/lib/plugins",
58     "#{RADIANT_ROOT}/vendor/plugins"
59   ]
61   # Use ActiveRecord sessions
62   config.action_controller.session_store = :active_record_store
64   # See Rails::Configuration for more options
65 end
67 # Add new inflection rules using the following format:
68 Inflector.inflections do |inflect|
69   inflect.uncountable 'config'
70   inflect.uncountable 'meta'
71 end
73 # Auto-require text filters
74 Dir["#{RADIANT_ROOT}/app/models/*_filter.rb"].each do |filter|
75   require_dependency File.basename(filter).sub(/\.rb$/, '')
76 end
78 # Response Caching Defaults
79 ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory
80 ResponseCache.defaults[:logger]    = ActionController::Base.logger
82 ActionView::Base.field_error_proc = Proc.new do |html, instance|
83   %{<div class="error-with-field">#{html} <small class="error">&bull; #{[instance.error_message].flatten.first}</small></div>}
84 end