aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-07-30 20:39:54 +0200
committerGitHub <noreply@github.com>2018-07-30 20:39:54 +0200
commit6db5b6dc4322d043db4d6eff2cc49de86baf1595 (patch)
treec3bedc37aa33fa6ecb4bb0ab3356d1d0c76eb1b6 /activesupport
parent362042c0d784832d0f5185d7241cf4ae0a300931 (diff)
parent4c9c18e93a78957eff1e2aedc2e87c3030594df3 (diff)
downloadrails-6db5b6dc4322d043db4d6eff2cc49de86baf1595.tar.gz
rails-6db5b6dc4322d043db4d6eff2cc49de86baf1595.tar.bz2
rails-6db5b6dc4322d043db4d6eff2cc49de86baf1595.zip
Merge pull request #33467 from bdewater/chomp-unconditionally
Chomp will work without checking for end of the string
Diffstat (limited to 'activesupport')
-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 46a31a9016..9dc2c46880 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 = file_name.chomp(".rb") if file_name.end_with?(".rb")
+ file_name = file_name.chomp(".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 = path.chomp(".rb") if path.end_with?(".rb")
+ path = path.chomp(".rb")
expanded_path = File.expand_path(path)
paths = []