You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/babel.rb

32 lines
775 B

7 years ago
module Docs
class Babel < UrlScraper
self.type = 'simple'
7 years ago
self.base_url = 'http://babeljs.io/docs/'
self.release = '6.26.1'
self.initial_paths = %w(core-packages/)
7 years ago
self.links = {
home: 'https://babeljs.io/',
code: 'https://github.com/babel/babel'
}
html_filters.push 'babel/clean_html', 'babel/entries'
options[:trailing_slash] = true
options[:skip] = %w{setup/ editors/ community/videos/}
7 years ago
options[:attribution] = <<-HTML
&copy; 2018 Sebastian McKenzie<br>
Licensed under the MIT License.
7 years ago
HTML
stub '' do
'<div></div>'
end
def get_latest_version(opts)
doc = fetch_doc('https://babeljs.io/docs/en/', opts)
doc.at_css('a[href="/versions"] > h3').content
end
7 years ago
end
end