Skip to content
Browse files

Revert "require_dependency should require using the normal mechanism …

…if possible to avoid double-requires"

This was causing double requires since 991cd59 was reverted.
This reverts commit 8bf7973.
  • Loading branch information...
1 parent fff917e commit e86cced311539932420f9cda49d736606d106c28 @josevalim josevalim committed
Showing with 7 additions and 15 deletions.
  1. +7 −15 activesupport/lib/active_support/dependencies.rb
View
22 activesupport/lib/active_support/dependencies.rb
@@ -276,22 +276,14 @@ def load?
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

0 comments on commit e86cced

Please sign in to comment.
Something went wrong with that request. Please try again.