From 6a70f2dd6b791c3f4888122d5b7dd9c8f5cac871 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 24 Aug 2012 01:16:27 +0200 Subject: simplifies a regexp The new regexp has less work to do, we anchor a fixed string at the end and need no group. --- activesupport/lib/active_support/dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/dependencies.rb') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 77cab6f08d..5ce2a0bd08 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -331,7 +331,7 @@ module ActiveSupport #:nodoc: def require_or_load(file_name, const_path = nil) log_call file_name, const_path - file_name = $1 if file_name =~ /^(.*)\.rb$/ + file_name = $` if file_name =~ /\.rb\z/ expanded = File.expand_path(file_name) return if loaded.include?(expanded) -- cgit v1.2.3