pulse-downloader 0.1.41 → 0.1.42

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: 8cfa24f36ba29f56841e44a4b2399ad674db933c119b895a596ec4b2f50a85e5
4
- data.tar.gz: dc9771c6c117054112697ad308ee0f96ed636121417dcd27ba23b2576979a573
3
+ metadata.gz: 73defa92c0a7c2549c36a9ff9b5bb94b8b9cebf2de817c24bebf8d990d9eaaf7
4
+ data.tar.gz: dffa27233dca1a5a50c1b3ca5142ced965ec7b87cba0655c654db8067c421fd2
5
5
  SHA512:
6
- metadata.gz: 5d87b3058eaf841b32ae74d752eeea5bde05ca23ca834a4758c8e08b63476de3d5aa9c6dbd3eaef4321d7fb8366b3cfa6341009e7d931f3460cc03b5ee28946d
7
- data.tar.gz: f4cfaa96edbf077b0c30a5fc0e0ee0c3309a3beca0b1c1cddf3b3e491cebedfba0acb9126ee423f911f118be779d4c5a3051a944aa83143f50fb92b49f8c13f6
6
+ metadata.gz: 7d8b38aa36bd9fb8a5954872bb3509d31cbe6e2f59fe9963bd8d75a5456ccc858a18cd3e032134bdf5d4a0bb8800d53246dd36ef77958a3001608dbe93895a2a
7
+ data.tar.gz: 2b8fb4ef00b7b75e03535267d2f35b0fc9ccd2c7b67357d11318a4c03e99003a0022d255eaad978626176099713c59f76c9756e6486c01538c947328f6031926
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.41"
3
+ VERSION = "0.1.42"
4
4
  end
5
5
  end
@@ -13,13 +13,13 @@ module Pulse
13
13
 
14
14
  private
15
15
 
16
- def fetch_folders(folder_url, custom_path_root)
17
- current_paths = extract_hrefs(get_response(folder_url), custom_path_root)
16
+ def fetch_folders(folder_url, custom_path_root, inner_string)
17
+ current_paths = extract_hrefs(get_response(folder_url), custom_path_root, inner_string)
18
18
 
19
19
  @folder_urls = folder_urls.union(current_paths).uniq.compact
20
20
 
21
21
  current_paths.each do |path|
22
- fetch_folders(path, nil)
22
+ fetch_folders(path, nil, inner_string)
23
23
  end
24
24
 
25
25
  folder_urls
@@ -63,15 +63,21 @@ module Pulse
63
63
  ).uniq
64
64
  end
65
65
 
66
- def extract_hrefs(response, custom_path_root)
66
+ def extract_hrefs(response, custom_path_root, inner_string)
67
67
  parse_html(response.body)
68
68
  .css('a')
69
69
  .map { |link| "/#{link['href']}" }
70
70
  .reject { |link| link == "../" || link == "/../" }
71
71
  .reject { |link| link.include?('.') } # Remove files
72
+ .map { |link| append_two_paths(inner_string, link) }
72
73
  .map { |link| add_base_url(link, custom_path_root) }
73
74
  end
74
75
 
76
+ def append_two_paths(inner_string, link)
77
+ return link if inner_string.nil?
78
+ "#{inner_string}/#{link}"
79
+ end
80
+
75
81
  def extract_all_urls(response, custom_path_root, type)
76
82
  parse_html(response.body)
77
83
  .to_s
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.41
4
+ version: 0.1.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22