Skip to content

Commit

Permalink
Chomp will work without checking for end of the string
Browse files Browse the repository at this point in the history
  • Loading branch information
bdewater committed Jul 29, 2018
1 parent 975fa15 commit 4c9c18e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activesupport/lib/active_support/dependencies.rb
Expand Up @@ -345,7 +345,7 @@ def clear
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)

Expand Down Expand Up @@ -395,7 +395,7 @@ def qualified_const_defined?(path)
# 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 = []

Expand Down

0 comments on commit 4c9c18e

Please sign in to comment.