mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Ensure root page is processed first for docs with multiple base urls
This commit is contained in:
parent
f26e397660
commit
057a3a9ce9
1 changed files with 8 additions and 1 deletions
|
@ -3,9 +3,16 @@ module Docs
|
|||
attr_reader :request_options
|
||||
|
||||
def self.run(urls, options = {}, &block)
|
||||
urls = urls.dup
|
||||
requester = new(options)
|
||||
requester.on_response(&block) if block
|
||||
requester.request(urls)
|
||||
requester.on_response do # cheap hack to ensure root page is processed first
|
||||
if urls
|
||||
requester.request(urls)
|
||||
urls = nil
|
||||
end
|
||||
end
|
||||
requester.request(urls.shift)
|
||||
requester.run
|
||||
requester
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue