cloudfront-link-checker 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudfront_link_checker.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cec48e634c35827e0146c7e8931f9ec8a162f0e3b315ca22de1e33bd285a113
|
4
|
+
data.tar.gz: 47349529aff69d3719fa61ac50cbc943a972b3e8470dcb49c7a899b97dffff10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f8b361e9f960fa543ec59cb1bb5a30f99e76a69690e2017e5e46db630e70abb1e4262d4af685a5a0e3c56cbaaf007ac63c675f8d6e3fba1e2dfe3d44ecc180
|
7
|
+
data.tar.gz: 94cce0c83db4717e5c9e3589779ceb798993c32df0449ebeb91fe242d30890d12f6b15fce1d4a08424e1b0e0b34f388867a02ef16ff41879b393faa925b5ddfc
|
@@ -10,8 +10,8 @@ class CloudfrontLinkChecker
|
|
10
10
|
results = File.readlines(file, :encoding => "UTF-8").grep /href="(.*)"/i
|
11
11
|
results.each do |line|
|
12
12
|
links = line.match(/href=(["'])(.*?)\1/i)[2]
|
13
|
-
exclude_start_with_list = ["https:", "#", "mailto:", "tel:"]
|
14
|
-
exclude_endings = [".ico", ".png", ".css", "/#contact-us", ".pdf"]
|
13
|
+
exclude_start_with_list = ["https:", "http:", "#", "mailto:", "tel:"]
|
14
|
+
exclude_endings = [".ico", ".png", ".css", "/#contact-us", ".pdf", ".html"]
|
15
15
|
if !links.start_with?(*exclude_start_with_list) && !links.end_with?(*exclude_endings)
|
16
16
|
if !links.start_with?("/") || !links.end_with?("/")
|
17
17
|
bad_links.push(links)
|