I have a lot of code that opens itself up if it is being unit tested at
the time. It usually looks like:
protected unless $TESTING
rdoc -D was showing that it was only expecting a symbol or string after
a visibility specifier via parse_symbol_in_arg. The following patch
allows statements like the above to ignore any conditional modifiers
and still understand the intended visibility as long as it is written
in the default case:
diff -d -u -r1.6.2.17 parse_rb.rb
--- parsers/parse_rb.rb 7 May 2004 13:14:58 -0000 1.6.2.17
+++ parsers/parse_rb.rb 14 May 2004 20:33:28 -0000
@@ -2453,6 +2453,8 @@
if peek_tk.kind_of? TkNL
# error("Missing argument") if singleton
container.ongoing_visibility = vis
+ elsif peek_tk.kind_of? TkUNLESS_MOD or peek_tk.kind_of? TkIF_MOD
+ container.ongoing_visibility = vis
else
args = parse_symbol_arg
container.set_visibility_for(args, vis, singleton)
I would also like to find some way to make %params% extend w/ a space
in front of parenthesis are not used for the method definition.
Otherwise the html renderered looks like "methodargs" with "method"
being bold. But I can't figure this one out in my current exhausted
mental state.