@@ -106,6 +106,7 @@ class RDoc::Options
106106 generator_options
107107 generators
108108 op_dir
109+ load_ri_dir
109110 option_parser
110111 pipe
111112 rdoc_include
@@ -246,6 +247,11 @@ class RDoc::Options
246247
247248 attr_accessor :op_dir
248249
250+ ##
251+ # The loading ri directory to generate other format
252+
253+ attr_accessor :load_ri_dir
254+
249255 ##
250256 # The OptionParser for this instance
251257
@@ -364,6 +370,7 @@ def init_ivars # :nodoc:
364370 @markup = 'rdoc'
365371 @coverage_report = false
366372 @op_dir = nil
373+ @load_ri_dir = nil
367374 @page_dir = nil
368375 @pipe = false
369376 @output_decoration = true
@@ -402,6 +409,7 @@ def init_with map # :nodoc:
402409 @main_page = map [ 'main_page' ]
403410 @markup = map [ 'markup' ]
404411 @op_dir = map [ 'op_dir' ]
412+ @load_ri_dir = map [ 'load_ri_dir' ]
405413 @show_hash = map [ 'show_hash' ]
406414 @tab_width = map [ 'tab_width' ]
407415 @template_dir = map [ 'template_dir' ]
@@ -424,10 +432,11 @@ def == other # :nodoc:
424432 @hyperlink_all == other . hyperlink_all and
425433 @line_numbers == other . line_numbers and
426434 @locale == other . locale and
427- @locale_dir == other . locale_dir and
435+ @locale_dir == other . locale_dir and
428436 @main_page == other . main_page and
429437 @markup == other . markup and
430438 @op_dir == other . op_dir and
439+ @load_ri_dir == other . load_ri_dir and
431440 @rdoc_include == other . rdoc_include and
432441 @show_hash == other . show_hash and
433442 @static_path == other . static_path and
@@ -524,9 +533,10 @@ def finish
524533
525534 @exclude = self . exclude
526535
527- finish_page_dir
528-
529- check_files
536+ unless @load_ri_dir
537+ finish_page_dir
538+ check_files
539+ end
530540
531541 # If no template was specified, use the default template for the output
532542 # formatter
@@ -865,6 +875,14 @@ def parse argv
865875
866876 opt . separator nil
867877
878+ opt . on ( "--load-ri-dir=DIR" , Path ,
879+ "Specify a ri data directory to generate" ,
880+ "other format." ) do |value |
881+ @load_ri_dir = value
882+ end
883+
884+ opt . separator nil
885+
868886 opt . on ( "-d" ,
869887 "Deprecated --diagram option." ,
870888 "Prevents firing debug mode" ,
0 commit comments