rfc-822-validator 0.0.1

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.
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{rfc-822-validator}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Evan Phoenix, Andrew Cholakian"]
9
+ s.date = %q{2011-03-22}
10
+ s.default_executable = %q{rfc-822}
11
+ s.description = %q{Implementation of RFC-822}
12
+ s.email = %q{andrew@andrewvc.com}
13
+ s.executables = ["rfc-822"]
14
+ s.extra_rdoc_files = ["History.txt", "bin/rfc-822"]
15
+ s.files = [".README.md.swp", ".bnsignore", "History.txt", "README.md", "Rakefile", "bin/rfc-822", "email.kpeg", "lib/rfc-822.rb", "lib/rfc-822/parser.rb", "rfc-822-validator.gemspec", "spec/.rfc-822_spec.rb.swp", "spec/rfc-822_spec.rb", "spec/spec_helper.rb", "test/test_rfc-822.rb", "version.txt"]
16
+ s.homepage = %q{https://github.com/andrewvc/rfc-822}
17
+ s.rdoc_options = ["--main", "README.md"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{rfc-822-validator}
20
+ s.rubygems_version = %q{1.6.0}
21
+ s.summary = %q{Implementation of RFC-822}
22
+ s.test_files = ["test/test_rfc-822.rb"]
23
+
24
+ if s.respond_to? :specification_version then
25
+ s.specification_version = 3
26
+
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
+ s.add_development_dependency(%q<bones>, [">= 3.6.5"])
29
+ else
30
+ s.add_dependency(%q<bones>, [">= 3.6.5"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<bones>, [">= 3.6.5"])
34
+ end
35
+ end
Binary file
@@ -0,0 +1,58 @@
1
+
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+
4
+ describe RFC822 do
5
+ VALID = ["simple@example.com", "\"Abc\@def\"@example.com",
6
+ "\"Fred Bloggs\"@example.com", "\"Joe\\Blow\"@example.com",
7
+ "\"Abc@def\"@example.com", "customer/department=shipping@example.com",
8
+ "$A12345@example.com", "!def!xyz%abc@example.com",
9
+ "c@(Chris's host.)public.example",
10
+ "\"Chris Jones\" <c@a.test>",
11
+ "Group:\"Chris Jones\" <c@a.test>,joe@where.test,John <jdoe@one.test>;",
12
+ "A Group:\"Chris Jones\" <c@a.test>,joe@where.test,John <jdoe@one.test>;",
13
+ "l3tt3rsAndNumb3rs@domain.com", "has-dash@domain.com",
14
+ "hasApostrophe.o'leary@domain.org", "uncommonTLD@domain.museum",
15
+ "lettersInDomain@911.com", "underscore_inLocal@domain.net",
16
+ "subdomain@sub.domain.com", "local@dash-inDomain.com",
17
+ "dot.inLocal@foo.com", "a@singleLetterLocal.org",
18
+ "singleLetterDomain@x.org", "&*=?^+{}'~@validCharsInLocal.net",
19
+ "foor@bar.newTLD", "domainStartsWithDash@-domain.com",
20
+ "local@SecondLevelDomainNamesValidEvenIfTheyAreLongerThan64Charactersss.org",
21
+ "ipsaredomains@127.0.0.1.26", "domainEndsWithDash@domain-.com",
22
+ "numbersInTLD@domain.c0m", "IPInsteadOfDomain@127.0.0.1",
23
+ ]
24
+
25
+ VALID_ADDRSPEC = ["l3tt3rsAndNumb3rs@domain.com", "has-dash@domain.com"]
26
+
27
+ INVALID = ["NotAnEmail", "@NotAnEmail", "nodomain@", "missingDomain@.com",
28
+ "@missingLocal.org", "missingatSign.net", "missingDot@com",
29
+ "two@@signs.com", "colonButNoPort@127.0.0.1:",
30
+ ".localStartsWithDot@domain.com",
31
+ "localEndsWithDot.@domain.com", "two..consecutiveDots@domain.com",
32
+ "missingTLD@domain.",
33
+ "! \"#\$%(),/;<>[]`|@CharsInLocal.org",
34
+ "IPAndPort@127.0.0.1:25",
35
+ "shortipv6@[::1]", "fullipv6@[2001:0DB7:1982:A098:2001:0DB7:1982:A098]",
36
+ "CharsInDomain@! \"#\$%(),/;<>_[]`|.org",
37
+ "toomanyoctets@[2001:0DB7:1982:A098:2001:0DB7:1982:A098:8991]",
38
+ "garbageipv6@[nthueonthueonhurc]",
39
+ ]
40
+
41
+ VALID.each do |addr|
42
+ it "should recognize <#{addr}> as valid" do
43
+ RFC822.validate(addr).should be_true
44
+ end
45
+ end
46
+
47
+ INVALID.each do |addr|
48
+ it "should recognize <#{addr}> as invalid" do
49
+ RFC822.validate(addr).should be_false
50
+ end
51
+ end
52
+
53
+ VALID_ADDRSPEC.each do |addr|
54
+ it "should recognize <#{addr}> as valid" do
55
+ RFC822.validate_addr(addr).should be_true
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,2 @@
1
+ require File.expand_path(
2
+ File.join(File.dirname(__FILE__), %w[.. lib rfc-822]))
File without changes
data/version.txt ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rfc-822-validator
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Evan Phoenix, Andrew Cholakian
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-03-22 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: bones
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 3.6.5
25
+ type: :development
26
+ version_requirements: *id001
27
+ description: Implementation of RFC-822
28
+ email: andrew@andrewvc.com
29
+ executables:
30
+ - rfc-822
31
+ extensions: []
32
+
33
+ extra_rdoc_files:
34
+ - History.txt
35
+ - bin/rfc-822
36
+ files:
37
+ - .README.md.swp
38
+ - .bnsignore
39
+ - History.txt
40
+ - README.md
41
+ - Rakefile
42
+ - bin/rfc-822
43
+ - email.kpeg
44
+ - lib/rfc-822.rb
45
+ - lib/rfc-822/parser.rb
46
+ - rfc-822-validator.gemspec
47
+ - spec/.rfc-822_spec.rb.swp
48
+ - spec/rfc-822_spec.rb
49
+ - spec/spec_helper.rb
50
+ - test/test_rfc-822.rb
51
+ - version.txt
52
+ has_rdoc: true
53
+ homepage: https://github.com/andrewvc/rfc-822
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options:
58
+ - --main
59
+ - README.md
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ requirements: []
75
+
76
+ rubyforge_project: rfc-822-validator
77
+ rubygems_version: 1.6.0
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: Implementation of RFC-822
81
+ test_files:
82
+ - test/test_rfc-822.rb