pulse-downloader 0.1.35 → 0.1.39

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df940062ab2c0dcdc96b256b76e8198683776d7bdb834198c0f75da85d5e63fb
4
- data.tar.gz: 158f5746ceb0d820934e126cae7ca53dfca0a841ae8a588b2b955c85de5abc7f
3
+ metadata.gz: 755faae63c8f6067194546786b29706989cd48f8245d4ea88ad66e4743071356
4
+ data.tar.gz: a1dbf88e3b530d5b4cb5d21695a18e88cae2bf9cd60928bc02848926d218ae3d
5
5
  SHA512:
6
- metadata.gz: 2494b72940a92e4b13fc44c8c9c81ff63e48a35940e9bcc6437235afdd4c1ca2fdc43098b71f976ce42d5fa65b53979aa3b055b511c91c1ca6b0ff64a0dd472c
7
- data.tar.gz: 1c40920e57fdbb4184034cc91953f82c5babf1c09146027b9b887b1bac5d8b45f4e386b21133bd44625f8adb8843daac8b4652e35e94ebf25188738d02d8a36c
6
+ metadata.gz: d70c134e4603b189b242e9d6e683e42b609b4b358c5d1c265595f6609fb7506a440833644ec0a3b1168442ed1f89eedea258ee091988f40025076f3d88d68a24
7
+ data.tar.gz: d13f84a37b875c65ececb27f9d2a4cef7f2fb1ebb029576170b2a86f4ba2f1164381de7c491f5dc5fc64f544383c3073065fce430ab99eac0d1ee6e54d879e89
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.35"
3
+ VERSION = "0.1.39"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ module Pulse
3
3
  module WebPageParser
4
4
  def fetch_file_paths(custom_path_root=nil)
5
5
  if traverse_folders
6
- fetch_folders(url).each do |folder_url|
6
+ fetch_folders(url, custom_path_root).each do |folder_url|
7
7
  fetch_and_parse_response(folder_url, custom_path_root)
8
8
  end
9
9
  else
@@ -13,14 +13,14 @@ module Pulse
13
13
 
14
14
  private
15
15
 
16
- def fetch_folders(base_url)
16
+ def fetch_folders(folder_url, custom_path_root)
17
17
  current_paths = extract_hrefs(get_response(folder_url), custom_path_root)
18
18
  return unless current_paths.compact.size > 0
19
19
 
20
20
  @folder_urls = folder_urls.union(current_paths).uniq.compact
21
21
 
22
22
  current_paths.each do |path|
23
- fetch_folders(path)
23
+ fetch_folders(path, custom_path_root)
24
24
  end
25
25
 
26
26
  folder_urls
@@ -67,8 +67,9 @@ module Pulse
67
67
  def extract_hrefs(response, custom_path_root)
68
68
  parse_html(response.body)
69
69
  .css('a')
70
- .map { |link| link['href'] }
71
- .reject { |link| link == "../" }
70
+ .map { |link| "/#{link['href']}" }
71
+ .reject { |link| link == "../" || link == "/../" }
72
+ .reject { |link| link.include?('.') } # Remove files
72
73
  .map { |link| add_base_url(link, custom_path_root) }
73
74
  end
74
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulse-downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.35
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22