From 3b2c42cb56f8f838b6a376132bd10a04bddc4045 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 29 Aug 2012 17:42:24 +0200 Subject: fixes a regexp We need to anchor to remove the extension. In addition to be the correct way to do that, files in ~/.rbenv get that .rb removed, so it is a real source of bugs, as reported in https://github.com/rails/rails/commit/b33700f5580b4cd85379a1dc60fa341ac4d8deb2#commitcomment-1781840 --- activesupport/lib/active_support/dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index d2afea2545..45c9f0472a 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -481,7 +481,7 @@ module ActiveSupport #:nodoc: if file_path expanded = File.expand_path(file_path) - expanded.sub!(/\.rb/, '') + expanded.sub!(/\.rb\z/, '') if loaded.include?(expanded) raise "Circular dependency detected while autoloading constant #{qualified_name}" -- cgit v1.2.3