udup 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/udup/main.rb +3 -1
- 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: bcfb036e5503e400a084d0be36c188563ab03aff902ff57772d24c69ee7a614e
|
4
|
+
data.tar.gz: b7129006a5108e82dd338ef02f32614c6e8789a13f9203145e9e3f1aa94e3d0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e500c3fd7e72e910937a8268342d0ddcac1e30511dfd7ccdc9c8f29696ca8a2338fad4e5857c2aed9bd7d86591d93faad7b3354c17d1a6023aef6d3b41b14de6
|
7
|
+
data.tar.gz: 04e3ea7fdab96d27d622ead800756986672686fe6af31b8e882cc7ab3c365d9fb7edc58997bedc037faa9bc154654e3cdb63d86d9a4f99078eae8208217f3421
|
data/lib/udup/main.rb
CHANGED
@@ -9,6 +9,7 @@ class Udup
|
|
9
9
|
@skip_exts = options[:skip_exts] || %w[.css .png .jpg .jpeg .svg .ico .webp .ttf .otf .woff .woff2 .gif .pdf .bmp
|
10
10
|
.eot .mp3 .mp4 .avi]
|
11
11
|
@content_to_skip = options[:content_to_skip] || %w[blog docs post support]
|
12
|
+
@bad_char_path = options[:bad_char_path] || %w[+ ' " ( ) \\ <]
|
12
13
|
end
|
13
14
|
|
14
15
|
def filter(urls)
|
@@ -23,6 +24,7 @@ class Udup
|
|
23
24
|
next
|
24
25
|
end
|
25
26
|
next unless uri
|
27
|
+
next if @bad_char_path.any? { |char| uri.path.include?(char) }
|
26
28
|
|
27
29
|
uri_ext = File.extname(uri.path)
|
28
30
|
next if @skip_exts.include?(uri_ext) || human_content?(uri.path) || content_to_skip?(uri.path)
|
@@ -31,7 +33,7 @@ class Udup
|
|
31
33
|
params = uri_params(uri.query)
|
32
34
|
|
33
35
|
if @valid_urls.key?(base_url)
|
34
|
-
@valid_urls[
|
36
|
+
@valid_urls[uri.to_s] = { params: {} } if @valid_urls[base_url][:params].empty?
|
35
37
|
@valid_urls[base_url][:params].merge!(params)
|
36
38
|
else
|
37
39
|
@valid_urls[base_url] = { params: params }
|