mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 10:15:47 +08:00
ec9734bc42
See https://github.com/discourse/discourse/security/advisories/GHSA-rcc5-28r3-23rr Co-authored-by: OsamaSayegh <asooomaasoooma90@gmail.com> Co-authored-by: Daniel Waterworth <me@danielwaterworth.com>
25 lines
798 B
Ruby
25 lines
798 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector
|
|
CUSTOM_PATHS = {
|
|
'canonical_url' => 'CanonicalURL',
|
|
'clean_up_unmatched_ips' => 'CleanUpUnmatchedIPs',
|
|
'homepage_constraint' => 'HomePageConstraint',
|
|
'ip_addr' => 'IPAddr',
|
|
'onpdiff' => 'ONPDiff',
|
|
'onceoff' => 'Jobs',
|
|
'pop3_polling_enabled_setting_validator' => 'POP3PollingEnabledSettingValidator',
|
|
'regular' => 'Jobs',
|
|
'scheduled' => 'Jobs',
|
|
'version' => 'Discourse',
|
|
'ssrf_detector' => 'SSRFDetector',
|
|
'http' => 'HTTP',
|
|
}
|
|
|
|
def self.camelize(basename, abspath)
|
|
return basename.camelize if abspath.ends_with?("onceoff.rb")
|
|
return 'Jobs' if abspath.ends_with?("jobs/base.rb")
|
|
CUSTOM_PATHS.fetch(basename, basename.camelize)
|
|
end
|
|
end
|