ruby.rb 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. module Docs
  2. class Ruby < Rdoc
  3. # Instructions:
  4. # 1. Download Ruby's source code
  5. # 2. Run "./configure && make html" (in the Ruby directory)
  6. # 3. Copy the ".ext/html" directory to "docs/ruby~[version]"
  7. include FixInternalUrlsBehavior
  8. self.links = {
  9. home: 'https://www.ruby-lang.org/',
  10. code: 'https://github.com/ruby/ruby'
  11. }
  12. html_filters.replace 'rdoc/entries', 'ruby/entries'
  13. options[:root_title] = 'Ruby Programming Language'
  14. options[:title] = ->(filter) { filter.slug == 'globals_rdoc' ? 'Globals' : false }
  15. options[:skip] += %w(
  16. contributing_rdoc.html
  17. contributors_rdoc.html
  18. dtrace_probes_rdoc.html
  19. maintainers_rdoc.html
  20. regexp_rdoc.html
  21. standard_library_rdoc.html
  22. syntax_rdoc.html
  23. extension_rdoc.html
  24. extension_ja_rdoc.html
  25. Data.html
  26. English.html
  27. Fcntl.html
  28. Kconv.html
  29. NKF.html
  30. OLEProperty.html
  31. OptParse.html
  32. UnicodeNormalize.html)
  33. options[:skip_patterns] += [
  34. /\Alib\//,
  35. /\ADEBUGGER__/,
  36. /\AException2MessageMapper/,
  37. /\AJSON\/Ext/,
  38. /\AGem/,
  39. /\AHTTP/i,
  40. /\AIRB/,
  41. /\AMakeMakefile/i,
  42. /\ANQXML/,
  43. /\APride/,
  44. /\AProfiler__/,
  45. /\APsych\//,
  46. /\ARacc/,
  47. /\ARake/,
  48. /\ARbConfig/,
  49. /\ARDoc/,
  50. /\AREXML/,
  51. /\ARSS/,
  52. /\AShell\//,
  53. /\ATest/,
  54. /\AWEBrick/,
  55. /win32/i,
  56. /\AXML/,
  57. /\AXMP/]
  58. options[:attribution] = <<-HTML
  59. Ruby Core &copy; 1993&ndash;2022 Yukihiro Matsumoto<br>
  60. Licensed under the Ruby License.<br>
  61. Ruby Standard Library &copy; contributors<br>
  62. Licensed under their own licenses.
  63. HTML
  64. version '3.2' do
  65. self.release = '3.2.0'
  66. end
  67. version '3.1' do
  68. self.release = '3.1.3'
  69. end
  70. version '3' do
  71. self.release = '3.0.0'
  72. end
  73. version '2.7' do
  74. self.release = '2.7.2'
  75. end
  76. version '2.6' do
  77. self.release = '2.6.3'
  78. end
  79. version '2.5' do
  80. self.release = '2.5.3'
  81. end
  82. version '2.4' do
  83. self.release = '2.4.5'
  84. end
  85. version '2.3' do
  86. self.release = '2.3.8'
  87. end
  88. version '2.2' do
  89. self.release = '2.2.10'
  90. end
  91. def get_latest_version(opts)
  92. tags = get_github_tags('ruby', 'ruby', opts)
  93. tags.each do |tag|
  94. version = tag['name'].gsub(/_/, '.')[1..-1]
  95. if !/^([0-9.]+)$/.match(version).nil? && version.count('.') == 2
  96. return version
  97. end
  98. end
  99. end
  100. end
  101. end