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

pull/602/head
Thibaut Courouble 8 years ago
parent f26e397660
commit 057a3a9ce9

@ -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…
Cancel
Save