aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-08-29 17:42:24 +0200
committerXavier Noria <fxn@hashref.com>2012-08-29 17:42:43 +0200
commit3b2c42cb56f8f838b6a376132bd10a04bddc4045 (patch)
treec38380fd1bab694e978868b3c180de31cfb1b3a4 /activesupport
parent8e974f2e3c06ddbba9064c7801988763bc7dec69 (diff)
downloadrails-3b2c42cb56f8f838b6a376132bd10a04bddc4045.tar.gz
rails-3b2c42cb56f8f838b6a376132bd10a04bddc4045.tar.bz2
rails-3b2c42cb56f8f838b6a376132bd10a04bddc4045.zip
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
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/dependencies.rb2
1 files changed, 1 insertions, 1 deletions
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}"