🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

vjt-email_validator

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vjt-email_validator

1.5.4
Rubygems
Version published
Maintainers
2
Created
Source

= email_validator ActiveModel::EachValidator

Validate e-mail addresses against RFC 2822 and RFC 3696.

== Installation

gem 'vjt-email_validator', :git => 'git://github.com/vjt/email_validator'

== Usage

Standalone:

EmailValidator.valid?(email) # => true or false

Inside an ActiveRecord model:

class Person < ActiveRecord::Base validates :email, :email => true end

=== Options

Giving :email => true to the validate method uses the following default options. Customize them using :email => { .. }; E.g. :email => {:check_mx => true}

:message String. A custom error message (default is: "does not appear to be a valid e-mail address") :mx_message String. A custom error message displayed when there is no MX for the given e-mail address (default is: "is not routable") :multiple_message String. A custom error message displayed when one of the e-mail addresses in the record is invalid (default is "appears to contain an invalid e-mail address) :multiple Boolean. Allows multiple email addresses separated by space and/or comma/colon :check_mx Boolean. Check domain for a valid MX record (default is false) :local_length Maximum number of characters allowed in the local part (default is 64) :domain_length Maximum number of characters allowed in the domain part (default is 255)

== Testing

To execute the unit tests run rake test.

The unit tests for this plugin use an in-memory sqlite3 database.

== Resources

  • Based on http://github.com/alexdunae/validates_email_format_of
  • http://github.com/vjt/email_validator

== Original Credits

Written by Alex Dunae (dunae.ca), 2006-11.

Many thanks to the plugin's recent contributors: https://github.com/alexdunae/validates_email_format_of/contributors

Thanks to Francis Hwang (http://fhwang.net/) at Diversion Media for creating the 1.1 update. Thanks to Travis Sinnott for creating the 1.3 update. Thanks to Denis Ahearn at Riverock Technologies (http://www.riverocktech.com/) for creating the 1.4 update. Thanks to George Anderson (http://github.com/george) and 'history' (http://github.com/history) for creating the 1.4.1 update.

== Rewrite

Rewrote by Marcello Barnaba (vjt@openssl.it), 2011-02 as an ActiveModel::EachValidator

FAQs

Package last updated on 06 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts