File tree Expand file tree Collapse file tree 10 files changed +10
-62
lines changed Expand file tree Collapse file tree 10 files changed +10
-62
lines changed Original file line number Diff line number Diff line change @@ -634,7 +634,7 @@ def parse comment_location
634
634
# Path to this class or module for use with HTML generator output.
635
635
636
636
def path
637
- http_url @store . rdoc . generator . class_dir
637
+ http_url
638
638
end
639
639
640
640
##
Original file line number Diff line number Diff line change @@ -973,10 +973,10 @@ def fully_documented?
973
973
##
974
974
# URL for this with a +prefix+
975
975
976
- def http_url ( prefix )
976
+ def http_url
977
977
path = name_for_path
978
978
path = path . gsub ( /<<\s *(\w *)/ , 'from-\1' ) if path =~ /<</
979
- path = [ prefix ] + path . split ( '::' )
979
+ path = path . split ( '::' )
980
980
981
981
File . join ( *path . compact ) + '.html'
982
982
end
Original file line number Diff line number Diff line change @@ -173,10 +173,8 @@ def hash
173
173
##
174
174
# URL for this with a +prefix+
175
175
176
- def http_url ( prefix )
177
- path = [ prefix , @relative_name . tr ( '.' , '_' ) ]
178
-
179
- File . join ( *path . compact ) + '.html'
176
+ def http_url
177
+ @relative_name . tr ( '.' , '_' ) + '.html'
180
178
end
181
179
182
180
def inspect # :nodoc:
@@ -246,7 +244,7 @@ def page_name
246
244
# Path to this file for use with HTML generator output.
247
245
248
246
def path
249
- http_url @store . rdoc . generator . file_dir
247
+ http_url
250
248
end
251
249
252
250
def pretty_print q # :nodoc:
Original file line number Diff line number Diff line change @@ -184,22 +184,6 @@ def debug_msg *msg
184
184
$stderr. puts ( *msg )
185
185
end
186
186
187
- ##
188
- # Directory where generated class HTML files live relative to the output
189
- # dir.
190
-
191
- def class_dir
192
- nil
193
- end
194
-
195
- ##
196
- # Directory where generated class HTML files live relative to the output
197
- # dir.
198
-
199
- def file_dir
200
- nil
201
- end
202
-
203
187
##
204
188
# Create the directories the generated docs will live in if they don't
205
189
# already exist.
Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ class RDoc::Generator::JsonIndex
86
86
attr_reader :index # :nodoc:
87
87
88
88
##
89
- # Creates a new generator. +parent_generator+ is used to determine the
90
- # class_dir and file_dir of links in the output index.
91
- #
89
+ # Creates a new generator.
92
90
# +options+ are the same options passed to the parent generator.
93
91
94
92
def initialize parent_generator , options
@@ -265,20 +263,6 @@ def index_pages
265
263
end
266
264
end
267
265
268
- ##
269
- # The directory classes are written to
270
-
271
- def class_dir
272
- @parent_generator . class_dir
273
- end
274
-
275
- ##
276
- # The directory files are written to
277
-
278
- def file_dir
279
- @parent_generator . file_dir
280
- end
281
-
282
266
def reset files , classes # :nodoc:
283
267
@files = files
284
268
@classes = classes
Original file line number Diff line number Diff line change @@ -81,11 +81,6 @@ def generate
81
81
end
82
82
end
83
83
84
- # :nodoc:
85
- def class_dir
86
- nil
87
- end
88
-
89
84
private
90
85
def extract_messages
91
86
extractor = MessageExtractor . new ( @store )
Original file line number Diff line number Diff line change @@ -53,10 +53,7 @@ def setup
53
53
@rdoc . store = @store
54
54
@rdoc . options = RDoc ::Options . new
55
55
56
- g = Object . new
57
- def g . class_dir ( ) end
58
- def g . file_dir ( ) end
59
- @rdoc . generator = g
56
+ @rdoc . generator = Object . new
60
57
61
58
RDoc ::Markup ::PreProcess . reset
62
59
end
Original file line number Diff line number Diff line change @@ -80,14 +80,6 @@ def test_build_index
80
80
assert_equal expected , index
81
81
end
82
82
83
- def test_class_dir
84
- assert_equal @darkfish . class_dir , @g . class_dir
85
- end
86
-
87
- def test_file_dir
88
- assert_equal @darkfish . file_dir , @g . file_dir
89
- end
90
-
91
83
def test_generate
92
84
@g . generate
93
85
Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ def test_hash
156
156
end
157
157
158
158
def test_http_url
159
- assert_equal 'prefix/ path/top_level_rb.html' , @top_level . http_url ( 'prefix' )
159
+ assert_equal 'path/top_level_rb.html' , @top_level . http_url
160
160
161
161
other_level = @store . add_file 'path.other/level.rb'
162
- assert_equal 'prefix/ path_other/level_rb.html' , other_level . http_url ( 'prefix' )
162
+ assert_equal 'path_other/level_rb.html' , other_level . http_url
163
163
end
164
164
165
165
def test_last_modified
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ def setup
30
30
@top_levels . push @example_md
31
31
32
32
generator = Object . new
33
- def generator . class_dir ( ) nil end
34
- def generator . file_dir ( ) nil end
35
33
@rdoc . options = @options
36
34
@rdoc . generator = generator
37
35
You can’t perform that action at this time.
0 commit comments