|
|
@ -1,7 +1,9 @@
|
|
|
|
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
|
|
module Docs
|
|
|
|
module Docs
|
|
|
|
class Rust < UrlScraper
|
|
|
|
class Rust < UrlScraper
|
|
|
|
self.type = 'rust'
|
|
|
|
self.type = 'rust'
|
|
|
|
self.release = '1.29.1'
|
|
|
|
self.release = '1.30.1'
|
|
|
|
self.base_url = 'https://doc.rust-lang.org/'
|
|
|
|
self.base_url = 'https://doc.rust-lang.org/'
|
|
|
|
self.root_path = 'book/second-edition/index.html'
|
|
|
|
self.root_path = 'book/second-edition/index.html'
|
|
|
|
self.initial_paths = %w(
|
|
|
|
self.initial_paths = %w(
|
|
|
@ -28,6 +30,7 @@ module Docs
|
|
|
|
options[:fix_urls] = ->(url) do
|
|
|
|
options[:fix_urls] = ->(url) do
|
|
|
|
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'
|
|
|
|
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'
|
|
|
|
url.sub! '/unicode/u_str', '/unicode/str/'
|
|
|
|
url.sub! '/unicode/u_str', '/unicode/str/'
|
|
|
|
|
|
|
|
url.sub! '/std/std/', '/std/'
|
|
|
|
url
|
|
|
|
url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|