Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with RDoc 6.13.0 #375

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/sdoc/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ class RDoc::Generator::SDoc

DESCRIPTION = 'Searchable HTML documentation'

FILE_DIR = 'files'
CLASS_DIR = 'classes'

RESOURCES_DIR = File.join('resources', '.')

attr_reader :options
Expand Down Expand Up @@ -94,11 +91,11 @@ def generate
end

def class_dir
CLASS_DIR
nil
end

def file_dir
FILE_DIR
nil
end

### Determines index page based on @options.main_page (or lack thereof)
Expand Down
14 changes: 14 additions & 0 deletions lib/sdoc/rdoc_monkey_patches.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
require "rdoc"

RDoc::TopLevel.prepend(Module.new do
def path
File.join("files", super)
end
end)


RDoc::ClassModule.prepend(Module.new do
def path
File.join("classes", super)
end
end)


RDoc::TopLevel.prepend(Module.new do
attr_writer :path

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def rdoc_top_level_for(ruby_code)
# foolproof way to initialize it is by simply running it with a dummy file.
$rdoc_for_specs ||= rdoc_dry_run("--files", __FILE__)

$rdoc_for_specs.store = RDoc::Store.new
$rdoc_for_specs.store = RDoc::Store.new(RDoc::Options.new)

Dir.mktmpdir do |dir|
path = "#{dir}/ruby_code.rb"
Expand Down