1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

instead of returning $& if =~ succeeds, use String#[]

This commit is contained in:
Xavier Noria 2012-08-25 03:08:45 +02:00
parent 148e33058c
commit 4fbd350dca

View file

@ -443,7 +443,7 @@ module ActiveSupport #:nodoc:
def load_file(path, const_paths = loadable_constants_for_path(path))
log_call path, const_paths
const_paths = [const_paths].compact unless const_paths.is_a? Array
parent_paths = const_paths.collect { |const_path| /.*(?=::)/ =~ const_path ? $& : :Object }
parent_paths = const_paths.collect { |const_path| const_path[/.*(?=::)/] || :Object }
result = nil
newly_defined_paths = new_constants_in(*parent_paths) do