Skip to content

Commit

Permalink
Lint: line too long
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Nov 3, 2016
1 parent f22f4b1 commit fad3d2c
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions lib/sanitize_email/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ class << self
end

DEFAULTS = {
# Specify the BCC addresses for the messages that go out in "local" environments
# Specify the BCC addresses for the messages
# that go out in "local" environments
:sanitized_bcc => nil,

# Specify the CC addresses for the messages that go out in "local" environments
# Specify the CC addresses for the messages
# that go out in "local" environments
: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
# 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,

# a white list
Expand All @@ -29,9 +33,14 @@ class << self
# a black list
:bad_list => nil,

:environment => defined?(Rails) && Rails.env.present? ? ("[" << Rails.env << "]") : "[UNKNOWN ENVIRONMENT]",
: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
# 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,

Expand All @@ -43,7 +52,8 @@ class << self
# e.g. "[development] rest of subject"
:use_actual_environment_prepended_to_subject => false,

# True / False turns on or off sanitization, while nil ignores this setting and checks activation_proc
# True / False turns on or off sanitization,
# while nil ignores this setting and checks activation_proc
:engage => nil,

:activation_proc => Proc.new { false }
Expand All @@ -54,14 +64,18 @@ def self.configure &block
yield @config

# Gracefully handle deprecated config values.
# Actual deprecation warnings are thrown in the top SanitizeEmail module thanks to our use of dynamic methods.
# Actual deprecation warnings are thrown in the top SanitizeEmail module
# thanks to our use of dynamic methods.
if @config[:local_environments] && defined?(Rails)
@config[:activation_proc] = Proc.new { SanitizeEmail.local_environments.include?(Rails.env) }
@config[:activation_proc] = Proc.new {
SanitizeEmail.local_environments.include?(Rails.env)
}
end
if @config[:sanitized_recipients]
SanitizeEmail.sanitized_recipients # calling it to trigger the deprecation warning.
# Won't actually be set with any value,
# because we are still inside the configure block.
# calling it to trigger the deprecation warning.
# Won't actually be set with any value,
# because we are still inside the configure block.
SanitizeEmail.sanitized_recipients
@config[:sanitized_to] = @config[:sanitized_recipients]
end
if !@config[:force_sanitize].nil?
Expand Down

0 comments on commit fad3d2c

Please sign in to comment.