@@ -395,6 +395,7 @@ def init_ivars # :nodoc:
395
395
@coverage_report = false
396
396
@op_dir = nil
397
397
@page_dir = nil
398
+ @plugins = [ ]
398
399
@pipe = false
399
400
@output_decoration = true
400
401
@rdoc_include = [ ]
@@ -436,6 +437,7 @@ def init_with map # :nodoc:
436
437
@main_page = map [ 'main_page' ]
437
438
@markup = map [ 'markup' ]
438
439
@op_dir = map [ 'op_dir' ]
440
+ @plugins = map [ 'plugins' ]
439
441
@show_hash = map [ 'show_hash' ]
440
442
@tab_width = map [ 'tab_width' ]
441
443
@template_dir = map [ 'template_dir' ]
@@ -503,6 +505,7 @@ def == other # :nodoc:
503
505
@main_page == other . main_page and
504
506
@markup == other . markup and
505
507
@op_dir == other . op_dir and
508
+ @plugins == other . plugins and
506
509
@rdoc_include == other . rdoc_include and
507
510
@show_hash == other . show_hash and
508
511
@static_path == other . static_path and
@@ -868,6 +871,12 @@ def parse argv
868
871
869
872
opt . separator nil
870
873
874
+ opt . on ( "--plugins=PLUGINS" , "-P" , Array , "Use plugins" ) do |value |
875
+ @plugins . concat value
876
+ end
877
+
878
+ opt . separator nil
879
+
871
880
opt . on ( "--tab-width=WIDTH" , "-w" , Integer ,
872
881
"Set the width of tab characters." ) do |value |
873
882
raise OptionParser ::InvalidArgument ,
@@ -1344,6 +1353,16 @@ def visibility= visibility
1344
1353
end
1345
1354
end
1346
1355
1356
+ # Load plugins specified with options
1357
+ # Currently plugin search logic is very simple, but it's not practical.
1358
+ # TODO: We will improve this later.
1359
+
1360
+ def load_plugins
1361
+ @plugins . each do |plugin_name |
1362
+ require_relative "./#{ plugin_name } .rb"
1363
+ end
1364
+ end
1365
+
1347
1366
##
1348
1367
# Displays a warning using Kernel#warn if we're being verbose
1349
1368
0 commit comments