Module: Pulse::Downloader::WebPageParser

Included in:
Client
Defined in:
lib/pulse/downloader/web_page_parser.rb

Instance Method Summary collapse

Instance Method Details

#fetch_file_paths(custom_path_root = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pulse/downloader/web_page_parser.rb', line 4

def fetch_file_paths(custom_path_root=nil)
  @start_time = get_micro_second_time

  response = HTTParty.get(url, verify: verify_ssl, headers: headers)

  @end_time = get_micro_second_time

  if report_time
    print_time
  end

  if file_type.is_a?(Array)
    file_type.flat_map do |type|
      extract_file_urls(response, custom_path_root, type)
    end
  else
    extract_file_urls(response, custom_path_root, file_type)
  end
end