gman 7.0.2 → 7.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +5 -5
  2. data/.github/CODEOWNERS +3 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
  5. data/.github/config.yml +23 -0
  6. data/.github/no-response.yml +15 -0
  7. data/.github/release-drafter.yml +4 -0
  8. data/.github/settings.yml +33 -0
  9. data/.github/stale.yml +29 -0
  10. data/.rubocop.yml +5 -5
  11. data/.ruby-version +1 -1
  12. data/Gemfile +2 -0
  13. data/bin/gman +3 -1
  14. data/bin/gman_filter +3 -5
  15. data/config/domains.txt +191 -134
  16. data/config/vendor/dotgovs.csv +5786 -5634
  17. data/docs/CODE_OF_CONDUCT.md +46 -0
  18. data/docs/CONTRIBUTING.md +92 -0
  19. data/{README.md → docs/README.md} +2 -2
  20. data/docs/_config.yml +2 -0
  21. data/gman.gemspec +16 -15
  22. data/lib/gman.rb +4 -1
  23. data/lib/gman/country_codes.rb +19 -19
  24. data/lib/gman/domain_list.rb +10 -6
  25. data/lib/gman/identifier.rb +55 -17
  26. data/lib/gman/importer.rb +27 -18
  27. data/lib/gman/locality.rb +8 -6
  28. data/lib/gman/version.rb +3 -1
  29. data/script/add +2 -0
  30. data/script/alphabetize +2 -0
  31. data/script/dedupe +1 -0
  32. data/script/profile +1 -0
  33. data/script/prune +5 -3
  34. data/script/reconcile-us +5 -2
  35. data/script/vendor-federal-de +2 -1
  36. data/script/vendor-municipal-de +2 -1
  37. data/script/vendor-nl +2 -0
  38. data/script/vendor-public-suffix +3 -1
  39. data/script/vendor-se +1 -0
  40. data/script/vendor-swot +2 -0
  41. data/script/vendor-us +4 -2
  42. data/spec/gman/bin_spec.rb +8 -6
  43. data/spec/gman/country_code_spec.rb +6 -4
  44. data/spec/gman/domain_list_spec.rb +3 -1
  45. data/spec/gman/domains_spec.rb +3 -0
  46. data/spec/gman/identifier_spec.rb +38 -3
  47. data/spec/gman/importer_spec.rb +9 -7
  48. data/spec/gman/locality_spec.rb +2 -0
  49. data/spec/gman_spec.rb +2 -0
  50. data/spec/spec_helper.rb +2 -0
  51. metadata +52 -44
  52. data/CONTRIBUTING.md +0 -22
  53. data/contributing.json +0 -32
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Gman::Importer do
2
4
  let(:domains) { { 'test' => ['example.com'] } }
3
5
  let(:stdout) { StringIO.new }
@@ -83,7 +85,7 @@ RSpec.describe Gman::Importer do
83
85
  context 'importing' do
84
86
  let(:domains) do
85
87
  {
86
- 'test' => ['www.example.com', 'foo.github.io'],
88
+ 'test' => ['www.example.com', 'foo.github.io'],
87
89
  'test2' => ['github.com', 'www.github.com', 'whitehouse.gov']
88
90
  }
89
91
  end
@@ -113,12 +115,12 @@ RSpec.describe Gman::Importer do
113
115
  end
114
116
 
115
117
  {
116
- :empty => '',
117
- :blacklisted => 'egovlink.com',
118
- :invalid => 'foo.invalid',
119
- :academic => 'harvard.edu',
120
- :"rejex'd" => 'foo.github.io'
121
- }.each do |type, _domain|
118
+ empty: '',
119
+ blacklisted: 'egovlink.com',
120
+ invalid: 'foo.invalid',
121
+ academic: 'harvard.edu',
122
+ "rejex'd": 'foo.github.io'
123
+ }.each_key do |type|
122
124
  context "a #{type} domain" do
123
125
  it 'is invalid' do
124
126
  expect(valid?).to eql(false)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Gman::Locality do
2
4
  context 'valid domains' do
3
5
  ['foo.state.il.us', 'ci.foo.il.us'].each do |domain|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Gman do
2
4
  context 'valid domains' do
3
5
  ['foo.gov', 'http://foo.mil', 'foo@bar.gc.ca', 'foo.gov.au',
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'parallel'
2
4
  require 'open3'
3
5
 
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gman
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2019-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: iso_country_codes
14
+ name: colored
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.6'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.6'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: naughty_or_nice
28
+ name: iso_country_codes
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.1'
33
+ version: '0.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.1'
40
+ version: '0.6'
41
41
  - !ruby/object:Gem::Dependency
42
- name: colored
42
+ name: naughty_or_nice
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '1.2'
47
+ version: 2.1.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '1.2'
54
+ version: 2.1.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: public_suffix
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.0'
61
+ version: '3.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.0'
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: swot
70
+ name: addressable
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: '2.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: '2.3'
83
83
  - !ruby/object:Gem::Dependency
84
- name: pry
84
+ name: mechanize
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.10'
89
+ version: '2.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.10'
96
+ version: '2.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: parallel
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -109,75 +109,75 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.6'
111
111
  - !ruby/object:Gem::Dependency
112
- name: mechanize
112
+ name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '2.7'
117
+ version: '0.10'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '2.7'
124
+ version: '0.10'
125
125
  - !ruby/object:Gem::Dependency
126
- name: addressable
126
+ name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '2.3'
131
+ version: '3.5'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '2.3'
138
+ version: '3.5'
139
139
  - !ruby/object:Gem::Dependency
140
- name: ruby-prof
140
+ name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.15'
145
+ version: '0.37'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.15'
152
+ version: '0.37'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rubocop
154
+ name: ruby-prof
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.37'
159
+ version: '0.15'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.37'
166
+ version: '0.15'
167
167
  - !ruby/object:Gem::Dependency
168
- name: rspec
168
+ name: swot
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '3.5'
173
+ version: '1.0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '3.5'
180
+ version: '1.0'
181
181
  description: |2
182
182
  A ruby gem to check if the owner of a given email address is working for
183
183
  THE MAN.
@@ -188,21 +188,30 @@ executables:
188
188
  extensions: []
189
189
  extra_rdoc_files: []
190
190
  files:
191
+ - ".github/CODEOWNERS"
192
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
193
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
194
+ - ".github/config.yml"
195
+ - ".github/no-response.yml"
196
+ - ".github/release-drafter.yml"
197
+ - ".github/settings.yml"
198
+ - ".github/stale.yml"
191
199
  - ".gitignore"
192
200
  - ".rspec"
193
201
  - ".rubocop.yml"
194
202
  - ".ruby-version"
195
203
  - ".travis.yml"
196
- - CONTRIBUTING.md
197
204
  - Gemfile
198
205
  - LICENSE
199
- - README.md
200
206
  - bin/gman
201
207
  - bin/gman_filter
202
208
  - config/domains.txt
203
209
  - config/vendor/academic.txt
204
210
  - config/vendor/dotgovs.csv
205
- - contributing.json
211
+ - docs/CODE_OF_CONDUCT.md
212
+ - docs/CONTRIBUTING.md
213
+ - docs/README.md
214
+ - docs/_config.yml
206
215
  - gman.gemspec
207
216
  - lib/gman.rb
208
217
  - lib/gman/country_codes.rb
@@ -253,15 +262,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
262
  requirements:
254
263
  - - "~>"
255
264
  - !ruby/object:Gem::Version
256
- version: '2.0'
265
+ version: '2.3'
257
266
  required_rubygems_version: !ruby/object:Gem::Requirement
258
267
  requirements:
259
268
  - - ">="
260
269
  - !ruby/object:Gem::Version
261
270
  version: '0'
262
271
  requirements: []
263
- rubyforge_project:
264
- rubygems_version: 2.5.1
272
+ rubygems_version: 3.0.2
265
273
  signing_key:
266
274
  specification_version: 4
267
275
  summary: Check if a given domain or email address belong to a governemnt entity
@@ -1,22 +0,0 @@
1
- # Contributing to Gman
2
-
3
- ## How to contribute
4
-
5
- 1. Fork the project
6
- 2. Create a descriptive branch
7
- 3. Make your change
8
- 4. Submit a pull request
9
-
10
- ## Code
11
-
12
- Open an issue, or submit a pull request
13
-
14
- ## Domains
15
-
16
- Domains live in `./config/domains.txt` as a list of TLDs and SLD+TLDs.
17
-
18
- Right now, the only valid government top level domains (TLDs), represent the US government and are `.gov`, and `.mil`.
19
-
20
- Secondary domains (e.g., `gov.uk`, or `mil.au`) detect non-US government entities.
21
-
22
- To add or remove a domain from the list of known government domains, simply edit the `domains.txt` file.
@@ -1,32 +0,0 @@
1
- {
2
- "commit": {
3
- "subject_cannot_be_empty": true,
4
- "subject_must_be_longer_than": 4,
5
- "subject_must_be_shorter_than": 101,
6
- "subject_lines_must_be_shorter_than": 51,
7
- "subject_must_be_single_line": true,
8
- "subject_must_be_in_tense": "imperative",
9
- "subject_must_start_with_case": "lower",
10
- "subject_must_not_end_with_dot": true,
11
- "body_lines_must_be_shorter_than": 73
12
- },
13
- "pull_request": {
14
- "subject_cannot_be_empty": true,
15
- "subject_must_be_longer_than": 4,
16
- "subject_must_be_shorter_than": 101,
17
- "subject_must_be_in_tense": "imperative",
18
- "subject_must_start_with_case": "upper",
19
- "subject_must_not_end_with_dot": true,
20
- "body_cannot_be_empty": true
21
- },
22
- "issue": {
23
- "subject_cannot_be_empty": true,
24
- "subject_must_be_longer_than": 4,
25
- "subject_must_be_shorter_than": 101,
26
- "subject_must_be_in_tense": "imperative",
27
- "subject_must_start_with_case": "upper",
28
- "subject_must_not_end_with_dot": true,
29
- "body_cannot_be_empty": true,
30
- "body_must_include_reproduction_steps": true
31
- }
32
- }