Ensure root page is processed first for docs with multiple base urls

This commit is contained in:
Thibaut Courouble 2017-03-12 16:54:12 -04:00
parent f26e397660
commit 057a3a9ce9

View file

@ -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