diff options
author | Bart de Water <bartdewater@gmail.com> | 2018-07-29 14:42:35 -0400 |
---|---|---|
committer | Bart de Water <bartdewater@gmail.com> | 2018-07-29 14:42:35 -0400 |
commit | 4c9c18e93a78957eff1e2aedc2e87c3030594df3 (patch) | |
tree | a380446ab753b3e9e68ff702546016011b8956b5 /activesupport/lib/active_support | |
parent | 975fa15b47e4ef47a3b46f0e946860a076167149 (diff) | |
download | rails-4c9c18e93a78957eff1e2aedc2e87c3030594df3.tar.gz rails-4c9c18e93a78957eff1e2aedc2e87c3030594df3.tar.bz2 rails-4c9c18e93a78957eff1e2aedc2e87c3030594df3.zip |
Chomp will work without checking for end of the string
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 4 |
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 = [] |