DEV: Further refine development reload for plugin files (#22141)

Followup f3afc8bf85 to better
exclude all spec files including PageObject files.
This commit is contained in:
Martin Brennan 2023-06-16 18:15:15 +10:00 committed by GitHub
parent d548231475
commit 3802d0de9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,8 @@ if Rails.env.development? && !Rails.configuration.cache_classes && Discourse.run
not_autoloaded =
files.filter_map do |file|
autoloaded = Rails.autoloaders.main.__autoloads.key? file
if !autoloaded && !file.end_with?("spec.rb")
if !autoloaded && !file.match(%r{/spec/})
Pathname.new(file).relative_path_from(Rails.root)
end
end