aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman+no-recruiters@gmail.com>2018-07-28 21:58:36 -0500
committerGitHub <noreply@github.com>2018-07-28 21:58:36 -0500
commitf10acfa7b64ac93cbbfc97e3a92d644960198764 (patch)
tree244ed8c81174abd2ae651f93781425f518688be9 /activesupport/lib/active_support/dependencies.rb
parent8741052ba25722283ea057f6f022f16b1931ce3e (diff)
parent27c6c071165342c770ed9c697024aa101dad4049 (diff)
downloadrails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.gz
rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.bz2
rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.zip
Merge pull request #32695 from bdewater/enable-regex-cops
Enable regex cops
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-rw-r--r--activesupport/lib/active_support/dependencies.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index a02cefc78e..46a31a9016 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -345,7 +345,7 @@ module ActiveSupport #:nodoc:
end
def require_or_load(file_name, const_path = nil)
- file_name = $` if file_name =~ /\.rb\z/
+ file_name = file_name.chomp(".rb") if file_name.end_with?(".rb")
expanded = File.expand_path(file_name)
return if loaded.include?(expanded)
@@ -395,7 +395,7 @@ module ActiveSupport #:nodoc:
# constant paths which would cause Dependencies to attempt to load this
# file.
def loadable_constants_for_path(path, bases = autoload_paths)
- path = $` if path =~ /\.rb\z/
+ path = path.chomp(".rb") if path.end_with?(".rb")
expanded_path = File.expand_path(path)
paths = []