forked from freeCodeCamp/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroovy.rb
executable file
·51 lines (43 loc) · 1.3 KB
/
groovy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module Docs
class Groovy < UrlScraper
self.type = 'groovy'
self.root_path = 'overview-summary.html'
self.links = {
home: 'https://groovy-lang.org/',
code: 'https://github.com/apache/groovy'
}
html_filters.push 'groovy/clean_html', 'groovy/entries'
options[:skip] = %w(
index-all.html
deprecated-list.html
help-doc.html
)
options[:skip_patterns] = [
/\Aindex.html/
]
options[:attribution] = <<-HTML
© 2003-2022 The Apache Software Foundation<br>
Licensed under the Apache license.
HTML
version '4.0' do
self.release = '4.0.0'
self.base_url = "https://docs.groovy-lang.org/#{self.release}/html/gapi/"
end
version '3.0' do
self.release = '3.0.9'
self.base_url = "https://docs.groovy-lang.org/#{self.release}/html/gapi/"
end
version '2.5' do
self.release = '2.5.14'
self.base_url = "https://docs.groovy-lang.org/#{self.release}/html/gapi/"
end
version '2.4' do
self.release = '2.4.21'
self.base_url = "https://docs.groovy-lang.org/#{self.release}/html/gapi/"
end
def get_latest_version(opts)
doc = fetch_doc('https://groovy.apache.org/download.html', opts)
doc.at_css('#big-download-button').content.split(' ').last
end
end
end