Skip to content

Commit 3fcc2bb

Browse files
Merge pull request #375 from jonathanhefner/rdoc-6_13_0
Fix compatibility with RDoc 6.13.0
2 parents 805531f + df9e83e commit 3fcc2bb

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

lib/sdoc/generator.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ class RDoc::Generator::SDoc
2525

2626
DESCRIPTION = 'Searchable HTML documentation'
2727

28-
FILE_DIR = 'files'
29-
CLASS_DIR = 'classes'
30-
3128
RESOURCES_DIR = File.join('resources', '.')
3229

3330
attr_reader :options
@@ -94,11 +91,11 @@ def generate
9491
end
9592

9693
def class_dir
97-
CLASS_DIR
94+
nil
9895
end
9996

10097
def file_dir
101-
FILE_DIR
98+
nil
10299
end
103100

104101
### Determines index page based on @options.main_page (or lack thereof)

lib/sdoc/rdoc_monkey_patches.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
require "rdoc"
22

3+
RDoc::TopLevel.prepend(Module.new do
4+
def path
5+
File.join("files", super)
6+
end
7+
end)
8+
9+
10+
RDoc::ClassModule.prepend(Module.new do
11+
def path
12+
File.join("classes", super)
13+
end
14+
end)
15+
16+
317
RDoc::TopLevel.prepend(Module.new do
418
attr_writer :path
519

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def rdoc_top_level_for(ruby_code)
2828
# foolproof way to initialize it is by simply running it with a dummy file.
2929
$rdoc_for_specs ||= rdoc_dry_run("--files", __FILE__)
3030

31-
$rdoc_for_specs.store = RDoc::Store.new
31+
$rdoc_for_specs.store = RDoc::Store.new(RDoc::Options.new)
3232

3333
Dir.mktmpdir do |dir|
3434
path = "#{dir}/ruby_code.rb"

0 commit comments

Comments
 (0)