ofac 1.3.2 → 2.0.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/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/History.txt +7 -0
- data/README.rdoc +4 -4
- data/VERSION.yml +3 -3
- data/lib/ofac/models/ofac.rb +7 -25
- data/lib/ofac/models/ofac_sdn.rb +20 -0
- data/ofac.gemspec +6 -12
- data/rdoc/CreateOfacSdns.html +19 -10
- data/rdoc/Ofac.html +47 -44
- data/rdoc/OfacMatch.html +27 -18
- data/rdoc/OfacMigration.html +11 -8
- data/rdoc/OfacMigration/Generators.html +11 -8
- data/rdoc/OfacMigration/Generators/BuildGenerator.html +19 -10
- data/rdoc/OfacSdn.html +76 -8
- data/rdoc/OfacSdnLoader.html +23 -17
- data/rdoc/README_rdoc.html +62 -40
- data/rdoc/String.html +20 -11
- data/rdoc/created.rid +6 -6
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/index.html +11 -9
- data/rdoc/js/darkfish.js +9 -7
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/rdoc.css +52 -0
- data/rdoc/table_of_contents.html +19 -17
- data/test/ofac_test.rb +35 -26
- metadata +22 -16
data/rdoc/created.rid
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
Tue,
|
2
|
-
README.rdoc
|
1
|
+
Tue, 07 Jan 2014 09:58:09 -0500
|
2
|
+
README.rdoc Tue, 07 Jan 2014 09:55:46 -0500
|
3
3
|
lib/generators/ofac_migration/build/build_generator.rb Fri, 16 Mar 2012 15:37:08 -0400
|
4
4
|
lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb Fri, 16 Mar 2012 15:37:08 -0400
|
5
|
-
lib/ofac
|
6
|
-
lib/ofac/models/
|
7
|
-
lib/ofac/models/
|
5
|
+
lib/ofac.rb Thu, 02 Sep 2010 14:42:06 -0400
|
6
|
+
lib/ofac/models/ofac.rb Tue, 07 Jan 2014 09:45:35 -0500
|
7
|
+
lib/ofac/models/ofac_sdn.rb Tue, 07 Jan 2014 09:48:22 -0500
|
8
|
+
lib/ofac/models/ofac_sdn_loader.rb Wed, 05 Jun 2013 09:04:58 -0400
|
8
9
|
lib/ofac/ofac_match.rb Wed, 29 Jul 2009 13:27:13 -0400
|
9
10
|
lib/ofac/ruby_string_extensions.rb Mon, 11 May 2009 12:39:33 -0400
|
10
|
-
lib/ofac.rb Thu, 02 Sep 2010 14:42:06 -0400
|
Binary file
|
data/rdoc/index.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
6
|
|
7
|
-
<title>ofac
|
7
|
+
<title>ofac 2.0.0</title>
|
8
8
|
|
9
9
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
10
|
|
@@ -59,18 +59,18 @@
|
|
59
59
|
|
60
60
|
<ul class="link-list">
|
61
61
|
|
62
|
-
<li><a href="./OfacMigration.html">OfacMigration</a>
|
63
|
-
|
64
|
-
<li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
|
65
|
-
|
66
|
-
<li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
|
67
|
-
|
68
62
|
<li><a href="./CreateOfacSdns.html">CreateOfacSdns</a>
|
69
63
|
|
70
64
|
<li><a href="./Ofac.html">Ofac</a>
|
71
65
|
|
72
66
|
<li><a href="./OfacMatch.html">OfacMatch</a>
|
73
67
|
|
68
|
+
<li><a href="./OfacMigration.html">OfacMigration</a>
|
69
|
+
|
70
|
+
<li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
|
71
|
+
|
72
|
+
<li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
|
73
|
+
|
74
74
|
<li><a href="./OfacSdn.html">OfacSdn</a>
|
75
75
|
|
76
76
|
<li><a href="./OfacSdnLoader.html">OfacSdnLoader</a>
|
@@ -83,12 +83,14 @@
|
|
83
83
|
</div>
|
84
84
|
</nav>
|
85
85
|
|
86
|
-
<
|
86
|
+
<div id="documentation" class="description">
|
87
|
+
<p>This is the API documentation for ofac 2.0.0.
|
88
|
+
</div>
|
87
89
|
|
88
90
|
|
89
91
|
<footer id="validator-badges">
|
90
92
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
91
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a>
|
93
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
92
94
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
93
95
|
</footer>
|
94
96
|
|
data/rdoc/js/darkfish.js
CHANGED
@@ -109,13 +109,15 @@ function hookSearch() {
|
|
109
109
|
function highlightTarget( anchor ) {
|
110
110
|
console.debug( "Highlighting target '%s'.", anchor );
|
111
111
|
|
112
|
-
$("a[name
|
113
|
-
if (
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
112
|
+
$("a[name]").each( function() {
|
113
|
+
if ( $(this).attr("name") == anchor ) {
|
114
|
+
if ( !$(this).parent().parent().hasClass('target-section') ) {
|
115
|
+
console.debug( "Wrapping the target-section" );
|
116
|
+
$('div.method-detail').unwrap( 'div.target-section' );
|
117
|
+
$(this).parent().wrap( '<div class="target-section"></div>' );
|
118
|
+
} else {
|
119
|
+
console.debug( "Already wrapped." );
|
120
|
+
}
|
119
121
|
}
|
120
122
|
});
|
121
123
|
};
|
data/rdoc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["createofacsdns","ofac","ofacmatch","ofacmigration","generators","buildgenerator","ofacsdn","ofacsdnloader","string","copy_migrations()","db_hit?()","down()","load_current_sdn_file()","new()","new()","next_migration_number()","ofac_soundex()","ofac_sounds_like()","possible_hits()","score()","score()","up()","readme"],"longSearchIndex":["createofacsdns","ofac","ofacmatch","ofacmigration","ofacmigration::generators","ofacmigration::generators::buildgenerator","ofacsdn","ofacsdnloader","string","ofacmigration::generators::buildgenerator#copy_migrations()","ofac#db_hit?()","createofacsdns::down()","ofacsdnloader::load_current_sdn_file()","ofac::new()","ofacmatch::new()","ofacmigration::generators::buildgenerator::next_migration_number()","string#ofac_soundex()","string#ofac_sounds_like()","ofac#possible_hits()","ofac#score()","ofacmatch#score()","createofacsdns::up()",""],"info":[["CreateOfacSdns","","CreateOfacSdns.html","",""],["Ofac","","Ofac.html","",""],["OfacMatch","","OfacMatch.html","",""],["OfacMigration","","OfacMigration.html","",""],["OfacMigration::Generators","","OfacMigration/Generators.html","",""],["OfacMigration::Generators::BuildGenerator","","OfacMigration/Generators/BuildGenerator.html","",""],["OfacSdn","","OfacSdn.html","",""],["OfacSdnLoader","","OfacSdnLoader.html","",""],["String","","String.html","",""],["copy_migrations","OfacMigration::Generators::BuildGenerator","OfacMigration/Generators/BuildGenerator.html#method-i-copy_migrations","()","<p>copy the migration file over\n"],["db_hit?","Ofac","Ofac.html#method-i-db_hit-3F","()",""],["down","CreateOfacSdns","CreateOfacSdns.html#method-c-down","()",""],["load_current_sdn_file","OfacSdnLoader","OfacSdnLoader.html#method-c-load_current_sdn_file","()","<p>Loads the most recent file from\nwww.treas.gov/offices/enforcement/ofac/sdn/delimit/index.shtml\n"],["new","Ofac","Ofac.html#method-c-new","(identity)","<p>Accepts a hash with the identity
|
1
|
+
var search_data = {"index":{"searchIndex":["createofacsdns","ofac","ofacmatch","ofacmigration","generators","buildgenerator","ofacsdn","ofacsdnloader","string","copy_migrations()","db_hit?()","down()","load_current_sdn_file()","new()","new()","next_migration_number()","ofac_soundex()","ofac_sounds_like()","possible_hits()","possible_sdns()","score()","score()","up()","readme"],"longSearchIndex":["createofacsdns","ofac","ofacmatch","ofacmigration","ofacmigration::generators","ofacmigration::generators::buildgenerator","ofacsdn","ofacsdnloader","string","ofacmigration::generators::buildgenerator#copy_migrations()","ofac#db_hit?()","createofacsdns::down()","ofacsdnloader::load_current_sdn_file()","ofac::new()","ofacmatch::new()","ofacmigration::generators::buildgenerator::next_migration_number()","string#ofac_soundex()","string#ofac_sounds_like()","ofac#possible_hits()","ofacsdn::possible_sdns()","ofac#score()","ofacmatch#score()","createofacsdns::up()",""],"info":[["CreateOfacSdns","","CreateOfacSdns.html","",""],["Ofac","","Ofac.html","",""],["OfacMatch","","OfacMatch.html","",""],["OfacMigration","","OfacMigration.html","",""],["OfacMigration::Generators","","OfacMigration/Generators.html","",""],["OfacMigration::Generators::BuildGenerator","","OfacMigration/Generators/BuildGenerator.html","",""],["OfacSdn","","OfacSdn.html","",""],["OfacSdnLoader","","OfacSdnLoader.html","",""],["String","","String.html","",""],["copy_migrations","OfacMigration::Generators::BuildGenerator","OfacMigration/Generators/BuildGenerator.html#method-i-copy_migrations","()","<p>copy the migration file over\n"],["db_hit?","Ofac","Ofac.html#method-i-db_hit-3F","()",""],["down","CreateOfacSdns","CreateOfacSdns.html#method-c-down","()",""],["load_current_sdn_file","OfacSdnLoader","OfacSdnLoader.html#method-c-load_current_sdn_file","()","<p>Loads the most recent file from\nwww.treas.gov/offices/enforcement/ofac/sdn/delimit/index.shtml\n"],["new","Ofac","Ofac.html#method-c-new","(identity)","<p>Accepts a hash with the identity's demographic information\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Ofac</span>.<span class=\"ruby-identifier\">new</span>({:<span class=\"ruby-identifier\">name</span> =<span class=\"ruby-operator\">></span> <span class=\"ruby-string\">'Oscar Hernandez'</span>, :<span class=\"ruby-identifier\">city</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["new","OfacMatch","OfacMatch.html#method-c-new","(stats={})","<p>Intialize a Match object with a record hash of fields you want to match on.\nEach key in the hash, also …\n"],["next_migration_number","OfacMigration::Generators::BuildGenerator","OfacMigration/Generators/BuildGenerator.html#method-c-next_migration_number","(path)","<p>Get the next migration number\n"],["ofac_soundex","String","String.html#method-i-ofac_soundex","(census = true)","<p>desc: en.wikipedia.org/wiki/Soundex\n"],["ofac_sounds_like","String","String.html#method-i-ofac_sounds_like","(other, census = true)",""],["possible_hits","Ofac","Ofac.html#method-i-possible_hits","()","\n<pre>Returns an array of hashes of records in the OFAC data that found partial matches with that record's ...</pre>\n"],["possible_sdns","OfacSdn","OfacSdn.html#method-c-possible_sdns","(name_array, use_ors = false)",""],["score","Ofac","Ofac.html#method-i-score","()","<p>Creates a score, 1 - 100, based on how well the name and address match the\ndata on the SDN (Specially …\n"],["score","OfacMatch","OfacMatch.html#method-i-score","(match_records)","<p>match_records is an array of hashes.\n<p>The hash keys must match the record hash keys set when initialized. …\n"],["up","CreateOfacSdns","CreateOfacSdns.html#method-c-up","()",""],["README","","README_rdoc.html","","<p>ofac\n<p>kevintyll.github.com/ofac\n<p>www.drexel-labs.com\n"]]}}
|
data/rdoc/rdoc.css
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
*
|
7
7
|
*/
|
8
8
|
|
9
|
+
/* vim: ft=css et sw=2 ts=2 sts=2 */
|
9
10
|
/* Base Green is: #6C8C22 */
|
10
11
|
|
11
12
|
* { padding: 0; margin: 0; }
|
@@ -27,6 +28,27 @@ h1 {
|
|
27
28
|
}
|
28
29
|
h2,h3,h4 { margin-top: 1.5em; }
|
29
30
|
|
31
|
+
h1 span,
|
32
|
+
h2 span,
|
33
|
+
h3 span,
|
34
|
+
h4 span,
|
35
|
+
h5 span,
|
36
|
+
h6 span {
|
37
|
+
display: none;
|
38
|
+
padding-left: 1em;
|
39
|
+
font-size: 50%;
|
40
|
+
vertical-align: super;
|
41
|
+
}
|
42
|
+
|
43
|
+
h1:hover span,
|
44
|
+
h2:hover span,
|
45
|
+
h3:hover span,
|
46
|
+
h4:hover span,
|
47
|
+
h5:hover span,
|
48
|
+
h6:hover span {
|
49
|
+
display: inline;
|
50
|
+
}
|
51
|
+
|
30
52
|
:link,
|
31
53
|
:visited {
|
32
54
|
color: #6C8C22;
|
@@ -42,6 +64,16 @@ pre {
|
|
42
64
|
padding: 0.5em 0;
|
43
65
|
}
|
44
66
|
|
67
|
+
blockquote {
|
68
|
+
background: #ddd;
|
69
|
+
margin: 1em;
|
70
|
+
padding: 0.25em;
|
71
|
+
}
|
72
|
+
|
73
|
+
blockquote > :first-child {
|
74
|
+
margin-top: 0 !important;
|
75
|
+
}
|
76
|
+
|
45
77
|
/* @group Generic Classes */
|
46
78
|
|
47
79
|
.initially-hidden {
|
@@ -193,6 +225,15 @@ pre {
|
|
193
225
|
list-style-image: url(images/page_green.png);
|
194
226
|
}
|
195
227
|
|
228
|
+
#table-of-contents {
|
229
|
+
margin-top: 2em;
|
230
|
+
}
|
231
|
+
|
232
|
+
#table-of-contents ul {
|
233
|
+
padding-left: 28px;
|
234
|
+
list-style-image: url(images/tag_blue.png);
|
235
|
+
}
|
236
|
+
|
196
237
|
dl.svninfo {
|
197
238
|
color: #666;
|
198
239
|
margin: 0;
|
@@ -203,7 +244,9 @@ dl.svninfo dt {
|
|
203
244
|
|
204
245
|
ul.link-list li {
|
205
246
|
white-space: nowrap;
|
247
|
+
line-height: 20px;
|
206
248
|
}
|
249
|
+
|
207
250
|
ul.link-list .type {
|
208
251
|
font-size: 8px;
|
209
252
|
text-transform: uppercase;
|
@@ -213,6 +256,10 @@ ul.link-list .type {
|
|
213
256
|
-webkit-border-radius: 5px;
|
214
257
|
}
|
215
258
|
|
259
|
+
.calls-super {
|
260
|
+
background: url(images/arrow_up.png) no-repeat right center;
|
261
|
+
}
|
262
|
+
|
216
263
|
/* @end */
|
217
264
|
|
218
265
|
/* @group Class Metadata Section */
|
@@ -385,6 +432,11 @@ ul.link-list .type {
|
|
385
432
|
display: none;
|
386
433
|
}
|
387
434
|
|
435
|
+
#documentation .method-description .method-calls-super {
|
436
|
+
color: #333;
|
437
|
+
font-weight: bolder;
|
438
|
+
}
|
439
|
+
|
388
440
|
#documentation .method-detail {
|
389
441
|
margin: 0.5em 0;
|
390
442
|
padding: 0.5em 0;
|
data/rdoc/table_of_contents.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
6
|
|
7
|
-
<title>Table of Contents - ofac
|
7
|
+
<title>Table of Contents - ofac 2.0.0</title>
|
8
8
|
|
9
9
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
10
|
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
<body class="indexpage">
|
24
|
-
<h1>Table of Contents - ofac
|
24
|
+
<h1>Table of Contents - ofac 2.0.0</h1>
|
25
25
|
|
26
26
|
<h2>Pages</h2>
|
27
27
|
<ul>
|
@@ -36,8 +36,8 @@
|
|
36
36
|
<li><a href="README_rdoc.html#label-SYNOPSIS%3A">SYNOPSIS:</a>
|
37
37
|
<li><a href="README_rdoc.html#label-REQUIREMENTS%3A">REQUIREMENTS:</a>
|
38
38
|
<li><a href="README_rdoc.html#label-INSTALL%3A">INSTALL:</a>
|
39
|
-
<li><a href="README_rdoc.html#label-Rails+2.0">Rails 2.0</a>
|
40
|
-
<li><a href="README_rdoc.html#label-Rails+3.0">Rails 3.0</a>
|
39
|
+
<li><a href="README_rdoc.html#label-Rails+2.0+-+use+version+1.3.2+or+earlier">Rails 2.0 - use version 1.3.2 or earlier</a>
|
40
|
+
<li><a href="README_rdoc.html#label-Rails+3.0+%26+4.0">Rails 3.0 & 4.0</a>
|
41
41
|
<li><a href="README_rdoc.html#label-Add+the+gem+to+your+Gemfile%3A">Add the gem to your Gemfile:</a>
|
42
42
|
<li><a href="README_rdoc.html#label-Run+the+Bundler+install+command">Run the Bundler install command</a>
|
43
43
|
<li><a href="README_rdoc.html#label-Copyright">Copyright</a>
|
@@ -48,16 +48,7 @@
|
|
48
48
|
|
49
49
|
<h2 id="classes">Classes/Modules</h2>
|
50
50
|
<ul>
|
51
|
-
<li class="
|
52
|
-
<a href="OfacMigration.html">OfacMigration</a>
|
53
|
-
</li>
|
54
|
-
<li class="module">
|
55
|
-
<a href="OfacMigration/Generators.html">OfacMigration::Generators</a>
|
56
|
-
</li>
|
57
|
-
<li class="class">
|
58
|
-
<a href="OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
|
59
|
-
</li>
|
60
|
-
<li class="class">
|
51
|
+
<li class="class">
|
61
52
|
<a href="CreateOfacSdns.html">CreateOfacSdns</a>
|
62
53
|
</li>
|
63
54
|
<li class="class">
|
@@ -65,6 +56,15 @@
|
|
65
56
|
</li>
|
66
57
|
<li class="class">
|
67
58
|
<a href="OfacMatch.html">OfacMatch</a>
|
59
|
+
</li>
|
60
|
+
<li class="module">
|
61
|
+
<a href="OfacMigration.html">OfacMigration</a>
|
62
|
+
</li>
|
63
|
+
<li class="module">
|
64
|
+
<a href="OfacMigration/Generators.html">OfacMigration::Generators</a>
|
65
|
+
</li>
|
66
|
+
<li class="class">
|
67
|
+
<a href="OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
|
68
68
|
</li>
|
69
69
|
<li class="class">
|
70
70
|
<a href="OfacSdn.html">OfacSdn</a>
|
@@ -85,12 +85,14 @@
|
|
85
85
|
|
86
86
|
<li class="method"><a href="OfacSdnLoader.html#method-c-load_current_sdn_file">::load_current_sdn_file — OfacSdnLoader</a>
|
87
87
|
|
88
|
-
<li class="method"><a href="Ofac.html#method-c-new">::new — Ofac</a>
|
89
|
-
|
90
88
|
<li class="method"><a href="OfacMatch.html#method-c-new">::new — OfacMatch</a>
|
91
89
|
|
90
|
+
<li class="method"><a href="Ofac.html#method-c-new">::new — Ofac</a>
|
91
|
+
|
92
92
|
<li class="method"><a href="OfacMigration/Generators/BuildGenerator.html#method-c-next_migration_number">::next_migration_number — OfacMigration::Generators::BuildGenerator</a>
|
93
93
|
|
94
|
+
<li class="method"><a href="OfacSdn.html#method-c-possible_sdns">::possible_sdns — OfacSdn</a>
|
95
|
+
|
94
96
|
<li class="method"><a href="CreateOfacSdns.html#method-c-up">::up — CreateOfacSdns</a>
|
95
97
|
|
96
98
|
<li class="method"><a href="OfacMigration/Generators/BuildGenerator.html#method-i-copy_migrations">#copy_migrations — OfacMigration::Generators::BuildGenerator</a>
|
@@ -112,7 +114,7 @@
|
|
112
114
|
|
113
115
|
<footer id="validator-badges">
|
114
116
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
115
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a>
|
117
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
116
118
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
117
119
|
</footer>
|
118
120
|
|
data/test/ofac_test.rb
CHANGED
@@ -13,15 +13,15 @@ class OfacTest < Test::Unit::TestCase
|
|
13
13
|
assert_equal 0, Ofac.new({:name => ''}).score
|
14
14
|
assert_equal 0, Ofac.new({:name => ' '}).score
|
15
15
|
assert_equal 0, Ofac.new({:name => nil}).score
|
16
|
-
assert_equal 0, Ofac.new({:name => {:first_name => ''
|
17
|
-
assert_equal 0, Ofac.new({:name => {:first_name => ''
|
16
|
+
assert_equal 0, Ofac.new({:name => {:first_name => '', :last_name => ' '}}).score
|
17
|
+
assert_equal 0, Ofac.new({:name => {:first_name => '', :last_name => ' '}}).score
|
18
18
|
assert_equal 0, Ofac.new({:name => 'P T'}).score
|
19
19
|
end
|
20
20
|
|
21
21
|
should "give a score of 0 if there is no name match" do
|
22
22
|
assert_equal 0, Ofac.new({:name => 'Kevin T P'}).score
|
23
23
|
assert_equal 0, Ofac.new({:name => "O'Brian"}).score
|
24
|
-
assert_equal 0, Ofac.new({:name => {:first_name => 'Matthew'
|
24
|
+
assert_equal 0, Ofac.new({:name => {:first_name => 'Matthew', :last_name => "O'Brian"}}).score
|
25
25
|
assert_equal 0, Ofac.new({:name => 'Kevin', :address => '123 somewhere ln', :city => 'Clearwater'}).score
|
26
26
|
end
|
27
27
|
|
@@ -66,7 +66,7 @@ class OfacTest < Test::Unit::TestCase
|
|
66
66
|
should "give a partial score if there is a partial name match" do
|
67
67
|
assert_equal 40, Ofac.new({:name => 'Oscar middlename Hernandez'}).score
|
68
68
|
assert_equal 30, Ofac.new({:name => 'Oscar WrongLastName'}).score
|
69
|
-
assert_equal 70, Ofac.new({:name => 'Oscar middlename Hernandez'
|
69
|
+
assert_equal 70, Ofac.new({:name => 'Oscar middlename Hernandez', :city => 'Clearwater'}).score
|
70
70
|
end
|
71
71
|
|
72
72
|
should "give a score of 90 if there is a name and city match" do
|
@@ -104,35 +104,44 @@ class OfacTest < Test::Unit::TestCase
|
|
104
104
|
assert sdn.score > 0
|
105
105
|
end
|
106
106
|
|
107
|
-
|
108
|
-
|
109
|
-
sdn = Ofac.new({:name => {:first_name => 'Oscar', :last_name => 'Hernandez'}, :city => 'Clearwater', :address => '123 somewhere ln'})
|
110
|
-
assert sdn.db_hit?
|
107
|
+
context '#db_hit?' do
|
108
|
+
should "return true if name is an exact match or partial match in the database" do
|
111
109
|
|
112
|
-
|
113
|
-
|
110
|
+
sdn = Ofac.new({:name => {:first_name => 'Oscar', :last_name => 'Hernandez'}, :city => 'Clearwater', :address => '123 somewhere ln'})
|
111
|
+
assert sdn.db_hit?
|
114
112
|
|
115
|
-
|
116
|
-
|
117
|
-
assert sdn.db_hit?
|
113
|
+
sdn = Ofac.new({:name => {:first_name => 'Os', :last_name => 'Her'}, :city => 'Clearwater', :address => '123 somewhere ln'})
|
114
|
+
assert sdn.db_hit?
|
118
115
|
|
119
|
-
|
120
|
-
|
121
|
-
assert sdn.db_hit?
|
122
|
-
end
|
116
|
+
sdn = Ofac.new({:name => 'Oscar Hernandez', :city => 'Clearwater', :address => '123 somewhere ln'})
|
117
|
+
assert sdn.db_hit?
|
123
118
|
|
124
|
-
|
119
|
+
#single initials are ignored
|
120
|
+
sdn = Ofac.new({:name => 'Oscar M Hernandez', :city => 'Clearwater', :address => '123 somewhere ln'})
|
121
|
+
assert sdn.db_hit?
|
125
122
|
|
126
|
-
|
127
|
-
|
123
|
+
#city and address are ignored
|
124
|
+
sdn = Ofac.new({:name => 'Oscar Hernandez', :city => 'bad city', :address => 'bad address'})
|
125
|
+
assert sdn.db_hit?
|
126
|
+
end
|
128
127
|
|
129
|
-
|
130
|
-
|
128
|
+
should "should be case insensitive for the name" do
|
129
|
+
sdn = Ofac.new({:name => {:first_name => 'OSCAR', :last_name => 'hernandez'}, :city => 'Clearwater', :address => '123 somewhere ln'})
|
130
|
+
assert sdn.db_hit?
|
131
|
+
end
|
131
132
|
|
132
|
-
|
133
|
-
sdn = Ofac.new({:name => 'Oscar de la Hernandez', :city => 'bad city', :address => 'bad address'})
|
134
|
-
assert !sdn.db_hit?
|
135
|
-
end
|
133
|
+
should "return false if name is not an exact match in the database" do
|
136
134
|
|
135
|
+
sdn = Ofac.new({:name => {:first_name => 'Oscar', :last_name => 'de la Hernandez'}, :city => 'Clearwater', :address => '123 somewhere ln'})
|
136
|
+
assert !sdn.db_hit?
|
137
|
+
|
138
|
+
sdn = Ofac.new({:name => 'Oscar Maria Hernandez', :city => 'Clearwater', :address => '123 somewhere ln'})
|
139
|
+
assert !sdn.db_hit?
|
140
|
+
|
141
|
+
#city and address are ignored
|
142
|
+
sdn = Ofac.new({:name => 'Oscar de la Hernandez', :city => 'bad city', :address => 'bad address'})
|
143
|
+
assert !sdn.db_hit?
|
144
|
+
end
|
145
|
+
end
|
137
146
|
end
|
138
147
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ofac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kevin Tyll
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Attempts to find a hit on the Office of Foreign Assets Control's Specially
|
15
14
|
Designated Nationals list.
|
@@ -21,6 +20,8 @@ extra_rdoc_files:
|
|
21
20
|
- README.rdoc
|
22
21
|
files:
|
23
22
|
- .document
|
23
|
+
- .ruby-gemset
|
24
|
+
- .ruby-version
|
24
25
|
- History.txt
|
25
26
|
- LICENSE
|
26
27
|
- PostInstall.txt
|
@@ -70,6 +71,7 @@ files:
|
|
70
71
|
- rdoc/fr_file_index.html
|
71
72
|
- rdoc/fr_method_index.html
|
72
73
|
- rdoc/images/add.png
|
74
|
+
- rdoc/images/arrow_up.png
|
73
75
|
- rdoc/images/brick.png
|
74
76
|
- rdoc/images/brick_link.png
|
75
77
|
- rdoc/images/bug.png
|
@@ -121,33 +123,37 @@ files:
|
|
121
123
|
- test/test_helper.rb
|
122
124
|
homepage: http://github.com/kevintyll/ofac
|
123
125
|
licenses: []
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
the
|
129
|
-
|
130
|
-
|
126
|
+
metadata: {}
|
127
|
+
post_install_message: |-
|
128
|
+
For more information on ofac, see http://kevintyll.github.com/ofac/
|
129
|
+
|
130
|
+
* To create the necessary db migration, from the command line, run:
|
131
|
+
script/generate ofac_migration
|
132
|
+
* Require the gem in your environment.rb file in the Rails::Initializer block:
|
133
|
+
config.gem 'kevintyll-ofac', :lib => 'ofac'
|
134
|
+
* To load your table with the current OFAC data, from the command line, run:
|
135
|
+
rake ofac:update_data
|
136
|
+
|
137
|
+
* The OFAC data is not updated with any regularity, but you can sign up for email notifications when the data changes at
|
138
|
+
http://www.treas.gov/offices/enforcement/ofac/sdn/index.shtml.
|
131
139
|
rdoc_options: []
|
132
140
|
require_paths:
|
133
141
|
- lib
|
134
142
|
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
-
none: false
|
136
143
|
requirements:
|
137
|
-
- -
|
144
|
+
- - '>='
|
138
145
|
- !ruby/object:Gem::Version
|
139
146
|
version: '0'
|
140
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
148
|
requirements:
|
143
|
-
- -
|
149
|
+
- - '>='
|
144
150
|
- !ruby/object:Gem::Version
|
145
151
|
version: '0'
|
146
152
|
requirements: []
|
147
153
|
rubyforge_project:
|
148
|
-
rubygems_version:
|
154
|
+
rubygems_version: 2.0.3
|
149
155
|
signing_key:
|
150
|
-
specification_version:
|
156
|
+
specification_version: 4
|
151
157
|
summary: Attempts to find a hit on the Office of Foreign Assets Control's Specially
|
152
158
|
Designated Nationals list.
|
153
159
|
test_files: []
|