2019-10-02 12:01:53 +08:00
|
|
|
# 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',
|
2022-11-02 00:34:12 +08:00
|
|
|
'ssrf_detector' => 'SSRFDetector',
|
|
|
|
'http' => 'HTTP',
|
2019-10-02 12:01:53 +08:00
|
|
|
}
|
|
|
|
|
2019-10-02 12:54:08 +08:00
|
|
|
def self.camelize(basename, abspath)
|
2019-10-08 10:43:54 +08:00
|
|
|
return basename.camelize if abspath.ends_with?("onceoff.rb")
|
|
|
|
return 'Jobs' if abspath.ends_with?("jobs/base.rb")
|
2019-10-02 12:01:53 +08:00
|
|
|
CUSTOM_PATHS.fetch(basename, basename.camelize)
|
|
|
|
end
|
|
|
|
end
|