Permalink
Browse files

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

rails@b33700f#commitcomment-1781840
  • Loading branch information...
1 parent 8e974f2 commit 3b2c42cb56f8f838b6a376132bd10a04bddc4045 @fxn fxn committed Aug 29, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/dependencies.rb
@@ -481,7 +481,7 @@ def load_missing_constant(from_mod, const_name)
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}"

0 comments on commit 3b2c42c

Please sign in to comment.