lib/sanitize_email/config.rb in sanitize_email-2.0.3 vs lib/sanitize_email/config.rb in sanitize_email-2.0.4
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-# Copyright (c) 2008-16 Peter H. Boling of RailsBling.com
+# Copyright (c) 2008 - 2018, 2020, 2022, 2024 Peter H. Boling of RailsBling.com
# Released under the MIT license
module SanitizeEmail
# The API for configuring SanitizeEmail is via `SanitizeEmail.config`
# Available configuration options are listed in the `DEFAULTS` constant.
@@ -14,52 +14,52 @@
end
DEFAULTS = {
# Specify the BCC addresses for the messages
# that go out in "local" environments
- :sanitized_bcc => nil,
+ sanitized_bcc: nil,
# Specify the CC addresses for the messages
# that go out in "local" environments
- :sanitized_cc => nil,
+ sanitized_cc: nil,
# The recipient addresses for the messages,
# either as a string (for a single address)
# or an array (for multiple addresses)
# that go out in "local" environments
- :sanitized_to => nil,
+ sanitized_to: nil,
- # a white list
- :good_list => nil,
+ # an allow list
+ good_list: nil,
- # a black list
- :bad_list => nil,
+ # a block list
+ bad_list: nil,
- :environment => if defined?(Rails) && Rails.env.present?
- "[#{Rails.env}]"
- else
- '[UNKNOWN ENVIRONMENT]'
- end,
+ environment: if defined?(Rails) && Rails.env.present?
+ "[#{Rails.env}]"
+ else
+ "[UNKNOWN ENVIRONMENT]"
+ end,
# Use the "real" email address as the username
# for the sanitized email address
# e.g. "real@example.com <sanitized@example.com>"
- :use_actual_email_as_sanitized_user_name => false,
+ use_actual_email_as_sanitized_user_name: false,
# Prepend the "real" email address onto the Subject line of the message
# e.g. "real@example.com rest of subject"
- :use_actual_email_prepended_to_subject => false,
+ use_actual_email_prepended_to_subject: false,
# Prepend the Rails environment onto the Subject line of the message
# e.g. "[development] rest of subject"
- :use_actual_environment_prepended_to_subject => false,
+ use_actual_environment_prepended_to_subject: false,
# True / False turns on or off sanitization,
# while nil ignores this setting and checks activation_proc
- :engage => nil,
+ engage: nil,
- :activation_proc => proc { false },
+ activation_proc: proc { false },
}.freeze
@config ||= DEFAULTS.dup
def self.configure
yield @config
@@ -81,12 +81,12 @@
end
config_force_sanitize_deprecation_warning
end
def self.config_force_sanitize_deprecation_warning
- return nil if @config[:force_sanitize].nil?
+ return if @config[:force_sanitize].nil?
deprecation_warning_message(
- <<-DEPRECATION
+ <<-DEPRECATION,
SanitizeEmail::Config.config[:force_sanitize] is deprecated.
Please use SanitizeEmail.force_sanitize or SanitizeEmail.sanitary instead.
Refer to https://github.com/pboling/sanitize_email/wiki for examples.
DEPRECATION
)