Skip to content

Commit ba6eeb3

Browse files
committed
Fix backward compatibility #3 since RDoc 6.13.0
Some methods have been removed in ruby/rdoc#1315.
1 parent 56532f6 commit ba6eeb3

File tree

7 files changed

+35
-17
lines changed

7 files changed

+35
-17
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog of RorVsWild theme for RDoc
2+
3+
## Unreleased
4+
5+
- Fix backward compatibility since RDoc 6.13.0

lib/rdoc/generator/template/rorvswild/_sidebar_extends.rhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h3>Extended With Modules</h3>
44

55
<ul class="link-list">
6-
<%- klass.each_extend do |ext| -%>
6+
<%- klass.extends.each do |ext| -%>
77
<%- unless String === ext.module then -%>
88
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
99
<%- else -%>

lib/rdoc/generator/template/rorvswild/_sidebar_includes.rhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h3>Included Modules</h3>
44

55
<ul class="link-list">
6-
<%- klass.each_include do |inc| -%>
6+
<%- klass.includes.each do |inc| -%>
77
<%- unless String === inc.module then -%>
88
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
99
<%- else -%>

lib/rorvswild_theme_rdoc.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
require "rorvswild_theme_rdoc/patches/rdoc"
1+
require "rorvswild_theme_rdoc/patches/rdoc_before_6.8.0"
2+
require "rorvswild_theme_rdoc/patches/rdoc_before_6.13.0"
23

34
module RorVsWildThemeRdoc
45
end

lib/rorvswild_theme_rdoc/patches/rdoc.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if Gem::Version.new(RDoc::VERSION) < Gem::Version.new("6.13.0")
2+
# https://github.com/ruby/rdoc/pull/1315
3+
module RDoc
4+
class NormalClass
5+
attr_reader :includes
6+
attr_reader :extends
7+
attr_reader :constants
8+
end
9+
end
10+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if Gem::Version.new(RDoc::VERSION) < Gem::Version.new("6.8.0")
2+
class RDoc::ClassModule
3+
##
4+
# Get all super classes of this class in an array. The last element might be
5+
# a string if the name is unknown.
6+
def super_classes
7+
result = []
8+
parent = self
9+
while parent = parent.superclass
10+
result << parent
11+
return result if parent.is_a?(String)
12+
end
13+
result
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)