aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-08-24 01:16:27 +0200
committerXavier Noria <fxn@hashref.com>2012-08-24 01:17:00 +0200
commit6a70f2dd6b791c3f4888122d5b7dd9c8f5cac871 (patch)
treeed1585bbf7136a7d8da33294ece696dbb0c1d3f3 /activesupport/lib/active_support/dependencies.rb
parent2abe950236d9e15510e83372c5dc0d68210580da (diff)
downloadrails-6a70f2dd6b791c3f4888122d5b7dd9c8f5cac871.tar.gz
rails-6a70f2dd6b791c3f4888122d5b7dd9c8f5cac871.tar.bz2
rails-6a70f2dd6b791c3f4888122d5b7dd9c8f5cac871.zip
simplifies a regexp
The new regexp has less work to do, we anchor a fixed string at the end and need no group.
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-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 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)