site-inspector 3.1.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +18 -10
  4. data/.rubocop_todo.yml +139 -0
  5. data/.ruby-version +1 -1
  6. data/Gemfile +4 -0
  7. data/Guardfile +2 -0
  8. data/Rakefile +2 -0
  9. data/bin/site-inspector +7 -6
  10. data/lib/cliver/dependency_ext.rb +6 -3
  11. data/lib/site-inspector.rb +18 -11
  12. data/lib/site-inspector/cache.rb +2 -0
  13. data/lib/site-inspector/checks/accessibility.rb +30 -22
  14. data/lib/site-inspector/checks/check.rb +4 -2
  15. data/lib/site-inspector/checks/content.rb +15 -4
  16. data/lib/site-inspector/checks/cookies.rb +5 -3
  17. data/lib/site-inspector/checks/dns.rb +13 -11
  18. data/lib/site-inspector/checks/headers.rb +8 -6
  19. data/lib/site-inspector/checks/hsts.rb +16 -12
  20. data/lib/site-inspector/checks/https.rb +3 -1
  21. data/lib/site-inspector/checks/sniffer.rb +10 -7
  22. data/lib/site-inspector/checks/wappalyzer.rb +62 -0
  23. data/lib/site-inspector/checks/whois.rb +36 -0
  24. data/lib/site-inspector/disk_cache.rb +2 -0
  25. data/lib/site-inspector/domain.rb +36 -30
  26. data/lib/site-inspector/endpoint.rb +22 -23
  27. data/lib/site-inspector/rails_cache.rb +2 -0
  28. data/lib/site-inspector/version.rb +3 -1
  29. data/package-lock.json +505 -0
  30. data/package.json +1 -1
  31. data/script/pa11y-version +1 -0
  32. data/site-inspector.gemspec +24 -17
  33. data/spec/checks/site_inspector_endpoint_accessibility_spec.rb +15 -13
  34. data/spec/checks/site_inspector_endpoint_check_spec.rb +9 -7
  35. data/spec/checks/site_inspector_endpoint_content_spec.rb +30 -21
  36. data/spec/checks/site_inspector_endpoint_cookies_spec.rb +17 -15
  37. data/spec/checks/site_inspector_endpoint_dns_spec.rb +42 -40
  38. data/spec/checks/site_inspector_endpoint_headers_spec.rb +12 -10
  39. data/spec/checks/site_inspector_endpoint_hsts_spec.rb +27 -25
  40. data/spec/checks/site_inspector_endpoint_https_spec.rb +12 -10
  41. data/spec/checks/site_inspector_endpoint_sniffer_spec.rb +33 -31
  42. data/spec/checks/site_inspector_endpoint_wappalyzer_spec.rb +34 -0
  43. data/spec/checks/site_inspector_endpoint_whois_spec.rb +26 -0
  44. data/spec/fixtures/wappalyzer.json +125 -0
  45. data/spec/site_inspector_cache_spec.rb +2 -0
  46. data/spec/site_inspector_disk_cache_spec.rb +8 -6
  47. data/spec/site_inspector_domain_spec.rb +34 -34
  48. data/spec/site_inspector_endpoint_spec.rb +44 -43
  49. data/spec/site_inspector_spec.rb +15 -13
  50. data/spec/spec_helper.rb +2 -0
  51. metadata +125 -55
@@ -1,46 +1,48 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe SiteInspector do
4
6
  before do
5
- SiteInspector.instance_variable_set('@cache', nil)
6
- SiteInspector.instance_variable_set('@timeout', nil)
7
+ described_class.instance_variable_set('@cache', nil)
8
+ described_class.instance_variable_set('@timeout', nil)
7
9
  end
8
10
 
9
11
  it 'defaults to ephemeral cache' do
10
12
  with_env 'CACHE', nil do
11
- expect(SiteInspector.cache.class).to be(SiteInspector::Cache)
13
+ expect(described_class.cache.class).to be(SiteInspector::Cache)
12
14
  end
13
15
  end
14
16
 
15
17
  it 'uses disk cache when requested' do
16
18
  with_env 'CACHE', '/tmp' do
17
- expect(SiteInspector.cache.class).to be(SiteInspector::DiskCache)
19
+ expect(described_class.cache.class).to be(SiteInspector::DiskCache)
18
20
  end
19
21
  end
20
22
 
21
23
  it 'returns the default timeout' do
22
- expect(SiteInspector.timeout).to eql(10)
24
+ expect(described_class.timeout).to be(10)
23
25
  end
24
26
 
25
27
  it 'honors custom timeouts' do
26
- SiteInspector.timeout = 20
27
- expect(SiteInspector.timeout).to eql(20)
28
+ described_class.timeout = 20
29
+ expect(described_class.timeout).to be(20)
28
30
  end
29
31
 
30
32
  it 'returns a domain when inspecting' do
31
- expect(SiteInspector.inspect('example.com').class).to be(SiteInspector::Domain)
33
+ expect(described_class.inspect('example.com').class).to be(SiteInspector::Domain)
32
34
  end
33
35
 
34
36
  it 'returns the typhoeus defaults' do
35
37
  expected = {
36
38
  accept_encoding: 'gzip',
37
- followlocation: false,
38
- method: :head,
39
- timeout: 10,
40
- headers: {
39
+ followlocation: false,
40
+ method: :head,
41
+ timeout: 10,
42
+ headers: {
41
43
  'User-Agent' => "Mozilla/5.0 (compatible; SiteInspector/#{SiteInspector::VERSION}; +https://github.com/benbalter/site-inspector)"
42
44
  }
43
45
  }
44
- expect(SiteInspector.typhoeus_defaults).to eql(expected)
46
+ expect(described_class.typhoeus_defaults).to eql(expected)
45
47
  end
46
48
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/setup'
2
4
  require 'webmock/rspec'
3
5
  require 'fileutils'
metadata CHANGED
@@ -1,253 +1,315 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site-inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2020-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: cliver
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '0.0'
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: '1.6'
26
+ version: '0.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: public_suffix
28
+ name: colorator
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.4'
33
+ version: '1.1'
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: '1.4'
40
+ version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: gman
42
+ name: dnsruby
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.1'
47
+ version: '1.0'
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: '4.1'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: dnsruby
56
+ name: dotenv
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.56'
61
+ version: '2.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: '1.56'
68
+ version: '2.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: sniffles
70
+ name: gman
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.2'
75
+ version: '7.0'
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 7.0.4
76
79
  type: :runtime
77
80
  prerelease: false
78
81
  version_requirements: !ruby/object:Gem::Requirement
79
82
  requirements:
80
83
  - - "~>"
81
84
  - !ruby/object:Gem::Version
82
- version: '0.2'
85
+ version: '7.0'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 7.0.4
83
89
  - !ruby/object:Gem::Dependency
84
- name: typhoeus
90
+ name: mercenary
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '0.7'
95
+ version: '0.0'
90
96
  type: :runtime
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
100
  - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '0.7'
102
+ version: '0.0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: nokogiri
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '1.0'
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '1.0'
97
117
  - !ruby/object:Gem::Dependency
98
118
  name: oj
99
119
  requirement: !ruby/object:Gem::Requirement
100
120
  requirements:
101
121
  - - "~>"
102
122
  - !ruby/object:Gem::Version
103
- version: '2.11'
123
+ version: '3.0'
104
124
  type: :runtime
105
125
  prerelease: false
106
126
  version_requirements: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - "~>"
109
129
  - !ruby/object:Gem::Version
110
- version: '2.11'
130
+ version: '3.0'
111
131
  - !ruby/object:Gem::Dependency
112
- name: mercenary
132
+ name: parallel
113
133
  requirement: !ruby/object:Gem::Requirement
114
134
  requirements:
115
135
  - - "~>"
116
136
  - !ruby/object:Gem::Version
117
- version: '0.3'
137
+ version: '1.0'
118
138
  type: :runtime
119
139
  prerelease: false
120
140
  version_requirements: !ruby/object:Gem::Requirement
121
141
  requirements:
122
142
  - - "~>"
123
143
  - !ruby/object:Gem::Version
124
- version: '0.3'
144
+ version: '1.0'
125
145
  - !ruby/object:Gem::Dependency
126
- name: colorator
146
+ name: public_suffix
127
147
  requirement: !ruby/object:Gem::Requirement
128
148
  requirements:
129
149
  - - "~>"
130
150
  - !ruby/object:Gem::Version
131
- version: '0.1'
151
+ version: '4.0'
132
152
  type: :runtime
133
153
  prerelease: false
134
154
  version_requirements: !ruby/object:Gem::Requirement
135
155
  requirements:
136
156
  - - "~>"
137
157
  - !ruby/object:Gem::Version
138
- version: '0.1'
158
+ version: '4.0'
139
159
  - !ruby/object:Gem::Dependency
140
- name: cliver
160
+ name: sniffles
141
161
  requirement: !ruby/object:Gem::Requirement
142
162
  requirements:
143
163
  - - "~>"
144
164
  - !ruby/object:Gem::Version
145
- version: '0.3'
165
+ version: '0.0'
146
166
  type: :runtime
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
149
169
  requirements:
150
170
  - - "~>"
151
171
  - !ruby/object:Gem::Version
152
- version: '0.3'
172
+ version: '0.0'
153
173
  - !ruby/object:Gem::Dependency
154
- name: parallel
174
+ name: typhoeus
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '1.0'
180
+ type: :runtime
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '1.0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: urlscan
155
189
  requirement: !ruby/object:Gem::Requirement
156
190
  requirements:
157
191
  - - "~>"
158
192
  - !ruby/object:Gem::Version
159
- version: '1.6'
193
+ version: '0.6'
160
194
  type: :runtime
161
195
  prerelease: false
162
196
  version_requirements: !ruby/object:Gem::Requirement
163
197
  requirements:
164
198
  - - "~>"
165
199
  - !ruby/object:Gem::Version
166
- version: '1.6'
200
+ version: '0.6'
201
+ - !ruby/object:Gem::Dependency
202
+ name: whois
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - "~>"
206
+ - !ruby/object:Gem::Version
207
+ version: '5.0'
208
+ type: :runtime
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: '5.0'
167
215
  - !ruby/object:Gem::Dependency
168
216
  name: pry
169
217
  requirement: !ruby/object:Gem::Requirement
170
218
  requirements:
171
219
  - - "~>"
172
220
  - !ruby/object:Gem::Version
173
- version: '0.10'
221
+ version: '0.0'
174
222
  type: :development
175
223
  prerelease: false
176
224
  version_requirements: !ruby/object:Gem::Requirement
177
225
  requirements:
178
226
  - - "~>"
179
227
  - !ruby/object:Gem::Version
180
- version: '0.10'
228
+ version: '0.0'
181
229
  - !ruby/object:Gem::Dependency
182
230
  name: rake
183
231
  requirement: !ruby/object:Gem::Requirement
184
232
  requirements:
185
233
  - - "~>"
186
234
  - !ruby/object:Gem::Version
187
- version: '10.4'
235
+ version: '13.0'
188
236
  type: :development
189
237
  prerelease: false
190
238
  version_requirements: !ruby/object:Gem::Requirement
191
239
  requirements:
192
240
  - - "~>"
193
241
  - !ruby/object:Gem::Version
194
- version: '10.4'
242
+ version: '13.0'
195
243
  - !ruby/object:Gem::Dependency
196
244
  name: rspec
197
245
  requirement: !ruby/object:Gem::Requirement
198
246
  requirements:
199
247
  - - "~>"
200
248
  - !ruby/object:Gem::Version
201
- version: '3.2'
249
+ version: '3.0'
202
250
  type: :development
203
251
  prerelease: false
204
252
  version_requirements: !ruby/object:Gem::Requirement
205
253
  requirements:
206
254
  - - "~>"
207
255
  - !ruby/object:Gem::Version
208
- version: '3.2'
256
+ version: '3.0'
209
257
  - !ruby/object:Gem::Dependency
210
- name: bundler
258
+ name: rubocop
211
259
  requirement: !ruby/object:Gem::Requirement
212
260
  requirements:
213
261
  - - "~>"
214
262
  - !ruby/object:Gem::Version
215
- version: '1.6'
263
+ version: '1.0'
216
264
  type: :development
217
265
  prerelease: false
218
266
  version_requirements: !ruby/object:Gem::Requirement
219
267
  requirements:
220
268
  - - "~>"
221
269
  - !ruby/object:Gem::Version
222
- version: '1.6'
270
+ version: '1.0'
223
271
  - !ruby/object:Gem::Dependency
224
- name: webmock
272
+ name: rubocop-performance
225
273
  requirement: !ruby/object:Gem::Requirement
226
274
  requirements:
227
275
  - - "~>"
228
276
  - !ruby/object:Gem::Version
229
- version: '1.2'
277
+ version: '1.5'
230
278
  type: :development
231
279
  prerelease: false
232
280
  version_requirements: !ruby/object:Gem::Requirement
233
281
  requirements:
234
282
  - - "~>"
235
283
  - !ruby/object:Gem::Version
236
- version: '1.2'
284
+ version: '1.5'
237
285
  - !ruby/object:Gem::Dependency
238
- name: rubocop
286
+ name: rubocop-rspec
287
+ requirement: !ruby/object:Gem::Requirement
288
+ requirements:
289
+ - - "~>"
290
+ - !ruby/object:Gem::Version
291
+ version: '2.0'
292
+ type: :development
293
+ prerelease: false
294
+ version_requirements: !ruby/object:Gem::Requirement
295
+ requirements:
296
+ - - "~>"
297
+ - !ruby/object:Gem::Version
298
+ version: '2.0'
299
+ - !ruby/object:Gem::Dependency
300
+ name: webmock
239
301
  requirement: !ruby/object:Gem::Requirement
240
302
  requirements:
241
303
  - - "~>"
242
304
  - !ruby/object:Gem::Version
243
- version: '0.35'
305
+ version: '3.0'
244
306
  type: :development
245
307
  prerelease: false
246
308
  version_requirements: !ruby/object:Gem::Requirement
247
309
  requirements:
248
310
  - - "~>"
249
311
  - !ruby/object:Gem::Version
250
- version: '0.35'
312
+ version: '3.0'
251
313
  description: Returns information about a domain's technology and capabilities
252
314
  email: ben@balter.com
253
315
  executables:
@@ -257,6 +319,7 @@ extra_rdoc_files: []
257
319
  files:
258
320
  - ".gitignore"
259
321
  - ".rubocop.yml"
322
+ - ".rubocop_todo.yml"
260
323
  - ".ruby-version"
261
324
  - ".travis.yml"
262
325
  - Gemfile
@@ -279,11 +342,14 @@ files:
279
342
  - lib/site-inspector/checks/hsts.rb
280
343
  - lib/site-inspector/checks/https.rb
281
344
  - lib/site-inspector/checks/sniffer.rb
345
+ - lib/site-inspector/checks/wappalyzer.rb
346
+ - lib/site-inspector/checks/whois.rb
282
347
  - lib/site-inspector/disk_cache.rb
283
348
  - lib/site-inspector/domain.rb
284
349
  - lib/site-inspector/endpoint.rb
285
350
  - lib/site-inspector/rails_cache.rb
286
351
  - lib/site-inspector/version.rb
352
+ - package-lock.json
287
353
  - package.json
288
354
  - script/bootstrap
289
355
  - script/cibuild
@@ -300,6 +366,9 @@ files:
300
366
  - spec/checks/site_inspector_endpoint_hsts_spec.rb
301
367
  - spec/checks/site_inspector_endpoint_https_spec.rb
302
368
  - spec/checks/site_inspector_endpoint_sniffer_spec.rb
369
+ - spec/checks/site_inspector_endpoint_wappalyzer_spec.rb
370
+ - spec/checks/site_inspector_endpoint_whois_spec.rb
371
+ - spec/fixtures/wappalyzer.json
303
372
  - spec/site_inspector_cache_spec.rb
304
373
  - spec/site_inspector_disk_cache_spec.rb
305
374
  - spec/site_inspector_domain_spec.rb
@@ -310,7 +379,7 @@ homepage: https://github.com/benbalter/site-inspector
310
379
  licenses:
311
380
  - MIT
312
381
  metadata: {}
313
- post_install_message:
382
+ post_install_message:
314
383
  rdoc_options: []
315
384
  require_paths:
316
385
  - lib
@@ -325,9 +394,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
394
  - !ruby/object:Gem::Version
326
395
  version: '0'
327
396
  requirements: []
328
- rubyforge_project:
329
- rubygems_version: 2.5.1
330
- signing_key:
397
+ rubygems_version: 3.0.3
398
+ signing_key:
331
399
  specification_version: 4
332
400
  summary: A Ruby port and v2 of Site Inspector (https://github.com/benbalter/site-inspector)
333
401
  test_files:
@@ -340,10 +408,12 @@ test_files:
340
408
  - spec/checks/site_inspector_endpoint_hsts_spec.rb
341
409
  - spec/checks/site_inspector_endpoint_https_spec.rb
342
410
  - spec/checks/site_inspector_endpoint_sniffer_spec.rb
411
+ - spec/checks/site_inspector_endpoint_wappalyzer_spec.rb
412
+ - spec/checks/site_inspector_endpoint_whois_spec.rb
413
+ - spec/fixtures/wappalyzer.json
343
414
  - spec/site_inspector_cache_spec.rb
344
415
  - spec/site_inspector_disk_cache_spec.rb
345
416
  - spec/site_inspector_domain_spec.rb
346
417
  - spec/site_inspector_endpoint_spec.rb
347
418
  - spec/site_inspector_spec.rb
348
419
  - spec/spec_helper.rb
349
- has_rdoc: