Permalink
Browse files

Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails f…

…ramework 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
  • Loading branch information...
1 parent 34df9be commit f8bcfa6e042e7f953f1e7bd16195b2200a6dfc45 @dhh dhh committed Jan 30, 2006
Showing with 17 additions and 8 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +15 −8 railties/lib/initializer.rb
View
@@ -1,5 +1,7 @@
*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

0 comments on commit f8bcfa6

Please sign in to comment.