diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-30 00:12:39 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-30 00:12:39 +0000 |
commit | 7fcf07d632010130c1e46d22f689c81c48c6fe68 (patch) | |
tree | 7983c544a02e4cef534d182c492d0a25fe8218e7 /activesupport | |
parent | fa1f5e062ec621238b0a36c6093329429d2a218b (diff) | |
download | rails-7fcf07d632010130c1e46d22f689c81c48c6fe68.tar.gz rails-7fcf07d632010130c1e46d22f689c81c48c6fe68.tar.bz2 rails-7fcf07d632010130c1e46d22f689c81c48c6fe68.zip |
Include as loaded regardless of success
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/dependencies.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/activesupport/lib/dependencies.rb b/activesupport/lib/dependencies.rb index a6d53f1e2f..7ddc6c318e 100644 --- a/activesupport/lib/dependencies.rb +++ b/activesupport/lib/dependencies.rb @@ -10,10 +10,14 @@ module Dependencies mattr_accessor :mechanism def depend_on(file_name, swallow_load_errors = false) - begin - loaded << require_or_load(file_name) if !loaded.include?(file_name) - rescue LoadError - raise unless swallow_load_errors + if !loaded.include?(file_name) + loaded << file_name + + begin + require_or_load(file_name) + rescue LoadError + raise unless swallow_load_errors + end end end @@ -38,7 +42,6 @@ module Dependencies private def require_or_load(file_name) mechanism == :load ? silence_warnings { load("#{file_name}.rb") } : require(file_name) - return file_name end end @@ -62,4 +65,4 @@ class Object end end end -end +end
\ No newline at end of file |