Go to file
Arthur Poulet c27bd639d3
Fix bug on Rfc1123::Public
2016-05-15 00:38:37 +02:00
certs update to 0.1.1 2016-04-29 16:34:34 +02:00
lib Fix bug on Rfc1123::Public 2016-05-15 00:38:37 +02:00
test update to 0.2.2 2016-05-11 18:44:38 +02:00
.gitignore update to 0.1.3 (fix name) 2016-04-29 17:49:04 +02:00
CHANGELOG Fix bug on Rfc1123::Public 2016-05-15 00:38:37 +02:00
Gemfile update deps (license conflict) 2016-05-13 14:50:41 +02:00
Gemfile.lock update deps (license conflict) 2016-05-13 14:50:41 +02:00
README.md Fix readme 2016-05-04 11:45:46 +02:00
Rakefile initialize 2016-04-29 15:49:49 +02:00
ruby_email.gemspec update to v0.2.2.2 2016-05-15 00:13:20 +02:00
version Fix bug on Rfc1123::Public 2016-05-15 00:38:37 +02:00

README.md

# A RFC compliant Email validator

Installation

gem install ruby_email

or in the Gemfile

gem 'ruby_email'

## Usage in Ruby

require 'ruby_email'

# Pure Rfc5322
RubyEmail::Rfc5322.validates? "toto@tata" # => true
RubyEmail::Rfc5322.match "toto@tata" # => #<MatchData "toto@tata" local:"toto" domain:"tata">
RubyEmail::Rfc5322.validates? "toto" # => false
RubyEmail::Rfc5322.match "toto" # => nil

# Rfc5322 + Internet basic usage
RubyEmail::Rfc5322::Public.validates? "toto@tata.com" # => true
RubyEmail::Rfc5322::Public.match "toto@tata.com" # => #<MatchData "toto@tata" local:"toto" domain:"tata.com">

# Rfc5322 Strings
require 'ruby_email/rfc5322/string'
"local@domain".is_email? # => true
"local".is_email? # => false

# Rfc5322 Strings + Internet basic usage
require 'ruby_email/rfc5322/public/string'
"local@domain.root".is_public_email? # => true
"local@domain".is_public_email? # => false

Usage in Ruby on Rails

class Model < ActiveRecord::Base
  # validates :email, format: RubyEmail::Rfc5322::REGEXP # valid on an intranet ...
  validates :email, format: RubyEmail::Rfc5322::Public::REGEXP
end

Unitary tests

rake test

Contributes !

Find a bug ? Want a new feature ? Create a clear pull request and we'll see :)

  • Nephos (poulet_a)