|
|
@ -1,7 +1,6 @@
|
|
|
|
module Docs
|
|
|
|
module Docs
|
|
|
|
class Crystal < UrlScraper
|
|
|
|
class Crystal < UrlScraper
|
|
|
|
self.type = 'crystal'
|
|
|
|
self.type = 'crystal'
|
|
|
|
self.release = '0.30.1'
|
|
|
|
|
|
|
|
self.base_url = 'https://crystal-lang.org/'
|
|
|
|
self.base_url = 'https://crystal-lang.org/'
|
|
|
|
self.root_path = "api/#{release}/index.html"
|
|
|
|
self.root_path = "api/#{release}/index.html"
|
|
|
|
self.initial_paths = %w(docs/index.html)
|
|
|
|
self.initial_paths = %w(docs/index.html)
|
|
|
@ -35,6 +34,14 @@ module Docs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
version '0.31' do
|
|
|
|
|
|
|
|
self.release = '0.31.0'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
version '0.30' do
|
|
|
|
|
|
|
|
self.release = '0.30.1'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_latest_version(opts)
|
|
|
|
def get_latest_version(opts)
|
|
|
|
body = fetch('https://crystal-lang.org/api', opts)
|
|
|
|
body = fetch('https://crystal-lang.org/api', opts)
|
|
|
|
body.scan(/Crystal Docs ([0-9.]+)/)[0][0]
|
|
|
|
body.scan(/Crystal Docs ([0-9.]+)/)[0][0]
|
|
|
|