-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathruby.rb
106 lines (89 loc) · 2.3 KB
/
ruby.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module Docs
class Ruby < Rdoc
# Instructions:
# 1. Download Ruby's source code
# 2. Run "./configure && make html" (in the Ruby directory)
# 3. Copy the contents of the ".ext/html" directory to "docs/ruby~[version]"
include FixInternalUrlsBehavior
self.links = {
home: 'https://www.ruby-lang.org/',
code: 'https://github.com/ruby/ruby'
}
html_filters.replace 'rdoc/entries', 'ruby/entries'
options[:root_title] = 'Ruby Programming Language'
options[:title] = ->(filter) { filter.slug == 'globals_rdoc' ? 'Globals' : false }
options[:skip] += %w(
contributing_rdoc.html
contributors_rdoc.html
dtrace_probes_rdoc.html
maintainers_rdoc.html
regexp_rdoc.html
standard_library_rdoc.html
syntax_rdoc.html
extension_rdoc.html
extension_ja_rdoc.html
Data.html
English.html
Fcntl.html
Kconv.html
NKF.html
OLEProperty.html
OptParse.html
UnicodeNormalize.html)
options[:skip_patterns] += [
/\Alib\//,
/\ADEBUGGER__/,
/\AException2MessageMapper/,
/\AJSON\/Ext/,
/\AHTTP/i,
/\AMakeMakefile/i,
/\ANQXML/,
/\APride/,
/\AProfiler__/,
/\ARacc/,
/\ARake/,
/\ARbConfig/,
/\ARDoc/,
/\AREXML/,
/\AShell\//,
/\ATest/,
/win32/i,
/\AXMP/]
options[:attribution] = <<-HTML
Ruby Core © 1993–2020 Yukihiro Matsumoto<br>
Licensed under the Ruby License.<br>
Ruby Standard Library © contributors<br>
Licensed under their own licenses.
HTML
version '3' do
self.release = '3.0.0'
end
version '2.7' do
self.release = '2.7.2'
end
version '2.6' do
self.release = '2.6.3'
end
version '2.5' do
self.release = '2.5.3'
end
version '2.4' do
self.release = '2.4.5'
end
version '2.3' do
self.release = '2.3.8'
end
version '2.2' do
self.release = '2.2.10'
end
def get_latest_version(opts)
tags = get_github_tags('ruby', 'ruby', opts)
tags.each do |tag|
version = tag['name'].gsub(/_/, '.')[1..-1]
if !/^([0-9.]+)$/.match(version).nil? && version.count('.') == 2
return version
end
end
end
end
end