sixarm_ruby_email_address_validation 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +9 -4
- data/lib/sixarm_ruby_email_address_validation.rb +1 -18
- data/lib/sixarm_ruby_email_address_validation/email_address_validation.rb +23 -0
- data/test/sixarm_ruby_email_address_validation_test.rb +9 -60
- data/test/sixarm_ruby_email_address_validation_test/email_address_validation_test.rb +59 -0
- metadata +135 -43
- metadata.gz.sig +1 -2
- data/.gemtest +0 -0
- data/README.md +0 -147
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3cafcc07ddbb7092ae3d4fd1554f4a9289761553
|
4
|
+
data.tar.gz: 3b97a62e8f29c0dd5e3891adae94e1e4266ffc83
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c40db8563a78b93c8fa17c95ca08e529888ccf3ff5541001cba8a2d76c93a23cfa758120d5aeac38bee46cced177ff7d3212d2d6ce6b6d4f31a763b912a14a12
|
7
|
+
data.tar.gz: 7b88d5da0f21e98bb699b26c14ee0cb7a04eb585f078c40a22ed0a8d71ec2d2d919001882f2224ed031fed9d5d3034f519cb1ba62c8a0710eaed6f2ad89239c9
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rake"
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs
|
7
|
-
t.pattern =
|
6
|
+
t.libs.push("lib", "test")
|
7
|
+
t.pattern = "test/**/*.rb"
|
8
8
|
end
|
9
|
+
|
10
|
+
task :default => [:test]
|
11
|
+
task :default => [:test]
|
12
|
+
task :default => [:test]
|
13
|
+
task :default => [:test]
|
@@ -3,22 +3,5 @@
|
|
3
3
|
Please see README
|
4
4
|
=end
|
5
5
|
|
6
|
+
require_relative "sixarm_ruby_email_address_validation/email_address_validation"
|
6
7
|
|
7
|
-
class EmailAddressValidation
|
8
|
-
|
9
|
-
QuotedText = Regexp.new '[^\\x0d\\x22\\x5c\\x80-\\xff]', nil, 'n'
|
10
|
-
DomainText = Regexp.new '[^\\x0d\\x5b-\\x5d\\x80-\\xff]', nil, 'n'
|
11
|
-
Atom = Regexp.new '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+', nil, 'n'
|
12
|
-
QuotedPair = Regexp.new '\\x5c[\\x00-\\x7f]', nil, 'n'
|
13
|
-
DomainLiteral = Regexp.new "\\x5b(?:#{QuotedText}|#{QuotedPair})*\\x5d", nil, 'n'
|
14
|
-
QuotedString = Regexp.new "\\x22(?:#{QuotedText}|#{QuotedPair})*\\x22", nil, 'n'
|
15
|
-
DomainRef = Atom
|
16
|
-
SubDomain = "(?:#{DomainRef}|#{DomainLiteral})"
|
17
|
-
Word = "(?:#{Atom}|#{QuotedString})"
|
18
|
-
Domain = "#{SubDomain}(?:\\x2e#{SubDomain})*"
|
19
|
-
LocalPart = "#{Word}(?:\\x2e#{Word})*"
|
20
|
-
Spec = "#{LocalPart}\\x40#{Domain}"
|
21
|
-
Pattern = Regexp.new "#{Spec}", nil, 'n'
|
22
|
-
PatternExact = Regexp.new "\\A#{Spec}\\z", nil, 'n'
|
23
|
-
|
24
|
-
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin rdoc
|
3
|
+
Email address validation regular expression constants.
|
4
|
+
=end
|
5
|
+
|
6
|
+
class EmailAddressValidation
|
7
|
+
|
8
|
+
QuotedText = Regexp.new '[^\\x0d\\x22\\x5c\\x80-\\xff]', nil, 'n'
|
9
|
+
DomainText = Regexp.new '[^\\x0d\\x5b-\\x5d\\x80-\\xff]', nil, 'n'
|
10
|
+
Atom = Regexp.new '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+', nil, 'n'
|
11
|
+
QuotedPair = Regexp.new '\\x5c[\\x00-\\x7f]', nil, 'n'
|
12
|
+
DomainLiteral = Regexp.new "\\x5b(?:#{QuotedText}|#{QuotedPair})*\\x5d", nil, 'n'
|
13
|
+
QuotedString = Regexp.new "\\x22(?:#{QuotedText}|#{QuotedPair})*\\x22", nil, 'n'
|
14
|
+
DomainRef = Atom
|
15
|
+
SubDomain = "(?:#{DomainRef}|#{DomainLiteral})"
|
16
|
+
Word = "(?:#{Atom}|#{QuotedString})"
|
17
|
+
Domain = "#{SubDomain}(?:\\x2e#{SubDomain})*"
|
18
|
+
LocalPart = "#{Word}(?:\\x2e#{Word})*"
|
19
|
+
Spec = "#{LocalPart}\\x40#{Domain}"
|
20
|
+
Pattern = Regexp.new "#{Spec}", nil, 'n'
|
21
|
+
PatternExact = Regexp.new "\\A#{Spec}\\z", nil, 'n'
|
22
|
+
|
23
|
+
end
|
@@ -1,62 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "coveralls"
|
4
|
+
require "simplecov"
|
5
|
+
Coveralls.wear!
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
8
|
+
Coveralls::SimpleCov::Formatter
|
9
|
+
]
|
4
10
|
SimpleCov.start
|
5
|
-
require
|
6
|
-
|
7
|
-
describe EmailAddressValidation do
|
8
|
-
|
9
|
-
describe "pattern" do
|
10
|
-
|
11
|
-
describe "with typical" do
|
12
|
-
|
13
|
-
it "success" do
|
14
|
-
(EmailAddressValidation::Pattern=~'foo@bar.com').must_equal 0
|
15
|
-
end
|
16
|
-
|
17
|
-
it "failure" do
|
18
|
-
(EmailAddressValidation::Pattern=~'foo').must_equal nil
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "with chaff" do
|
22
|
-
|
23
|
-
it "success" do
|
24
|
-
(EmailAddressValidation::Pattern=~'... foo@bar.com ...').must_equal 4
|
25
|
-
end
|
26
|
-
|
27
|
-
it "failure" do
|
28
|
-
(EmailAddressValidation::Pattern=~'... foo ...').must_equal nil
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "pattern exact" do
|
38
|
-
|
39
|
-
describe "with typical" do
|
40
|
-
|
41
|
-
it "success" do
|
42
|
-
(EmailAddressValidation::PatternExact=~'foo@bar.com').must_equal 0
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "with chaff" do
|
48
|
-
|
49
|
-
it "failure due to left chaff" do
|
50
|
-
(EmailAddressValidation::PatternExact=~'... foo@bar.com').must_equal nil
|
51
|
-
end
|
52
|
-
|
53
|
-
it "failure due to right chaff" do
|
54
|
-
(EmailAddressValidation::PatternExact=~'foo@bar.com ...').must_equal nil
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
11
|
+
require "sixarm_ruby_email_address_validation"
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "sixarm_ruby_email_address_validation_test"
|
3
|
+
|
4
|
+
describe EmailAddressValidation do
|
5
|
+
|
6
|
+
describe "pattern" do
|
7
|
+
|
8
|
+
describe "with typical" do
|
9
|
+
|
10
|
+
it "success" do
|
11
|
+
(EmailAddressValidation::Pattern=~'foo@bar.com').must_equal 0
|
12
|
+
end
|
13
|
+
|
14
|
+
it "failure" do
|
15
|
+
(EmailAddressValidation::Pattern=~'foo').must_equal nil
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "with chaff" do
|
19
|
+
|
20
|
+
it "success" do
|
21
|
+
(EmailAddressValidation::Pattern=~'... foo@bar.com ...').must_equal 4
|
22
|
+
end
|
23
|
+
|
24
|
+
it "failure" do
|
25
|
+
(EmailAddressValidation::Pattern=~'... foo ...').must_equal nil
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "pattern exact" do
|
35
|
+
|
36
|
+
describe "with typical" do
|
37
|
+
|
38
|
+
it "success" do
|
39
|
+
(EmailAddressValidation::PatternExact=~'foo@bar.com').must_equal 0
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "with chaff" do
|
45
|
+
|
46
|
+
it "failure due to left chaff" do
|
47
|
+
(EmailAddressValidation::PatternExact=~'... foo@bar.com').must_equal nil
|
48
|
+
end
|
49
|
+
|
50
|
+
it "failure due to right chaff" do
|
51
|
+
(EmailAddressValidation::PatternExact=~'foo@bar.com ...').must_equal nil
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
metadata
CHANGED
@@ -1,79 +1,171 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_email_address_validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- SixArm
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain:
|
12
|
-
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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pQ7
|
40
|
+
RTIGlfhlIFkMV3wT0LTsNznUPsoo6e+IW/tDrk23mrNRY6QynTETb+QVIevuzD9m
|
41
|
+
Drcxp/zlVhud+a0ezdnyNvF520arJWvqA4GrOo8F+TT2vVrjscgYjiVGdSq+8wQv
|
42
|
+
Efa5jhe8QwG7R1rdpMMP5yBSAqWuFBczMveX5j4rp9Ifw5/XsZbgwcmdm26bjhzh
|
43
|
+
w2grAHIhvR9mztm6uXQlZhv1fu3P+RWHDSYhnZSCJSCdxPzQJ1mG5T5ahiL3HvCZ
|
44
|
+
2AC9FOGkybW6DJEFSFFMlNk0IILsa/gNp8ufGuTVLWF9FUUdMNK+TMbghnifT8/1
|
45
|
+
n+ES/gQPOnvmVkLDGw==
|
46
|
+
-----END CERTIFICATE-----
|
47
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: minitest
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.7.0
|
56
|
+
- - "<"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '6'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 5.7.0
|
66
|
+
- - "<"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 10.4.2
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '11'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 10.4.2
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '11'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: simplecov
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.10.0
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.10.0
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '2'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: coveralls
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 0.8.2
|
116
|
+
- - "<"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.8.2
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '2'
|
129
|
+
description: Email address validation using RFC 822 pattern matching regular expressions
|
41
130
|
email: sixarm@sixarm.com
|
42
131
|
executables: []
|
43
132
|
extensions: []
|
44
133
|
extra_rdoc_files: []
|
45
134
|
files:
|
46
|
-
- .gemtest
|
47
135
|
- Rakefile
|
48
|
-
- README.md
|
49
|
-
- VERSION
|
50
136
|
- lib/sixarm_ruby_email_address_validation.rb
|
137
|
+
- lib/sixarm_ruby_email_address_validation/email_address_validation.rb
|
51
138
|
- test/sixarm_ruby_email_address_validation_test.rb
|
139
|
+
- test/sixarm_ruby_email_address_validation_test/email_address_validation_test.rb
|
52
140
|
homepage: http://sixarm.com/
|
53
|
-
licenses:
|
141
|
+
licenses:
|
142
|
+
- BSD
|
143
|
+
- GPL
|
144
|
+
- MIT
|
145
|
+
- PAL
|
146
|
+
- Various
|
147
|
+
metadata: {}
|
54
148
|
post_install_message:
|
55
149
|
rdoc_options: []
|
56
150
|
require_paths:
|
57
151
|
- lib
|
58
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
153
|
requirements:
|
61
|
-
- -
|
154
|
+
- - ">="
|
62
155
|
- !ruby/object:Gem::Version
|
63
156
|
version: '0'
|
64
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
158
|
requirements:
|
67
|
-
- -
|
159
|
+
- - ">="
|
68
160
|
- !ruby/object:Gem::Version
|
69
161
|
version: '0'
|
70
162
|
requirements: []
|
71
163
|
rubyforge_project:
|
72
|
-
rubygems_version:
|
164
|
+
rubygems_version: 2.4.8
|
73
165
|
signing_key:
|
74
|
-
specification_version:
|
75
|
-
summary: SixArm » Ruby » Email address validation using RFC 822
|
76
|
-
regular expressions
|
166
|
+
specification_version: 4
|
167
|
+
summary: SixArm.com » Ruby » Email address validation using RFC 822
|
77
168
|
test_files:
|
78
169
|
- test/sixarm_ruby_email_address_validation_test.rb
|
170
|
+
- test/sixarm_ruby_email_address_validation_test/email_address_validation_test.rb
|
79
171
|
has_rdoc: true
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
��
|
2
|
-
��GP��c�Da9̮3��p|�sY��TU=K�LLF�4y��3���_�423��;���w��=t����G���-x��m���
|
1
|
+
��7�-����8���ʃĕ��:��Ox.�>�X#�*��w;դ�A�ze�Eaq���\"��CF)�-c9��.��p�r��r_�\���=�d�b�ł-��R��-;Vt�L�G5~��z����eD+��y���c�|�Ϡ蓏b�w���nmD�(�Nz7��ݔ��0��K�GҰ|�s���Л��w��ǹr�]-�b��A~����ϰH�}yB5%NV�}t�2�ۍ�pX�t����2,l��ag��i�g��˿P�sE�;���T�~��<�7�"�ƀe�y�If.7����Z�f$?��?��x㸷��ș��ij�7�d^�N��݈ ����;�m;l��cgQ�6��R>����{�{BQx78n:��9�a.{�a%��� ��,Lq�8 ����PIYb�)��q��i.�@p�<������[�7au�T����s��\%-���ST�Y%�q��-���v��bj̢u��I�_s��´f2
|
data/.gemtest
DELETED
File without changes
|
data/README.md
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
# SixArm.com » Ruby » <br> Email address validation using RFC 822 pattern matching
|
2
|
-
|
3
|
-
* Docs: <http://sixarm.com/sixarm_ruby_email_address_validation/doc>
|
4
|
-
* Repo: <http://github.com/sixarm/sixarm_ruby_email_address_validation>
|
5
|
-
* Email: Joel Parker Henderson, <joel@sixarm.com>
|
6
|
-
|
7
|
-
|
8
|
-
## Introduction
|
9
|
-
|
10
|
-
Email address regular expression to validate an email address using RFC 822.
|
11
|
-
|
12
|
-
This is a gem wrapper around http://tfletcher.com/lib/rfc822.rb
|
13
|
-
|
14
|
-
For docs go to <http://sixarm.com/sixarm_ruby_email_address_validation/doc>
|
15
|
-
|
16
|
-
Want to help? We're happy to get pull requests.
|
17
|
-
|
18
|
-
|
19
|
-
## Quickstart
|
20
|
-
|
21
|
-
Install:
|
22
|
-
|
23
|
-
gem install sixarm_ruby_email_address_validation
|
24
|
-
|
25
|
-
Bundler:
|
26
|
-
|
27
|
-
gem "sixarm_ruby_email_address_validation", "=1.3.0"
|
28
|
-
|
29
|
-
Require:
|
30
|
-
|
31
|
-
require "sixarm_ruby_email_address_validation"
|
32
|
-
|
33
|
-
|
34
|
-
## High Security (Optional)
|
35
|
-
|
36
|
-
To enable high security for all our gems:
|
37
|
-
|
38
|
-
wget http://sixarm.com/sixarm.pem
|
39
|
-
gem cert --add sixarm.pem
|
40
|
-
gem sources --add http://sixarm.com
|
41
|
-
|
42
|
-
To install with high security:
|
43
|
-
|
44
|
-
gem install sixarm_ruby_email_address_validation --test --trust-policy HighSecurity
|
45
|
-
|
46
|
-
|
47
|
-
## Example
|
48
|
-
|
49
|
-
if EmailAddressValidation::Pattern=~"foo@bar.com"
|
50
|
-
puts "present"
|
51
|
-
else
|
52
|
-
puts "absent"
|
53
|
-
end
|
54
|
-
=> "found"
|
55
|
-
|
56
|
-
|
57
|
-
## Pattern Match
|
58
|
-
|
59
|
-
To find an email address in a string, do the pattern match
|
60
|
-
then use the result, which is the match's string position:
|
61
|
-
|
62
|
-
Example of match position:
|
63
|
-
|
64
|
-
match_position = EmailAddressValidation::Pattern=~'foo@bar.com'
|
65
|
-
=> 0
|
66
|
-
|
67
|
-
match_position = EmailAddressValidation::Pattern=~'... foo@bar.com ...'
|
68
|
-
=> 4
|
69
|
-
|
70
|
-
match_position = EmailAddressValidation::Pattern=~'... hello world ...'
|
71
|
-
=> nil
|
72
|
-
|
73
|
-
|
74
|
-
## Pattern Match Exact
|
75
|
-
|
76
|
-
To do a pattern match to the entire string, use the EmailAddressValidation::PatternExact.
|
77
|
-
|
78
|
-
The entire string must be one email address.
|
79
|
-
|
80
|
-
Example of pattern match:
|
81
|
-
|
82
|
-
if EmailAddressValidation::PatternExact=~'foo@bar.com'
|
83
|
-
puts "present"
|
84
|
-
else
|
85
|
-
puts "absent"
|
86
|
-
end
|
87
|
-
=> found
|
88
|
-
|
89
|
-
if EmailAddressValidation::PatternExact=~'... foo@bar.com ...'
|
90
|
-
puts "present"
|
91
|
-
else
|
92
|
-
puts "absent"
|
93
|
-
end
|
94
|
-
=> absent
|
95
|
-
|
96
|
-
This pattern is especialy useful to validate an email address.
|
97
|
-
|
98
|
-
Example to validate an email address:
|
99
|
-
|
100
|
-
def valid?(email_address)
|
101
|
-
EmailAddressValidation::PatternExact=~email_address ? true : false
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
## Rails Validation
|
106
|
-
|
107
|
-
To add email address validation to a typical Ruby On Rails model:
|
108
|
-
|
109
|
-
class User
|
110
|
-
include EmailAddressValidation
|
111
|
-
validates :email_address, :format => { :with => EmailAddressValidation::PatternExact }
|
112
|
-
end
|
113
|
-
|
114
|
-
|
115
|
-
## Changes
|
116
|
-
|
117
|
-
* 2012-03-17 2.0.0 Upgrade for Ruby 1.9.3, minitest/spec, improved docs, new API.
|
118
|
-
* 2011-04-24 1.2.2 Upgrade for Ruby 1.9.2 and Rails 3.0.6
|
119
|
-
|
120
|
-
|
121
|
-
## License
|
122
|
-
|
123
|
-
You may choose any of these open source licenses:
|
124
|
-
|
125
|
-
* Apache License
|
126
|
-
* BSD License
|
127
|
-
* CreativeCommons License, Non-commercial Share Alike
|
128
|
-
* GNU General Public License Version 2 (GPL 2)
|
129
|
-
* GNU Lesser General Public License (LGPL)
|
130
|
-
* MIT License
|
131
|
-
* Perl Artistic License
|
132
|
-
* Ruby License
|
133
|
-
|
134
|
-
The software is provided "as is", without warranty of any kind,
|
135
|
-
express or implied, including but not limited to the warranties of
|
136
|
-
merchantability, fitness for a particular purpose and noninfringement.
|
137
|
-
|
138
|
-
In no event shall the authors or copyright holders be liable for any
|
139
|
-
claim, damages or other liability, whether in an action of contract,
|
140
|
-
tort or otherwise, arising from, out of or in connection with the
|
141
|
-
software or the use or other dealings in the software.
|
142
|
-
|
143
|
-
This license is for the included software that is created by SixArm;
|
144
|
-
some of the included software may have its own licenses, copyrights,
|
145
|
-
authors, etc. and these do take precedence over the SixArm license.
|
146
|
-
|
147
|
-
Copyright (c) 2005-2013 Joel Parker Henderson
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.2.4
|