2013-10-24 20:25:52 +02:00
|
|
|
module Docs
|
|
|
|
class Node < UrlScraper
|
|
|
|
self.name = 'Node.js'
|
|
|
|
self.slug = 'node'
|
|
|
|
self.type = 'node'
|
2015-03-29 16:53:01 +02:00
|
|
|
self.links = {
|
|
|
|
home: 'https://nodejs.org/',
|
2015-11-01 16:56:45 +01:00
|
|
|
code: 'https://github.com/nodejs/node'
|
2015-03-29 16:53:01 +02:00
|
|
|
}
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2018-03-25 23:16:00 +02:00
|
|
|
html_filters.push 'node/clean_html', 'node/entries', 'title'
|
2013-10-24 20:25:52 +02:00
|
|
|
|
|
|
|
options[:title] = false
|
|
|
|
options[:root_title] = 'Node.js'
|
|
|
|
options[:container] = '#apicontent'
|
|
|
|
options[:skip] = %w(index.html all.html documentation.html synopsis.html)
|
|
|
|
|
2013-11-16 17:00:08 +01:00
|
|
|
options[:attribution] = <<-HTML
|
2013-10-24 20:25:52 +02:00
|
|
|
© Joyent, Inc. and other Node contributors<br>
|
2015-11-01 16:56:45 +01:00
|
|
|
Licensed under the MIT License.<br>
|
|
|
|
Node.js is a trademark of Joyent, Inc. and is used with its permission.<br>
|
|
|
|
We are not endorsed by or affiliated with Joyent.
|
2013-10-24 20:25:52 +02:00
|
|
|
HTML
|
2016-01-24 18:56:59 +01:00
|
|
|
|
|
|
|
version do
|
2018-11-04 23:15:16 +01:00
|
|
|
self.release = '11.1.0'
|
|
|
|
self.base_url = 'https://nodejs.org/dist/latest-v11.x/docs/api/'
|
|
|
|
end
|
|
|
|
|
|
|
|
version '10 LTS' do
|
|
|
|
self.release = '10.13.0'
|
2018-04-28 16:22:26 +02:00
|
|
|
self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/'
|
2017-11-10 17:50:07 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
version '8 LTS' do
|
2018-11-04 23:15:16 +01:00
|
|
|
self.release = '8.12.0'
|
2017-06-04 17:50:40 +02:00
|
|
|
self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/'
|
2016-10-30 21:58:25 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
version '6 LTS' do
|
2018-08-19 23:45:36 +02:00
|
|
|
self.release = '6.14.4'
|
2016-10-01 17:01:30 +02:00
|
|
|
self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/'
|
2016-01-24 18:56:59 +01:00
|
|
|
end
|
|
|
|
|
2016-02-15 18:19:36 +01:00
|
|
|
version '4 LTS' do
|
2018-06-11 03:14:02 +02:00
|
|
|
self.release = '4.9.1'
|
2016-10-01 17:01:30 +02:00
|
|
|
self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/'
|
2016-01-24 18:56:59 +01:00
|
|
|
end
|
2019-03-09 20:22:48 +01:00
|
|
|
|
|
|
|
def get_latest_version(options, &block)
|
|
|
|
fetch_doc('https://nodejs.org/en/', options) do |doc|
|
|
|
|
block.call doc.at_css('#home-intro > .home-downloadblock:last-of-type > a')['data-version'][1..-1]
|
|
|
|
end
|
|
|
|
end
|
2013-10-24 20:25:52 +02:00
|
|
|
end
|
|
|
|
end
|