Sha256: 380bca3caea9c2a251192fe93b4e4c5328f3181710c4a00d9f2ccf6cb7388fe9
Contents?: true
Size: 1.76 KB
Versions: 3
Compression:
Stored size: 1.76 KB
Contents
# frozen_string_literal: true require_relative "./email_typo/version" require_relative "./email_typo/add_missing_m" require_relative "./email_typo/add_missing_period" require_relative "./email_typo/aol" require_relative "./email_typo/different_tlds" require_relative "./email_typo/dot_com" require_relative "./email_typo/dot_net" require_relative "./email_typo/dot_org" require_relative "./email_typo/fix_extraneous_letter_dot_com" require_relative "./email_typo/gmail" require_relative "./email_typo/googlemail" require_relative "./email_typo/hotmail" require_relative "./email_typo/icloud" require_relative "./email_typo/known_dot_com" require_relative "./email_typo/period_around_at_sign" require_relative "./email_typo/providers" require_relative "./email_typo/remove_invalid_chars" require_relative "./email_typo/remove_mailto" require_relative "./email_typo/transposed_periods" require_relative "./email_typo/yahoo" module EmailTypo class << self # List of default processors that will be applied to fix any email's typos. attr_accessor :default_processors end self.default_processors = [ RemoveMailTo, RemoveInvalidChars, TransposedPeriods, PeriodAroundAtSign, DifferentTlds, FixExtraneousLetterDotCom, AddMissingM, AddMissingPeriod, Providers, Aol, DotCom, DotNet, DotOrg, Gmail, Googlemail, Hotmail, Icloud, KnownDotCom, Yahoo ] def self.call(email, processors = default_processors) return unless email processors.reduce(email.downcase) do |processed_email, processor| processor.call(processed_email) end end def self.fix(email, processors = default_processors) warn "EmailTypo.fix is deprecated; use EmailTypo.call instead." call(email, processors) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
email_typo-0.2.2 | lib/email_typo.rb |
email_typo-0.2.1 | lib/email_typo.rb |
email_typo-0.2.0 | lib/email_typo.rb |