aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-08-10 11:18:58 -0300
committerJosé Valim <jose.valim@gmail.com>2010-08-10 11:18:58 -0300
commite86cced311539932420f9cda49d736606d106c28 (patch)
tree8892d8305ced43866068a6c1c66548e465e45b38 /activesupport/lib
parentfff917e37d979fcbb4844671acbba7977c26d22a (diff)
downloadrails-e86cced311539932420f9cda49d736606d106c28.tar.gz
rails-e86cced311539932420f9cda49d736606d106c28.tar.bz2
rails-e86cced311539932420f9cda49d736606d106c28.zip
Revert "require_dependency should require using the normal mechanism if possible to avoid double-requires"
This was causing double requires since 991cd59a225b90ab1ba3 was reverted. This reverts commit 8bf79739b4219eb1d6464e6eb4853e92e81d7621.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/dependencies.rb22
1 files changed, 7 insertions, 15 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 1b93eac7ee..2b80bd214f 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -276,22 +276,14 @@ module ActiveSupport #:nodoc:
end
def depend_on(file_name, swallow_load_errors = false, message = "No such file to load -- %s.rb")
- #path = search_for_file(file_name)
- require_or_load(file_name)
- rescue LoadError
- begin
- if path = search_for_file(file_name)
- require_or_load(path)
- else
- raise
- end
- rescue LoadError => load_error
- unless swallow_load_errors
- if file_name = load_error.message[/ -- (.*?)(\.rb)?$/, 1]
- raise LoadError.new(message % file_name).copy_blame!(load_error)
- end
- raise
+ path = search_for_file(file_name)
+ require_or_load(path || file_name)
+ rescue LoadError => load_error
+ unless swallow_load_errors
+ if file_name = load_error.message[/ -- (.*?)(\.rb)?$/, 1]
+ raise LoadError.new(message % file_name).copy_blame!(load_error)
end
+ raise
end
end