2013-12-13 19:00:07 +01:00
|
|
|
module Docs
|
|
|
|
class Git < UrlScraper
|
|
|
|
self.type = 'git'
|
2024-08-18 11:35:04 +02:00
|
|
|
self.release = '2.46.0'
|
2016-03-06 23:44:46 +01:00
|
|
|
self.base_url = 'https://git-scm.com/docs'
|
2013-12-13 19:00:07 +01:00
|
|
|
self.initial_paths = %w(/git.html)
|
2015-05-18 15:39:11 +02:00
|
|
|
self.links = {
|
2016-03-06 23:44:46 +01:00
|
|
|
home: 'https://git-scm.com/',
|
2015-05-18 15:39:11 +02:00
|
|
|
code: 'https://github.com/git/git'
|
|
|
|
}
|
2013-12-13 19:00:07 +01:00
|
|
|
|
2016-06-19 16:29:44 +02:00
|
|
|
html_filters.push 'git/entries', 'git/clean_html'
|
2013-12-13 19:00:07 +01:00
|
|
|
|
2016-06-19 16:29:44 +02:00
|
|
|
options[:container] = '#content'
|
|
|
|
options[:only_patterns] = [/\A\/[^\/]+\z/]
|
|
|
|
options[:skip] = %w(/howto-index.html)
|
2013-12-13 19:00:07 +01:00
|
|
|
|
2024-08-18 13:00:32 +02:00
|
|
|
# https://github.com/git/git?tab=License-1-ov-file#readme
|
|
|
|
# NOT https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt
|
2013-12-13 19:00:07 +01:00
|
|
|
options[:attribution] = <<-HTML
|
2024-08-18 13:00:32 +02:00
|
|
|
© 2005–2024 Linus Torvalds and others<br>
|
|
|
|
Licensed under the GNU General Public License version 2.
|
2013-12-13 19:00:07 +01:00
|
|
|
HTML
|
2019-03-09 02:36:05 +01:00
|
|
|
|
2019-03-10 03:02:24 +01:00
|
|
|
def get_latest_version(opts)
|
|
|
|
doc = fetch_doc('https://git-scm.com/', opts)
|
|
|
|
doc.at_css('.version').content.strip
|
2019-03-09 02:36:05 +01:00
|
|
|
end
|
2013-12-13 19:00:07 +01:00
|
|
|
end
|
|
|
|
end
|