email-authentication 0.1.0
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
- data/Gemfile +6 -0
- data/Gemfile.lock +25 -0
- data/README.md +33 -0
- data/bin/emailcheck.rb +8 -0
- data/lib/email-authentication.rb +7 -0
- data/lib/email-authentication/base.rb +52 -0
- data/test/coverage/assets/0.7.1/application.css +1110 -0
- data/test/coverage/assets/0.7.1/application.js +626 -0
- data/test/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/test/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/test/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/test/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/test/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/test/coverage/assets/0.7.1/loading.gif +0 -0
- data/test/coverage/assets/0.7.1/magnify.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/coverage/index.html +72 -0
- data/test/test_address.rb +58 -0
- data/test/test_helper.rb +17 -0
- data/test/test_normal.rb +59 -0
- metadata +109 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html xmlns='http://www.w3.org/1999/xhtml'>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage for Test</title>
|
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
6
|
+
<script src='./assets/0.7.1/application.js' type='text/javascript'></script>
|
|
7
|
+
<link href='./assets/0.7.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
|
8
|
+
<link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_green.png" />
|
|
9
|
+
<link rel="icon" type="image/png" href="./assets/0.7.1/favicon.png" />
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<div id="loading">
|
|
14
|
+
<img src="./assets/0.7.1/loading.gif" alt="loading"/>
|
|
15
|
+
</div>
|
|
16
|
+
<div id="wrapper" style="display:none;">
|
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2013-10-20T11:25:07+08:00">2013-10-20T11:25:07+08:00</abbr></div>
|
|
18
|
+
<ul class="group_tabs"></ul>
|
|
19
|
+
|
|
20
|
+
<div id="content">
|
|
21
|
+
<div class="file_list_container" id="AllFiles">
|
|
22
|
+
<h2>
|
|
23
|
+
<span class="group_name">All Files</span>
|
|
24
|
+
(<span class="covered_percent"><span class="green">100.0%</span></span>
|
|
25
|
+
covered at
|
|
26
|
+
<span class="covered_strength">
|
|
27
|
+
<span class="red">
|
|
28
|
+
0.0
|
|
29
|
+
</span>
|
|
30
|
+
</span> hits/line)
|
|
31
|
+
</h2>
|
|
32
|
+
<a name="AllFiles"></a>
|
|
33
|
+
<div>
|
|
34
|
+
<b>0</b> files in total.
|
|
35
|
+
<b>0.0</b> relevant lines.
|
|
36
|
+
<span class="green"><b>0.0</b> lines covered</span> and
|
|
37
|
+
<span class="red"><b>0.0</b> lines missed </span>
|
|
38
|
+
</div>
|
|
39
|
+
<table class="file_list">
|
|
40
|
+
<thead>
|
|
41
|
+
<tr>
|
|
42
|
+
<th>File</th>
|
|
43
|
+
<th>% covered</th>
|
|
44
|
+
<th>Lines</th>
|
|
45
|
+
<th>Relevant Lines</th>
|
|
46
|
+
<th>Lines covered</th>
|
|
47
|
+
<th>Lines missed</th>
|
|
48
|
+
<th>Avg. Hits / Line</th>
|
|
49
|
+
</tr>
|
|
50
|
+
</thead>
|
|
51
|
+
<tbody>
|
|
52
|
+
|
|
53
|
+
</tbody>
|
|
54
|
+
</table>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div id="footer">
|
|
62
|
+
Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
|
|
63
|
+
and simplecov-html v0.7.1<br/>
|
|
64
|
+
using test
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="source_files">
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
puts File.dirname(__FILE__)
|
|
2
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class EmailAuthenticationTest < Minitest::Test
|
|
6
|
+
|
|
7
|
+
def setup
|
|
8
|
+
@f=EmailAuthentication::Base.new
|
|
9
|
+
@success='scott.sproule@ficonab.com'
|
|
10
|
+
@failruntimeerror=[nil,""]
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def test_basic
|
|
15
|
+
assert @f!=nil, "should be valid #{@f.inspect}"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_checknil
|
|
19
|
+
|
|
20
|
+
assert_raises(RuntimeError) do
|
|
21
|
+
@f.check(nil)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
def test_checkfailruntime
|
|
26
|
+
@failruntimeerror.each { |add|
|
|
27
|
+
assert_raises(RuntimeError) do
|
|
28
|
+
@f.check(add)
|
|
29
|
+
end
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def test_success
|
|
35
|
+
success,msg= @f.check(@success)
|
|
36
|
+
assert success,"check did not succeed"
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
def test_resolver_onlyonce
|
|
40
|
+
res=@f.resolver
|
|
41
|
+
assert res!=nil, "should have resolver"
|
|
42
|
+
assert res==@f.resolver, "resolver should return same on second call #{res}, #{@f.resolver}"
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
#check a particular format
|
|
46
|
+
def test_success
|
|
47
|
+
@f.set_address(@success)
|
|
48
|
+
success,msg= @f.check_format
|
|
49
|
+
assert success,"check did not succeed"
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
end
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
puts "in test helper"
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require "codeclimate-test-reporter"
|
|
5
|
+
CodeClimate::TestReporter.start
|
|
6
|
+
require 'stringio'
|
|
7
|
+
require 'minitest/autorun'
|
|
8
|
+
require 'minitest/unit'
|
|
9
|
+
SimpleCov.command_name 'test'
|
|
10
|
+
#SimpleCov.profiles.define 'mygem' do
|
|
11
|
+
# add_group "Gem", '/lib/' # additional config here
|
|
12
|
+
#end
|
|
13
|
+
SimpleCov.start
|
|
14
|
+
|
|
15
|
+
require File.dirname(__FILE__) + '/../lib/email-authentication'
|
|
16
|
+
|
|
17
|
+
|
data/test/test_normal.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
puts File.dirname(__FILE__)
|
|
2
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class NormalTest < Minitest::Test
|
|
6
|
+
|
|
7
|
+
def setup
|
|
8
|
+
@f=Randprize::Base.new
|
|
9
|
+
@pm=Randprize::ManagePrizes.new
|
|
10
|
+
@headstails={ "T"=> {'odds'=> 2,'name'=>'win tails','value'=>0},"H"=> {'odds'=> 2,'name'=>'win heads','value'=>1}}
|
|
11
|
+
@dice={}
|
|
12
|
+
1.upto(6) {|i| @dice[i.to_s]= {'odds'=> 6,'name'=>"rolled #{i}",'value'=>1} }
|
|
13
|
+
@large={ "GP"=> {'odds'=> 100,'name'=>'grandprize','value'=>50000},"H"=> {'odds'=> 'REMAINING','name'=>'win heads','value'=>1}}
|
|
14
|
+
@exlarge={ "GP"=> {'odds'=> 50000,'name'=>'grandprize','value'=>50000},"2nd"=> {'odds'=> 5000,'name'=>'2ndprize','value'=>50000},"H"=> {'odds'=> 'REMAINING','name'=>'win heads','value'=>0}}
|
|
15
|
+
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_randomprize_forrandom
|
|
20
|
+
steps=5000
|
|
21
|
+
count=0
|
|
22
|
+
1.upto(steps) do
|
|
23
|
+
@pm.prize_list(@headstails)
|
|
24
|
+
prizes=[]
|
|
25
|
+
@pm.myprizelist.each {|k| #puts "K is #{k}"
|
|
26
|
+
prizes << k[1]}
|
|
27
|
+
aprize=@pm.random_prize
|
|
28
|
+
assert prizes.include?(aprize), "prize should be from the list"
|
|
29
|
+
#puts "count #{count} aprize #{aprize}"
|
|
30
|
+
count=aprize['value']+count
|
|
31
|
+
end
|
|
32
|
+
ratio=(count.to_f/steps)*100
|
|
33
|
+
assert (49..51).include?(ratio.round), "ratio wrong #{ratio.round} count #{count}"
|
|
34
|
+
end
|
|
35
|
+
def test_dize
|
|
36
|
+
steps=5000
|
|
37
|
+
count=0
|
|
38
|
+
hcount={}
|
|
39
|
+
1.upto(6) {|i| hcount["rolled #{i}"]=0}
|
|
40
|
+
|
|
41
|
+
1.upto(steps) do
|
|
42
|
+
@pm.prize_list(@dice)
|
|
43
|
+
prizes=[]
|
|
44
|
+
@pm.myprizelist.each {|k| #puts "K is #{k}"
|
|
45
|
+
prizes << k[1]}
|
|
46
|
+
aprize=@pm.random_prize
|
|
47
|
+
assert prizes.include?(aprize), "prize should be from the list"
|
|
48
|
+
#puts "count #{count} aprize #{aprize}"
|
|
49
|
+
hcount[aprize['name']]=hcount[aprize['name']]+1
|
|
50
|
+
end
|
|
51
|
+
# ratio=(count.to_f/steps)*100
|
|
52
|
+
# assert (49..51).include?(ratio.round), "ratio wrong #{ratio.round} count #{count}"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: email-authentication
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Scott Sproule
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-10-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: dnsruby
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - '>='
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: Try and authenticate email address, check format, lookup mx record and
|
|
28
|
+
check smtp connectivity
|
|
29
|
+
email: scott.sproule@ficonab.com
|
|
30
|
+
executables:
|
|
31
|
+
- emailcheck.rb
|
|
32
|
+
extensions: []
|
|
33
|
+
extra_rdoc_files: []
|
|
34
|
+
files:
|
|
35
|
+
- lib/email-authentication/base.rb
|
|
36
|
+
- lib/email-authentication.rb
|
|
37
|
+
- test/coverage/assets/0.7.1/application.css
|
|
38
|
+
- test/coverage/assets/0.7.1/application.js
|
|
39
|
+
- test/coverage/assets/0.7.1/fancybox/blank.gif
|
|
40
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_close.png
|
|
41
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_loading.png
|
|
42
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_nav_left.png
|
|
43
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_nav_right.png
|
|
44
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png
|
|
45
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png
|
|
46
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png
|
|
47
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png
|
|
48
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png
|
|
49
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png
|
|
50
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png
|
|
51
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png
|
|
52
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_title_left.png
|
|
53
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_title_main.png
|
|
54
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_title_over.png
|
|
55
|
+
- test/coverage/assets/0.7.1/fancybox/fancy_title_right.png
|
|
56
|
+
- test/coverage/assets/0.7.1/fancybox/fancybox-x.png
|
|
57
|
+
- test/coverage/assets/0.7.1/fancybox/fancybox-y.png
|
|
58
|
+
- test/coverage/assets/0.7.1/fancybox/fancybox.png
|
|
59
|
+
- test/coverage/assets/0.7.1/favicon_green.png
|
|
60
|
+
- test/coverage/assets/0.7.1/favicon_red.png
|
|
61
|
+
- test/coverage/assets/0.7.1/favicon_yellow.png
|
|
62
|
+
- test/coverage/assets/0.7.1/loading.gif
|
|
63
|
+
- test/coverage/assets/0.7.1/magnify.png
|
|
64
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
|
65
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
|
66
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
|
67
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
|
68
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
|
69
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
|
70
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
|
71
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
|
72
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png
|
|
73
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png
|
|
74
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png
|
|
75
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png
|
|
76
|
+
- test/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png
|
|
77
|
+
- test/coverage/index.html
|
|
78
|
+
- test/test_address.rb
|
|
79
|
+
- test/test_helper.rb
|
|
80
|
+
- test/test_normal.rb
|
|
81
|
+
- bin/emailcheck.rb
|
|
82
|
+
- Gemfile
|
|
83
|
+
- Gemfile.lock
|
|
84
|
+
- README.md
|
|
85
|
+
homepage: http://github.com/semdinsp/email-authentication
|
|
86
|
+
licenses:
|
|
87
|
+
- MIT
|
|
88
|
+
metadata: {}
|
|
89
|
+
post_install_message:
|
|
90
|
+
rdoc_options: []
|
|
91
|
+
require_paths:
|
|
92
|
+
- lib
|
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - '>='
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '0'
|
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - '>='
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: 1.3.4
|
|
103
|
+
requirements: []
|
|
104
|
+
rubyforge_project: email-authentication
|
|
105
|
+
rubygems_version: 2.1.7
|
|
106
|
+
signing_key:
|
|
107
|
+
specification_version: 4
|
|
108
|
+
summary: Simple gem to try and authenticate email address
|
|
109
|
+
test_files: []
|