gman 5.0.9 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -0
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/README.md +16 -22
- data/Rakefile +3 -3
- data/bin/gman +10 -11
- data/bin/gman_filter +7 -7
- data/config/domains.txt +19 -19
- data/config/vendor/dotgovs.csv +398 -355
- data/gman.gemspec +34 -27
- data/lib/gman.rb +29 -23
- data/lib/gman/country_codes.rb +14 -15
- data/lib/gman/domain_list.rb +34 -25
- data/lib/gman/identifier.rb +39 -43
- data/lib/gman/importer.rb +111 -61
- data/lib/gman/locality.rb +22 -10
- data/lib/gman/version.rb +1 -1
- data/script/add +2 -2
- data/script/alphabetize +2 -2
- data/script/cibuild +2 -0
- data/script/dedupe +2 -2
- data/script/profile +5 -2
- data/script/prune +7 -7
- data/script/reconcile-us +26 -21
- data/script/vendor-federal-de +5 -5
- data/script/vendor-municipal-de +5 -5
- data/script/vendor-nl +12 -4
- data/script/vendor-public-suffix +8 -8
- data/script/vendor-se +8 -6
- data/script/vendor-us +7 -7
- data/test/fixtures/domains.txt +2 -0
- data/test/{obama.txt → fixtures/obama.txt} +0 -0
- data/test/helper.rb +19 -5
- data/test/test_gman.rb +43 -38
- data/test/test_gman_bin.rb +37 -43
- data/test/test_gman_country_codes.rb +10 -6
- data/test/test_gman_domains.rb +15 -10
- data/test/test_gman_filter.rb +5 -7
- data/test/test_gman_identifier.rb +36 -35
- data/test/test_gman_importer.rb +250 -0
- data/test/test_gman_locality.rb +5 -5
- metadata +28 -10
- data/lib/gman/sanctions.rb +0 -29
- data/test/test_gman_sanctions.rb +0 -20
data/test/test_gman_locality.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'helper')
|
2
2
|
|
3
3
|
class TestGmanLocality < Minitest::Test
|
4
|
-
should
|
5
|
-
assert_equal
|
6
|
-
assert_equal
|
7
|
-
assert_equal
|
8
|
-
assert_equal
|
4
|
+
should 'parse the alpha2' do
|
5
|
+
assert_equal 'us', Gman.new('whitehouse.gov').alpha2
|
6
|
+
assert_equal 'us', Gman.new('army.mil').alpha2
|
7
|
+
assert_equal 'gb', Gman.new('foo.gov.uk').alpha2
|
8
|
+
assert_equal 'ca', Gman.new('gov.ca').alpha2
|
9
9
|
end
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: swot
|
@@ -192,8 +192,23 @@ dependencies:
|
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0.15'
|
195
|
-
|
196
|
-
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rubocop
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0.37'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0.37'
|
209
|
+
description: |2
|
210
|
+
A ruby gem to check if the owner of a given email address is working for
|
211
|
+
THE MAN.
|
197
212
|
email: ben.balter@github.com
|
198
213
|
executables:
|
199
214
|
- gman
|
@@ -202,6 +217,7 @@ extensions: []
|
|
202
217
|
extra_rdoc_files: []
|
203
218
|
files:
|
204
219
|
- ".gitignore"
|
220
|
+
- ".rubocop.yml"
|
205
221
|
- ".ruby-version"
|
206
222
|
- ".travis.yml"
|
207
223
|
- CONTRIBUTING.md
|
@@ -220,7 +236,6 @@ files:
|
|
220
236
|
- lib/gman/identifier.rb
|
221
237
|
- lib/gman/importer.rb
|
222
238
|
- lib/gman/locality.rb
|
223
|
-
- lib/gman/sanctions.rb
|
224
239
|
- lib/gman/version.rb
|
225
240
|
- script/add
|
226
241
|
- script/alphabetize
|
@@ -240,16 +255,17 @@ files:
|
|
240
255
|
- script/vendor-public-suffix
|
241
256
|
- script/vendor-se
|
242
257
|
- script/vendor-us
|
258
|
+
- test/fixtures/domains.txt
|
259
|
+
- test/fixtures/obama.txt
|
243
260
|
- test/helper.rb
|
244
|
-
- test/obama.txt
|
245
261
|
- test/test_gman.rb
|
246
262
|
- test/test_gman_bin.rb
|
247
263
|
- test/test_gman_country_codes.rb
|
248
264
|
- test/test_gman_domains.rb
|
249
265
|
- test/test_gman_filter.rb
|
250
266
|
- test/test_gman_identifier.rb
|
267
|
+
- test/test_gman_importer.rb
|
251
268
|
- test/test_gman_locality.rb
|
252
|
-
- test/test_gman_sanctions.rb
|
253
269
|
homepage: https://github.com/benbalter/gman
|
254
270
|
licenses:
|
255
271
|
- MIT
|
@@ -270,18 +286,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
286
|
version: '0'
|
271
287
|
requirements: []
|
272
288
|
rubyforge_project:
|
273
|
-
rubygems_version: 2.5.
|
289
|
+
rubygems_version: 2.5.2
|
274
290
|
signing_key:
|
275
291
|
specification_version: 4
|
276
292
|
summary: Check if a given domain or email address belong to a governemnt entity
|
277
293
|
test_files:
|
294
|
+
- test/fixtures/domains.txt
|
295
|
+
- test/fixtures/obama.txt
|
278
296
|
- test/helper.rb
|
279
|
-
- test/obama.txt
|
280
297
|
- test/test_gman.rb
|
281
298
|
- test/test_gman_bin.rb
|
282
299
|
- test/test_gman_country_codes.rb
|
283
300
|
- test/test_gman_domains.rb
|
284
301
|
- test/test_gman_filter.rb
|
285
302
|
- test/test_gman_identifier.rb
|
303
|
+
- test/test_gman_importer.rb
|
286
304
|
- test/test_gman_locality.rb
|
287
|
-
|
305
|
+
has_rdoc:
|
data/lib/gman/sanctions.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
class Gman
|
2
|
-
|
3
|
-
# http://www.treasury.gov/resource-center/sanctions/Programs/Pages/Programs.aspx
|
4
|
-
SANCTIONED_COUNTRIES = %w[
|
5
|
-
112
|
6
|
-
384
|
7
|
-
192
|
8
|
-
180
|
9
|
-
364
|
10
|
-
368
|
11
|
-
422
|
12
|
-
434
|
13
|
-
408
|
14
|
-
706
|
15
|
-
728
|
16
|
-
729
|
17
|
-
760
|
18
|
-
804
|
19
|
-
887
|
20
|
-
716
|
21
|
-
430
|
22
|
-
694
|
23
|
-
716
|
24
|
-
]
|
25
|
-
|
26
|
-
def sanctioned?
|
27
|
-
SANCTIONED_COUNTRIES.include?(country.numeric) if country
|
28
|
-
end
|
29
|
-
end
|
data/test/test_gman_sanctions.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require_relative "helper"
|
2
|
-
|
3
|
-
class TestGmanSanctions < Minitest::Test
|
4
|
-
|
5
|
-
should "know when a country isn't sanctioned" do
|
6
|
-
refute Gman.new("whitehouse.gov").sanctioned?
|
7
|
-
end
|
8
|
-
|
9
|
-
should "know when a country is sanctioned" do
|
10
|
-
assert Gman.new("kim@pyongyang.gov.kp").sanctioned?
|
11
|
-
end
|
12
|
-
|
13
|
-
should "not err on invalid domains" do
|
14
|
-
assert_equal nil, Gman.new("domain.invalid").sanctioned?
|
15
|
-
end
|
16
|
-
|
17
|
-
should "work with non-governemnt domains" do
|
18
|
-
assert Gman.new("foo@bar.co.kp").sanctioned?
|
19
|
-
end
|
20
|
-
end
|