-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathopengl.rb
More file actions
35 lines (30 loc) · 1017 Bytes
/
opengl.rb
File metadata and controls
35 lines (30 loc) · 1017 Bytes
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
module Docs
class Opengl < FileScraper
self.type = 'simple'
self.name = 'OpenGL'
self.root_path = 'index.php'
self.links = {
home: 'https://registry.khronos.org/OpenGL-Refpages/'
}
html_filters.push 'opengl/entries', 'opengl/clean_html'
# indexflat.php is a copy of index.php
options[:skip] = %w(indexflat.php)
options[:attribution] = ->(filter) {
# copyright is the last section in these pages
return filter.css('h2:contains("Copyright") ~ p').inner_text
}
version '4' do
self.root_path = 'index.php'
self.release = '4'
self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/html/"
end
version '2.1' do
self.root_path = 'index.html'
self.release = '2.1'
self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/xhtml/"
end
def get_latest_version(opts)
get_latest_github_commit_date('KhronosGroup', 'OpenGL-Refpages', opts)
end
end
end