gman 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dfe66167fca5b26fa937f7342455449da446bdb0
4
+ data.tar.gz: 4f7bf9444596a08ca9e7923948049684788cd931
5
+ SHA512:
6
+ metadata.gz: a817e3d2087eaaaf839623e4f4b0ee50e56abe5e9db69a08172054ebedf0175c22b5a6c81e3340cda5c0dffbbb11d1d705b8cfb392184ea0d150e8a5ed68401f
7
+ data.tar.gz: b40ecce16a163558fd42c57fc4da69674b7797fd9f2b06b97e5648bd3405766a4249fa826f43f15db59dc88dbee9735615fae9f8bee88f0e3c61fe590fccad35
data/README.md CHANGED
@@ -38,7 +38,7 @@ Gman.valid? "foo.gov" #true
38
38
  Gman.valid? "foo.biz" #false
39
39
  ```
40
40
 
41
- ### Get a domain name from an arbitrary domainy string
41
+ ### Get a domain name from an arbitrary domain string
42
42
 
43
43
  ```ruby
44
44
  Gman.get_domain "http://foo.bar.gov" # foo.bar.gov
@@ -53,4 +53,4 @@ Contributions welcome! Please see [the contribution guidelines](CONTRIBUTING.md)
53
53
 
54
54
  ## Credits
55
55
 
56
- Heavily inspired by [swot](https://github.com/leereilly/swot). Thanks @leereily!
56
+ Heavily inspired by [swot](https://github.com/leereilly/swot). Thanks [@leereilly](https://github.com/leereilly)!
data/gman.gemspec CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = "gman"
3
3
  s.summary = "Check if a given domain or email address belong to a governemnt entity"
4
4
  s.description = "A ruby gem to check if the owner of a given email address is working for THE MAN."
5
- s.version = "2.0.0"
5
+ s.version = "2.1.0"
6
6
  s.authors = ["Ben Balter"]
7
7
  s.email = "ben.balter@github.com"
8
8
  s.homepage = "https://github.com/benbalter/gman"
@@ -24,9 +24,9 @@ Gem::Specification.new do |s|
24
24
  ".gitignore"
25
25
  ]
26
26
  s.require_paths = ["lib"]
27
- s.add_dependency( "public_suffix" )
28
- s.add_dependency( "swot" )
29
- s.add_dependency( "addressable" )
27
+ s.add_dependency( "public_suffix", '~> 1.4.1')
28
+ s.add_dependency( "swot", '~> 0.3.0' )
29
+ s.add_dependency( "addressable", '~> 2.3.6' )
30
30
 
31
31
  s.add_development_dependency( "rake" )
32
32
  s.add_development_dependency( "shoulda" )
data/lib/domains.txt CHANGED
@@ -1,4 +1,5 @@
1
1
  // non-us gov
2
+ dep.no
2
3
  gc.ca
3
4
  gob.bo
4
5
  gob.cl
@@ -132,6 +133,7 @@ gov.vn
132
133
  gov.ws
133
134
  gub.uy
134
135
  ottawa.ca
136
+ gov.yk.ca
135
137
 
136
138
  // non-us mil
137
139
  mil.ac
@@ -183,6 +185,7 @@ mil.tz
183
185
  mil.uy
184
186
  mil.vc
185
187
  mil.ve
188
+ mod.uk
186
189
 
187
190
  // non-us sub-divisions
188
191
  greatersudbury.ca
@@ -192,6 +195,7 @@ ega.or.th
192
195
  fed.us
193
196
  gov
194
197
  mil
198
+ si.edu
195
199
 
196
200
  // US State, County, Local
197
201
  bouldercounty.org
@@ -660,6 +664,7 @@ ci.marina.ca.us
660
664
  ci.mendota.ca.us
661
665
  ci.millbrae.ca.us
662
666
  ci.modesto.ca.us
667
+ ci.monterey-park.ca.us
663
668
  ci.moreno-valley.ca.us
664
669
  ci.mt-shasta.ca.us
665
670
  ci.mtnview.ca.us
@@ -967,7 +972,6 @@ mccsd.com
967
972
  mcfarlandcity.org
968
973
  menlopark.org
969
974
  modestogov.com
970
- modoccounty.us
971
975
  mojaveindiantribe.com
972
976
  monterey.org
973
977
  montesereno.org
@@ -1138,7 +1142,6 @@ coloradonocall.com
1138
1142
  coloradoriverrecovery.org
1139
1143
  crgov.com
1140
1144
  cripplecreekgov.com
1141
- deertrailcolorado.org
1142
1145
  deltacounty.com
1143
1146
  denvergov.org
1144
1147
  durangogov.org
@@ -1841,7 +1844,6 @@ guamlegislature.com
1841
1844
  guamsupremecourt.com
1842
1845
  guamtax.com
1843
1846
  investguam.com
1844
- justice.gov.gu
1845
1847
  visitguam.org
1846
1848
 
1847
1849
  // usagovHI
@@ -3194,6 +3196,7 @@ townofdresden.com
3194
3196
  townofgreene.net
3195
3197
  townofguilford.com
3196
3198
  townofhartlandme.com
3199
+ townofmadawaska.com
3197
3200
  townofnaples.org
3198
3201
  townofnorridgewock.com
3199
3202
  townofnorthberwick.org
@@ -7677,6 +7680,7 @@ zelieboro.org
7677
7680
  fajardopr.org
7678
7681
  gobierno.pr
7679
7682
  loteriaelectronicapr.com
7683
+ mayaguez.pr
7680
7684
  municipiocarolina.com
7681
7685
  municipiodearecibo.com
7682
7686
  municipiodebayamon.com
@@ -7967,7 +7971,6 @@ salemsd.com
7967
7971
  sddot.com
7968
7972
  sdhda.org
7969
7973
  sdonecall.com
7970
- siouxempirecfc.org
7971
7974
  siouxfalls.org
7972
7975
  state.sd.us
7973
7976
  sullycounty.net
@@ -8864,7 +8867,6 @@ townofcoeburn.com
8864
8867
  townofgordonsville.org
8865
8868
  townofhalifax.com
8866
8869
  townofkilmarnockva.com
8867
- townoflacrosse.org
8868
8870
  townofluray.com
8869
8871
  townofmiddleburg.org
8870
8872
  townoforangeva.org
@@ -8983,7 +8985,6 @@ newportvermont.org
8983
8985
  northernnewenglandcfc.org
8984
8986
  northherovt.com
8985
8987
  norwich.vt.us
8986
- onioncity.com
8987
8988
  pantonvt.us
8988
8989
  peacham.net
8989
8990
  pittsfieldvt.org
@@ -9806,7 +9807,6 @@ cheyennecity.org
9806
9807
  ci.gillette.wy.us
9807
9808
  city-of-torrington.org
9808
9809
  city-sheridan-wy.com
9809
- cityofdouglaswy.com
9810
9810
  cityofgreenriver.org
9811
9811
  cityoflaramie.com
9812
9812
  cityofworland.org
@@ -9968,7 +9968,6 @@ ncnhtf.org
9968
9968
  ncoah.com
9969
9969
  nconemap.net
9970
9970
  ncopenbook.gov
9971
- ncpanbranch.com
9972
9971
  ncparks.gov
9973
9972
  ncports.com
9974
9973
  ncpublications.com
@@ -10029,4 +10028,4 @@ webgate.co.laramie.wy.us
10029
10028
  wrightschool.org
10030
10029
  wrightwyoming.com
10031
10030
  wyomingbusiness.org
10032
- wyomingtourism.org
10031
+ wyomingtourism.org
data/lib/gman.rb CHANGED
@@ -46,7 +46,7 @@ module Gman
46
46
 
47
47
  class << self
48
48
 
49
- # Normalizes and checks if a given string represents a governemnt domain
49
+ # Normalizes and checks if a given string represents a government domain
50
50
  # Possible strings to test:
51
51
  # ".gov"
52
52
  # "foo.gov"
@@ -61,7 +61,7 @@ module Gman
61
61
  return false unless PublicSuffix.valid?(domain)
62
62
 
63
63
  # Ensure non-edu
64
- return false if Swot::is_academic?(domain)
64
+ return false if domain_parts(domain).sld && Swot::is_academic?(domain)
65
65
 
66
66
  # check using public suffix's standard logic
67
67
  rule = list.find domain
@@ -105,7 +105,7 @@ module Gman
105
105
 
106
106
  # Helper function to return the public suffix domain object
107
107
  #
108
- # Supports all domainy strings (URLs, emails)
108
+ # Supports all domain strings (URLs, emails)
109
109
  #
110
110
  # Returns the domain object or nil, but no errors, never an error
111
111
  def domain_parts(text)
data/script/build CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Propegates an initial list of best-guess government domains
2
+ # Propagates an initial list of best-guess government domains
3
3
 
4
4
  require "public_suffix"
5
5
  require "yaml"
data/test/test_gman.rb CHANGED
@@ -61,7 +61,7 @@ class TestGman < Test::Unit::TestCase
61
61
 
62
62
  should "return public suffix domain" do
63
63
  assert_equal PublicSuffix::Domain, Gman.domain_parts("whitehouse.gov").class
64
- assert_equal NilClass, Gman.domain_parts("foo.bar").class
64
+ assert_equal NilClass, Gman.domain_parts("foo.invalid").class
65
65
  end
66
66
 
67
67
  should "parse domain parts" do
metadata CHANGED
@@ -1,126 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gman
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
5
- prerelease:
4
+ version: 2.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ben Balter
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-31 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: public_suffix
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: 1.4.1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: 1.4.1
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: swot
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: '0'
33
+ version: 0.3.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: '0'
40
+ version: 0.3.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: addressable
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: 2.3.6
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '0'
54
+ version: 2.3.6
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: shoulda
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rdoc
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: bundler
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: A ruby gem to check if the owner of a given email address is working
@@ -130,42 +115,41 @@ executables: []
130
115
  extensions: []
131
116
  extra_rdoc_files: []
132
117
  files:
133
- - Gemfile
134
- - README.md
118
+ - ".gitignore"
135
119
  - CONTRIBUTING.md
120
+ - Gemfile
136
121
  - LICENSE
137
- - lib/gman.rb
122
+ - README.md
123
+ - Rakefile
124
+ - gman.gemspec
138
125
  - lib/domains.txt
126
+ - lib/gman.rb
139
127
  - script/build
140
128
  - script/release
141
- - gman.gemspec
142
129
  - test/helper.rb
143
130
  - test/test_gman.rb
144
- - Rakefile
145
- - .gitignore
146
131
  homepage: https://github.com/benbalter/gman
147
132
  licenses:
148
133
  - MIT
134
+ metadata: {}
149
135
  post_install_message:
150
136
  rdoc_options: []
151
137
  require_paths:
152
138
  - lib
153
139
  required_ruby_version: !ruby/object:Gem::Requirement
154
- none: false
155
140
  requirements:
156
- - - ! '>='
141
+ - - ">="
157
142
  - !ruby/object:Gem::Version
158
143
  version: '0'
159
144
  required_rubygems_version: !ruby/object:Gem::Requirement
160
- none: false
161
145
  requirements:
162
- - - ! '>='
146
+ - - ">="
163
147
  - !ruby/object:Gem::Version
164
148
  version: '0'
165
149
  requirements: []
166
150
  rubyforge_project:
167
- rubygems_version: 1.8.23
151
+ rubygems_version: 2.2.0
168
152
  signing_key:
169
- specification_version: 3
153
+ specification_version: 4
170
154
  summary: Check if a given domain or email address belong to a governemnt entity
171
155
  test_files: []