sixarm_ruby_email_address_validation 1.2.0 → 1.2.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.
- data.tar.gz.sig +1 -1
- data/.gemtest +0 -0
- data/CHANGELOG.txt +3 -0
- data/Rakefile +8 -0
- data/VERSION +1 -0
- data/lib/sixarm_ruby_email_address_validation.rb +1 -59
- data/test/sixarm_ruby_email_address_validation_test.rb +3 -0
- metadata +7 -3
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Qa�
|
data/.gemtest
ADDED
File without changes
|
data/CHANGELOG.txt
ADDED
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.2.2
|
@@ -1,64 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin rdoc
|
3
|
-
|
4
|
-
= SixArm » Ruby » Email address validation using RFC 822 pattern matching
|
5
|
-
|
6
|
-
Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
|
7
|
-
Copyright:: Copyright (c) 2006-2011 Joel Parker Henderson
|
8
|
-
License:: See LICENSE.txt file
|
9
|
-
|
10
|
-
Email address regex, to validate an email address using RFC 822.
|
11
|
-
|
12
|
-
This is a gem wrapper around http://tfletcher.com/lib/rfc822.rb
|
13
|
-
|
14
|
-
@example
|
15
|
-
if EMAIL_ADDRESS_PATTERN=~'foo@bar.com'
|
16
|
-
puts "found"
|
17
|
-
else
|
18
|
-
puts "not found"
|
19
|
-
end
|
20
|
-
=> found
|
21
|
-
|
22
|
-
To find an email address in a string, do the pattern match
|
23
|
-
then use the result, which is the match's string position:
|
24
|
-
|
25
|
-
@example of match position:
|
26
|
-
match_position = EMAIL_ADDRESS_PATTERN=~'foo@bar.com'
|
27
|
-
=> 0
|
28
|
-
|
29
|
-
match_position = EMAIL_ADDRESS_PATTERN=~'... foo@bar.com ...'
|
30
|
-
=> 4
|
31
|
-
|
32
|
-
match_position = EMAIL_ADDRESS_PATTERN=~'... hello world ...'
|
33
|
-
=> nil
|
34
|
-
|
35
|
-
|
36
|
-
To do an exact pattern match, use the EMAIL_ADDRESS_EXACT_PATTERN.
|
37
|
-
This matches the entire string from start to end; in other words,
|
38
|
-
the entire string must be one email address.
|
39
|
-
|
40
|
-
@example of exact pattern match:
|
41
|
-
if EMAIL_ADDRESS_EXACT_PATTERN=~'foo@bar.com'
|
42
|
-
puts "found"
|
43
|
-
else
|
44
|
-
puts "not found"
|
45
|
-
end
|
46
|
-
=> found
|
47
|
-
|
48
|
-
if EMAIL_ADDRESS_EXACT_PATTERN=~'... foo@bar.com ...'
|
49
|
-
puts "found"
|
50
|
-
else
|
51
|
-
puts "not found"
|
52
|
-
end
|
53
|
-
=> not found
|
54
|
-
|
55
|
-
The exact pattern is especialy useful to validate an email address.
|
56
|
-
|
57
|
-
Example to validate an email address:
|
58
|
-
def valid?(email_address)
|
59
|
-
EMAIL_ADDRESS_EXACT_PATTERN=~email_address ? true : false
|
60
|
-
end
|
61
|
-
|
3
|
+
Please see README.rdoc
|
62
4
|
=end
|
63
5
|
|
64
6
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sixarm_ruby_email_address_validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- SixArm
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
eabwpCbAopo=
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2011-04-
|
33
|
+
date: 2011-04-24 00:00:00 -07:00
|
34
34
|
default_executable:
|
35
35
|
dependencies: []
|
36
36
|
|
@@ -43,9 +43,13 @@ extensions: []
|
|
43
43
|
extra_rdoc_files: []
|
44
44
|
|
45
45
|
files:
|
46
|
-
-
|
46
|
+
- .gemtest
|
47
|
+
- CHANGELOG.txt
|
47
48
|
- INSTALL.txt
|
48
49
|
- LICENSE.txt
|
50
|
+
- Rakefile
|
51
|
+
- README.rdoc
|
52
|
+
- VERSION
|
49
53
|
- lib/sixarm_ruby_email_address_validation.rb
|
50
54
|
- test/sixarm_ruby_email_address_validation_test.rb
|
51
55
|
has_rdoc: true
|
metadata.gz.sig
CHANGED
Binary file
|