ValidateEmail 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
data/lib/ValidateEmail.rb CHANGED
@@ -2,7 +2,7 @@ require 'resolv'
2
2
 
3
3
  module ValidateEmail
4
4
  def self.validate(email, validate_mx = false)
5
- email_pattern = (email =~ /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/)
5
+ email_pattern = (email =~ /^[a-zA-Z][\w\.\+-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/)
6
6
  is_valid = email_pattern.nil? ? false : true
7
7
  is_valid = validate_mx_record(email) if is_valid && validate_mx
8
8
 
@@ -1,3 +1,3 @@
1
1
  module Validateemail
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -23,6 +23,9 @@ class ValidateEmailTest < Test::Unit::TestCase
23
23
  assert_valid("bv.satyaram@bvsatyaram.com", true)
24
24
  assert_valid("bv-satyaram@bvsatyaram.com", true)
25
25
  assert_valid("bvsatyaram@rubygems.org", true)
26
+ assert_valid("bv12.satyaram@rubygems.org", true)
27
+ assert_valid("bvsatyaram+google@bvsatyaram.com", true)
28
+ assert_valid("bv.satya_ram-123+google123@bvsatyaram.com", true)
26
29
  assert_not_valid("bvsatyaram@fhgtrityhgs.com", true)
27
30
  end
28
31
 
metadata CHANGED
@@ -1,33 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ValidateEmail
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 0
9
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Satyaram B V
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-05-03 00:00:00 +05:30
18
- default_executable:
12
+ date: 2013-06-12 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description: Validates email address optionally also validating the mx records
22
- email:
15
+ email:
23
16
  - bvsatyaram@gmail.com
24
17
  executables: []
25
-
26
18
  extensions: []
27
-
28
19
  extra_rdoc_files: []
29
-
30
- files:
20
+ files:
31
21
  - .gitignore
32
22
  - Gemfile
33
23
  - README.md
@@ -36,35 +26,29 @@ files:
36
26
  - lib/ValidateEmail.rb
37
27
  - lib/ValidateEmail/version.rb
38
28
  - test/validate_email_test.rb
39
- has_rdoc: true
40
29
  homepage: http://bvsatyaram.com
41
30
  licenses: []
42
-
43
31
  post_install_message:
44
32
  rdoc_options: []
45
-
46
- require_paths:
33
+ require_paths:
47
34
  - lib
48
- required_ruby_version: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- segments:
53
- - 0
54
- version: "0"
55
- required_rubygems_version: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- segments:
60
- - 0
61
- version: "0"
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
62
47
  requirements: []
63
-
64
48
  rubyforge_project: ValidateEmail
65
- rubygems_version: 1.3.6
49
+ rubygems_version: 1.8.25
66
50
  signing_key:
67
51
  specification_version: 3
68
52
  summary: Validates email address optionally also validating the mx records
69
- test_files: []
70
-
53
+ test_files:
54
+ - test/validate_email_test.rb