aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/dependencies.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-16 17:50:36 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-16 17:50:36 +0000
commitee014ef95ae9746b4228f3bc7c85ac0df28ba1df (patch)
treed60860f75c1dbeda5090b82259fcc45aa85e50c1 /activesupport/lib/dependencies.rb
parent394cf21ce73cae503f4c5272ef2a417df6fd21a5 (diff)
downloadrails-ee014ef95ae9746b4228f3bc7c85ac0df28ba1df.tar.gz
rails-ee014ef95ae9746b4228f3bc7c85ac0df28ba1df.tar.bz2
rails-ee014ef95ae9746b4228f3bc7c85ac0df28ba1df.zip
New adventures in dependency reloading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@429 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/dependencies.rb')
-rw-r--r--activesupport/lib/dependencies.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/activesupport/lib/dependencies.rb b/activesupport/lib/dependencies.rb
index 1452b63a77..9ef1c251bc 100644
--- a/activesupport/lib/dependencies.rb
+++ b/activesupport/lib/dependencies.rb
@@ -13,6 +13,8 @@ module Dependencies
if !loaded.include?(file_name)
loaded << file_name
+ STDERR << "Loaded: #{file_name}\n"
+
begin
require_or_load(file_name)
rescue LoadError
@@ -26,19 +28,9 @@ module Dependencies
end
def reload
- old_loaded = loaded
+ reloading = loaded.dup
clear
-
- old_loaded.each do |file_name|
- next if loaded.include?(file_name)
-
- begin
- silence_warnings { load("#{file_name}.rb") }
- loaded << file_name
- rescue LoadError
- # The association didn't reside in its own file, so we assume it was required by other means
- end
- end
+ reloading.each { |file_name| depend_on(file_name, true) }
end
def clear