Skip to content

Commit 10249db

Browse files
committed
Merge pull request #376 from jonathanhefner/rdoc-path-prefix-options
Use `{class_module,file}_path_prefix` RDoc options
1 parent 5390f4f commit 10249db

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/sdoc/generator.rb

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

2626
DESCRIPTION = 'Searchable HTML documentation'
2727

28+
FILE_DIR = "files"
29+
CLASS_DIR = "classes"
30+
2831
include ERB::Util
2932
include SDoc::GitHub
3033
include SDoc::Templatable
@@ -35,9 +38,6 @@ class RDoc::Generator::SDoc
3538
TREE_FILE = File.join 'panel', 'tree.js'
3639
SEARCH_INDEX_FILE = File.join 'js', 'search_index.js'
3740

38-
FILE_DIR = 'files'
39-
CLASS_DIR = 'classes'
40-
4141
RESOURCES_DIR = File.join('resources', '.')
4242

4343
attr_reader :base_dir
@@ -64,6 +64,14 @@ def self.setup_options(options)
6464
puts SDoc::VERSION
6565
exit
6666
end
67+
68+
if options.respond_to?(:class_module_path_prefix)
69+
options.class_module_path_prefix = CLASS_DIR
70+
end
71+
72+
if options.respond_to?(:file_path_prefix)
73+
options.file_path_prefix = FILE_DIR
74+
end
6775
end
6876

6977
def initialize(store, options)
@@ -98,10 +106,12 @@ def generate
98106
generate_class_files
99107
end
100108

109+
# For compatibility with RDoc < 6.13.0
101110
def class_dir
102111
CLASS_DIR
103112
end
104113

114+
# For compatibility with RDoc < 6.13.0
105115
def file_dir
106116
FILE_DIR
107117
end

0 commit comments

Comments
 (0)