pulse-downloader 0.1.37 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pulse/downloader/version.rb +1 -1
- data/lib/pulse/downloader/web_page_parser.rb +4 -4
- 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: 8cfa24f36ba29f56841e44a4b2399ad674db933c119b895a596ec4b2f50a85e5
|
4
|
+
data.tar.gz: dc9771c6c117054112697ad308ee0f96ed636121417dcd27ba23b2576979a573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d87b3058eaf841b32ae74d752eeea5bde05ca23ca834a4758c8e08b63476de3d5aa9c6dbd3eaef4321d7fb8366b3cfa6341009e7d931f3460cc03b5ee28946d
|
7
|
+
data.tar.gz: f4cfaa96edbf077b0c30a5fc0e0ee0c3309a3beca0b1c1cddf3b3e491cebedfba0acb9126ee423f911f118be779d4c5a3051a944aa83143f50fb92b49f8c13f6
|
@@ -15,12 +15,11 @@ module Pulse
|
|
15
15
|
|
16
16
|
def fetch_folders(folder_url, custom_path_root)
|
17
17
|
current_paths = extract_hrefs(get_response(folder_url), custom_path_root)
|
18
|
-
return unless current_paths.compact.size > 0
|
19
18
|
|
20
19
|
@folder_urls = folder_urls.union(current_paths).uniq.compact
|
21
20
|
|
22
21
|
current_paths.each do |path|
|
23
|
-
fetch_folders(path,
|
22
|
+
fetch_folders(path, nil)
|
24
23
|
end
|
25
24
|
|
26
25
|
folder_urls
|
@@ -67,8 +66,9 @@ module Pulse
|
|
67
66
|
def extract_hrefs(response, custom_path_root)
|
68
67
|
parse_html(response.body)
|
69
68
|
.css('a')
|
70
|
-
.map { |link| link['href'] }
|
71
|
-
.reject { |link| link == "../" }
|
69
|
+
.map { |link| "/#{link['href']}" }
|
70
|
+
.reject { |link| link == "../" || link == "/../" }
|
71
|
+
.reject { |link| link.include?('.') } # Remove files
|
72
72
|
.map { |link| add_base_url(link, custom_path_root) }
|
73
73
|
end
|
74
74
|
|