@@ -268,6 +268,11 @@ class RDoc::Options
268268
269269 attr_accessor :pipe
270270
271+ ##
272+ # Currently enabled plugins
273+
274+ attr_reader :plugins
275+
271276 ##
272277 # Array of directories to search for files to satisfy an :include:
273278
@@ -395,6 +400,7 @@ def init_ivars # :nodoc:
395400 @coverage_report = false
396401 @op_dir = nil
397402 @page_dir = nil
403+ @plugins = [ ]
398404 @pipe = false
399405 @output_decoration = true
400406 @rdoc_include = [ ]
@@ -436,6 +442,7 @@ def init_with map # :nodoc:
436442 @main_page = map [ 'main_page' ]
437443 @markup = map [ 'markup' ]
438444 @op_dir = map [ 'op_dir' ]
445+ @plugins = map [ 'plugins' ]
439446 @show_hash = map [ 'show_hash' ]
440447 @tab_width = map [ 'tab_width' ]
441448 @template_dir = map [ 'template_dir' ]
@@ -503,6 +510,7 @@ def == other # :nodoc:
503510 @main_page == other . main_page and
504511 @markup == other . markup and
505512 @op_dir == other . op_dir and
513+ @plugins == other . plugins and
506514 @rdoc_include == other . rdoc_include and
507515 @show_hash == other . show_hash and
508516 @static_path == other . static_path and
@@ -868,6 +876,12 @@ def parse argv
868876
869877 opt . separator nil
870878
879+ opt . on ( "--plugins=PLUGINS" , "-P" , Array , "Use plugins" ) do |value |
880+ @plugins . concat value
881+ end
882+
883+ opt . separator nil
884+
871885 opt . on ( "--tab-width=WIDTH" , "-w" , Integer ,
872886 "Set the width of tab characters." ) do |value |
873887 raise OptionParser ::InvalidArgument ,
@@ -1344,6 +1358,16 @@ def visibility= visibility
13441358 end
13451359 end
13461360
1361+ # Load plugins specified with options
1362+ # Currently plugin search logic is very simple, but it's not practical.
1363+ # TODO: We will improve this later.
1364+
1365+ def load_plugins
1366+ @plugins . each do |plugin_name |
1367+ require_relative "./#{ plugin_name } .rb"
1368+ end
1369+ end
1370+
13471371 ##
13481372 # Displays a warning using Kernel#warn if we're being verbose
13491373
0 commit comments