From 19f59b6eb1eb83fb6b903ccdd4690f925c4ee247 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 23 Nov 2005 22:33:45 +0000 Subject: Dependencies: set load_file_name = file_name if it ends in .rb git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index ed32334240..be44f61ea7 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -43,7 +43,7 @@ module Dependencies #:nodoc: def require_or_load(file_name) if load? # Append .rb if we have a bare file name. - load_file_name = "#{file_name}.rb" unless file_name[-3..-1] == '.rb' + load_file_name = (file_name =~ /\.rb$/ ? file_name : "#{file_name}.rb") # Enable warnings iff this file has not been loaded before. if history.include?(file_name) -- cgit v1.2.3