aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-03 15:44:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-03 15:44:19 +0000
commit29436edb733ae3033d8a27ce755975745b1307f5 (patch)
treeca68e9ce855ff164bff3a824e0108d6a384ba96b /railties
parent8367316826e109b1d55669a82764698ed10a8312 (diff)
downloadrails-29436edb733ae3033d8a27ce755975745b1307f5.tar.gz
rails-29436edb733ae3033d8a27ce755975745b1307f5.tar.bz2
rails-29436edb733ae3033d8a27ce755975745b1307f5.zip
Also configure template view path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/initializer.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 2a172cc53d..d8264f520f 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -3,6 +3,19 @@ require 'logger'
RAILS_ENV = ENV['RAILS_ENV'] || 'development'
module Rails
+ # The Initializer is responsible for processing the Rails configuration, such as setting the $LOAD_PATH, requiring the
+ # right frameworks, initializing logging, and more. It can be run either as a single command that'll just use the
+ # default configuration, like this:
+ #
+ # Rails::Initializer.run
+ #
+ # But normally it's more interesting to pass in a custom configuration through the block running:
+ #
+ # Rails::Initializer.run do |config|
+ # config.frameworks -= [ :action_web_service ]
+ # end
+ #
+ # This will use the default configuration options from Rails::Configuration, but allow for overwriting on select areas.
class Initializer
attr_reader :configuration
@@ -24,6 +37,7 @@ module Rails
initialize_database
initialize_logger
initialize_framework_logging
+ initialize_framework_views
initialize_routing
end
@@ -77,6 +91,13 @@ module Rails
end
end
+ # The Configuration class holds all the parameters for the Initializer and ships with defaults that suites most
+ # Rails applications. But it's possible to overwrite everything. Usually, you'll create an Configuration file implicitly
+ # through the block running on the Initializer, but it's also possible to create the Configuration instance in advance and
+ # pass it in like this:
+ #
+ # config = Rails::Configuration.new
+ # Rails::Initializer.run(:process, config)
class Configuration
attr_accessor :frameworks, :load_paths, :log_level, :log_path, :database_configuration_file, :view_path, :controller_paths