ofac 1.2.5 → 1.3.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.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.3.0 2012-03-16
2
+
3
+ * 1 enhancements:
4
+ * Rails 3 generator added
5
+
1
6
  == 1.2.5 2012-02-15
2
7
 
3
8
  * 1 enhancements:
data/README.rdoc CHANGED
@@ -106,6 +106,8 @@ Acceptable hash keys and their weighting in score calculation:
106
106
 
107
107
  == INSTALL:
108
108
 
109
+ ==== Rails 2.0
110
+
109
111
  * To install the gem:
110
112
  sudo gem install kevintyll-ofac
111
113
  * To create the necessary db migration, from the command line, run:
@@ -118,6 +120,21 @@ Acceptable hash keys and their weighting in score calculation:
118
120
  * The OFAC data is not updated with any regularity, but you can sign up for email notifications when the data changes at
119
121
  http://www.treas.gov/offices/enforcement/ofac/sdn/index.shtml.
120
122
 
123
+ ==== Rails 3.0
124
+
125
+ * To create the necessary db migration, from the command line, run:
126
+ rails generate ofac_migration:build
127
+ * To add the gem to your Rails project:
128
+ ===== Add the gem to your Gemfile:
129
+ gem "ofac", "~> 1.3.0"
130
+ ===== Run the Bundler install command
131
+ bundle install
132
+ * To load your table with the current OFAC data, from the command line, run:
133
+ rake ofac:update_data
134
+
135
+ * The OFAC data is not updated with any regularity, but you can sign up for email notifications when the data changes at
136
+ http://www.treas.gov/offices/enforcement/ofac/sdn/index.shtml.
137
+
121
138
  == Copyright
122
139
 
123
140
  Copyright (c) 2009 Kevin Tyll. See LICENSE for details.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
- :minor: 2
4
- :patch: 5
5
- :build:
3
+ :minor: 3
4
+ :patch: 0
5
+ :build:
@@ -0,0 +1,29 @@
1
+ require 'rails'
2
+
3
+ module OfacMigration
4
+ module Generators
5
+ class BuildGenerator < ::Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+ source_root File.expand_path('../templates', __FILE__)
8
+ desc "Adds the migration for the ofac_sdns table."
9
+
10
+ # Get the next migration number
11
+ #
12
+ def self.next_migration_number(path)
13
+ unless @prev_migration_nr
14
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
15
+ else
16
+ @prev_migration_nr += 1
17
+ end
18
+ @prev_migration_nr.to_s
19
+ end
20
+
21
+ # copy the migration file over
22
+ #
23
+ def copy_migrations
24
+ migration_template "create_ofac_sdns.rb", "db/migrate/create_ofac_sdns.rb"
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,31 @@
1
+ class CreateOfacSdns < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ create_table :ofac_sdns do |t|
5
+ t.text :name
6
+ t.string :sdn_type
7
+ t.string :program
8
+ t.string :title
9
+ t.string :vessel_call_sign
10
+ t.string :vessel_type
11
+ t.string :vessel_tonnage
12
+ t.string :gross_registered_tonnage
13
+ t.string :vessel_flag
14
+ t.string :vessel_owner
15
+ t.text :remarks
16
+ t.text :address
17
+ t.string :city
18
+ t.string :country
19
+ t.string :address_remarks
20
+ t.string :alternate_identity_type
21
+ t.text :alternate_identity_name
22
+ t.string :alternate_identity_remarks
23
+ t.timestamps
24
+ end
25
+ add_index :ofac_sdns, :sdn_type
26
+ end
27
+
28
+ def self.down
29
+ drop_table :ofac_sdns
30
+ end
31
+ end
data/ofac.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ofac}
8
- s.version = "1.2.5"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kevin Tyll}]
12
- s.date = %q{2012-02-15}
12
+ s.date = %q{2012-03-16}
13
13
  s.description = %q{Attempts to find a hit on the Office of Foreign Assets Control's Specially Designated Nationals list.}
14
14
  s.email = %q{kevintyll@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -28,6 +28,8 @@ Gem::Specification.new do |s|
28
28
  "generators/ofac_migration/ofac_migration_generator.rb",
29
29
  "generators/ofac_migration/templates/.DS_Store",
30
30
  "generators/ofac_migration/templates/migration.rb",
31
+ "lib/generators/ofac_migration/build/build_generator.rb",
32
+ "lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb",
31
33
  "lib/ofac.rb",
32
34
  "lib/ofac/models/ofac.rb",
33
35
  "lib/ofac/models/ofac_sdn.rb",
@@ -40,8 +42,12 @@ Gem::Specification.new do |s|
40
42
  "ofac.gemspec",
41
43
  "pkg/ofac-0.1.0.gem",
42
44
  "pkg/ofac-1.0.0.gem",
45
+ "rdoc/CreateOfacSdns.html",
43
46
  "rdoc/Ofac.html",
44
47
  "rdoc/OfacMatch.html",
48
+ "rdoc/OfacMigration.html",
49
+ "rdoc/OfacMigration/Generators.html",
50
+ "rdoc/OfacMigration/Generators/BuildGenerator.html",
45
51
  "rdoc/OfacSdn.html",
46
52
  "rdoc/OfacSdnLoader.html",
47
53
  "rdoc/README_rdoc.html",
@@ -93,6 +99,8 @@ Gem::Specification.new do |s|
93
99
  "rdoc/js/search.js",
94
100
  "rdoc/js/search_index.js",
95
101
  "rdoc/js/searcher.js",
102
+ "rdoc/lib/generators/ofac_migration/build/build_generator_rb.html",
103
+ "rdoc/lib/generators/ofac_migration/build/templates/create_ofac_sdns_rb.html",
96
104
  "rdoc/lib/ofac/models/ofac_rb.html",
97
105
  "rdoc/lib/ofac/models/ofac_sdn_loader_rb.html",
98
106
  "rdoc/lib/ofac/models/ofac_sdn_rb.html",
@@ -0,0 +1,240 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>Class: CreateOfacSdns</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link">ActiveRecord::Migration
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-down">::down</a>
74
+
75
+ <li><a href="#method-c-up">::up</a>
76
+
77
+ </ul>
78
+ </nav>
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+ <nav id="fileindex-section" class="section project-section">
84
+ <h3 class="section-header">Pages</h3>
85
+
86
+ <ul>
87
+
88
+ <li class="file"><a href="./README_rdoc.html">README</a>
89
+
90
+ </ul>
91
+ </nav>
92
+
93
+ <nav id="classindex-section" class="section project-section">
94
+ <h3 class="section-header">Class and Module Index</h3>
95
+
96
+ <ul class="link-list">
97
+
98
+ <li><a href="./OfacMigration.html">OfacMigration</a>
99
+
100
+ <li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
101
+
102
+ <li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
103
+
104
+ <li><a href="./CreateOfacSdns.html">CreateOfacSdns</a>
105
+
106
+ <li><a href="./Ofac.html">Ofac</a>
107
+
108
+ <li><a href="./OfacMatch.html">OfacMatch</a>
109
+
110
+ <li><a href="./OfacSdn.html">OfacSdn</a>
111
+
112
+ <li><a href="./OfacSdnLoader.html">OfacSdnLoader</a>
113
+
114
+ <li><a href="./String.html">String</a>
115
+
116
+ </ul>
117
+ </nav>
118
+
119
+ </div>
120
+ </nav>
121
+
122
+ <div id="documentation">
123
+ <h1 class="class">class CreateOfacSdns</h1>
124
+
125
+ <div id="description" class="description">
126
+
127
+ </div><!-- description -->
128
+
129
+
130
+
131
+
132
+ <section id="5Buntitled-5D" class="documentation-section">
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <!-- Methods -->
142
+
143
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
144
+ <h3 class="section-header">Public Class Methods</h3>
145
+
146
+
147
+ <div id="method-c-down" class="method-detail ">
148
+
149
+ <div class="method-heading">
150
+ <span class="method-name">down</span><span
151
+ class="method-args">()</span>
152
+ <span class="method-click-advice">click to toggle source</span>
153
+ </div>
154
+
155
+
156
+ <div class="method-description">
157
+
158
+
159
+
160
+
161
+
162
+ <div class="method-source-code" id="down-source">
163
+ <pre><span class="ruby-comment"># File lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb, line 28</span>
164
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">down</span>
165
+ <span class="ruby-identifier">drop_table</span> <span class="ruby-value">:ofac_sdns</span>
166
+ <span class="ruby-keyword">end</span></pre>
167
+ </div><!-- down-source -->
168
+
169
+ </div>
170
+
171
+
172
+
173
+
174
+ </div><!-- down-method -->
175
+
176
+
177
+ <div id="method-c-up" class="method-detail ">
178
+
179
+ <div class="method-heading">
180
+ <span class="method-name">up</span><span
181
+ class="method-args">()</span>
182
+ <span class="method-click-advice">click to toggle source</span>
183
+ </div>
184
+
185
+
186
+ <div class="method-description">
187
+
188
+
189
+
190
+
191
+
192
+ <div class="method-source-code" id="up-source">
193
+ <pre><span class="ruby-comment"># File lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb, line 3</span>
194
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">up</span>
195
+ <span class="ruby-identifier">create_table</span> <span class="ruby-value">:ofac_sdns</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
196
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">text</span> <span class="ruby-value">:name</span>
197
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:sdn_type</span>
198
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:program</span>
199
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:title</span>
200
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:vessel_call_sign</span>
201
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:vessel_type</span>
202
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:vessel_tonnage</span>
203
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:gross_registered_tonnage</span>
204
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:vessel_flag</span>
205
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:vessel_owner</span>
206
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">text</span> <span class="ruby-value">:remarks</span>
207
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">text</span> <span class="ruby-value">:address</span>
208
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:city</span>
209
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:country</span>
210
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:address_remarks</span>
211
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:alternate_identity_type</span>
212
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">text</span> <span class="ruby-value">:alternate_identity_name</span>
213
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:alternate_identity_remarks</span>
214
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
215
+ <span class="ruby-keyword">end</span>
216
+ <span class="ruby-identifier">add_index</span> <span class="ruby-value">:ofac_sdns</span>, <span class="ruby-value">:sdn_type</span>
217
+ <span class="ruby-keyword">end</span></pre>
218
+ </div><!-- up-source -->
219
+
220
+ </div>
221
+
222
+
223
+
224
+
225
+ </div><!-- up-method -->
226
+
227
+
228
+ </section><!-- public-class-method-details -->
229
+
230
+ </section><!-- 5Buntitled-5D -->
231
+
232
+ </div><!-- documentation -->
233
+
234
+
235
+ <footer id="validator-badges">
236
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
237
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
238
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
239
+ </footer>
240
+
data/rdoc/Ofac.html CHANGED
@@ -99,6 +99,14 @@
99
99
 
100
100
  <ul class="link-list">
101
101
 
102
+ <li><a href="./OfacMigration.html">OfacMigration</a>
103
+
104
+ <li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
105
+
106
+ <li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
107
+
108
+ <li><a href="./CreateOfacSdns.html">CreateOfacSdns</a>
109
+
102
110
  <li><a href="./Ofac.html">Ofac</a>
103
111
 
104
112
  <li><a href="./OfacMatch.html">OfacMatch</a>
data/rdoc/OfacMatch.html CHANGED
@@ -95,6 +95,14 @@
95
95
 
96
96
  <ul class="link-list">
97
97
 
98
+ <li><a href="./OfacMigration.html">OfacMigration</a>
99
+
100
+ <li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
101
+
102
+ <li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
103
+
104
+ <li><a href="./CreateOfacSdns.html">CreateOfacSdns</a>
105
+
98
106
  <li><a href="./Ofac.html">Ofac</a>
99
107
 
100
108
  <li><a href="./OfacMatch.html">OfacMatch</a>
@@ -0,0 +1,135 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>Module: OfacMigration</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/generators/ofac_migration/build/build_generator.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+
60
+
61
+
62
+ </div>
63
+
64
+ <div id="project-metadata">
65
+ <nav id="fileindex-section" class="section project-section">
66
+ <h3 class="section-header">Pages</h3>
67
+
68
+ <ul>
69
+
70
+ <li class="file"><a href="./README_rdoc.html">README</a>
71
+
72
+ </ul>
73
+ </nav>
74
+
75
+ <nav id="classindex-section" class="section project-section">
76
+ <h3 class="section-header">Class and Module Index</h3>
77
+
78
+ <ul class="link-list">
79
+
80
+ <li><a href="./OfacMigration.html">OfacMigration</a>
81
+
82
+ <li><a href="./OfacMigration/Generators.html">OfacMigration::Generators</a>
83
+
84
+ <li><a href="./OfacMigration/Generators/BuildGenerator.html">OfacMigration::Generators::BuildGenerator</a>
85
+
86
+ <li><a href="./CreateOfacSdns.html">CreateOfacSdns</a>
87
+
88
+ <li><a href="./Ofac.html">Ofac</a>
89
+
90
+ <li><a href="./OfacMatch.html">OfacMatch</a>
91
+
92
+ <li><a href="./OfacSdn.html">OfacSdn</a>
93
+
94
+ <li><a href="./OfacSdnLoader.html">OfacSdnLoader</a>
95
+
96
+ <li><a href="./String.html">String</a>
97
+
98
+ </ul>
99
+ </nav>
100
+
101
+ </div>
102
+ </nav>
103
+
104
+ <div id="documentation">
105
+ <h1 class="module">module OfacMigration</h1>
106
+
107
+ <div id="description" class="description">
108
+
109
+ </div><!-- description -->
110
+
111
+
112
+
113
+
114
+ <section id="5Buntitled-5D" class="documentation-section">
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <!-- Methods -->
124
+
125
+ </section><!-- 5Buntitled-5D -->
126
+
127
+ </div><!-- documentation -->
128
+
129
+
130
+ <footer id="validator-badges">
131
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
132
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
133
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
134
+ </footer>
135
+