Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails framework...

Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails framework to be found in a different place than vendor/rails. Should be set in boot.rb. [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 34df9be0
*SVN*
* Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails framework to be found in a different place than vendor/rails. Should be set in boot.rb. [DHH]
* Fixed that static requests could unlock the mutex guarding dynamic requests in the WEBrick servlet #3433 [tom@craz8.com]
* Fixed documentation tasks to work with Rake 0.7.0 #3563 [kazuhiko@fdiary.net]
......
......@@ -447,6 +447,10 @@ def root_path
::RAILS_ROOT
end
def framework_root_path
defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : "#{root_path}/vendor/rails"
end
def default_frameworks
[ :active_record, :action_controller, :action_view, :action_mailer, :action_web_service ]
end
......@@ -460,7 +464,6 @@ def default_load_paths
paths.concat(Dir["#{root_path}/components/[_a-z]*"])
# Followed by the standard includes.
# TODO: Don't include dirs for frameworks that are not used
paths.concat %w(
app
app/models
......@@ -472,14 +475,18 @@ def default_load_paths
config
lib
vendor
vendor/rails/railties
vendor/rails/railties/lib
vendor/rails/actionpack/lib
vendor/rails/activesupport/lib
vendor/rails/activerecord/lib
vendor/rails/actionmailer/lib
vendor/rails/actionwebservice/lib
).map { |dir| "#{root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
# TODO: Don't include dirs for frameworks that are not used
paths.concat %w(
railties
railties/lib
actionpack/lib
activesupport/lib
activerecord/lib
actionmailer/lib
actionwebservice/lib
).map { |dir| "#{framework_root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
end
def default_log_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册