File tree 3 files changed +16
-17
lines changed
3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ class RDoc::Generator::SDoc
25
25
26
26
DESCRIPTION = 'Searchable HTML documentation'
27
27
28
+ FILE_DIR = "files"
29
+ CLASS_DIR = "classes"
30
+
28
31
RESOURCES_DIR = File . join ( 'resources' , '.' )
29
32
30
33
attr_reader :options
@@ -63,6 +66,14 @@ def self.setup_options(options)
63
66
ENV [ "HORO_BADGE_VERSION" ] || ENV [ "HORO_PROJECT_VERSION" ] ,
64
67
"API documentation"
65
68
] . compact . join ( " " )
69
+
70
+ if options . respond_to? ( :class_module_path_prefix )
71
+ options . class_module_path_prefix = CLASS_DIR
72
+ end
73
+
74
+ if options . respond_to? ( :file_path_prefix )
75
+ options . file_path_prefix = FILE_DIR
76
+ end
66
77
end
67
78
68
79
def initialize ( store , options )
@@ -90,12 +101,14 @@ def generate
90
101
generate_class_files
91
102
end
92
103
104
+ # For compatibility with RDoc < 6.13.0
93
105
def class_dir
94
- nil
106
+ CLASS_DIR
95
107
end
96
108
109
+ # For compatibility with RDoc < 6.13.0
97
110
def file_dir
98
- nil
111
+ FILE_DIR
99
112
end
100
113
101
114
### Determines index page based on @options.main_page (or lack thereof)
Original file line number Diff line number Diff line change 1
1
require "rdoc"
2
2
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
-
17
3
RDoc ::TopLevel . prepend ( Module . new do
18
4
attr_writer :path
19
5
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def rdoc_top_level_for(ruby_code)
28
28
# foolproof way to initialize it is by simply running it with a dummy file.
29
29
$rdoc_for_specs ||= rdoc_dry_run ( "--files" , __FILE__ )
30
30
31
- $rdoc_for_specs. store = RDoc ::Store . new ( RDoc :: Options . new )
31
+ $rdoc_for_specs. store = RDoc ::Store . new ( $rdoc_for_specs . options )
32
32
33
33
Dir . mktmpdir do |dir |
34
34
path = "#{ dir } /ruby_code.rb"
You can’t perform that action at this time.
0 commit comments