--------------060602060709070007020403
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Moin.
RDoc used to generate warnings like this for this kind of code:
def Binding.of_caller(...) ... end
Couldn't find Binding. Assuming it's a module
Which does not make much sense because obviously Binding itself is a
build-in Ruby class.
The attached patch looks up constant names in that context via
Object.const_get (including support for X::Y style names). This means
that there will be a few false positives as well for the classes that
RDoc itself provides, but that is IMHO not too much of a problem.
The patch also supports the case where you're extending a Class or
Module that has no other methods with a :nodoc: directive like in this case:
def Continuation.create(*args, &block) # :nodoc:
...
end
I hope that the RDoc maintainers are reading this list and will pick it
up quickly.
Regards,
Florian Gross
--------------060602060709070007020403
Content-Type: text/plain;
name arse_rb.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename arse_rb.patch"
--- parse_rb.rb.original 2005-01-22 19:39:14.000000000 +0100
+++ parse_rb.rb 2005-01-22 20:17:38.000000000 +0100
@@ -1883,6 +1883,7 @@
name_t et_tk
back_tk kip_tkspace
meth il
+ added_container alse
dot et_tk
if dot.kind_of?(TkDOT) or dot.kind_of?(TkCOLON2)
@@ -1897,8 +1898,21 @@
prev_container ontainer
container ontainer.find_module_named(name_t.name)
if !container
- warn("Couldn't find #{name_t.name}. Assuming it's a module")
- container rev_container.add_module(NormalModule, name_t.name)
+ added_container rue
+ obj ame_t.name.split("::").inject(Object) do |state, item|
+ state.const_get(item)
+ end rescue nil
+
+ type bj.class Class ? NormalClass : NormalModule
+ if not [Class, Module].include?(obj.class)
+ warn("Couldn't find #{name_t.name}. Assuming it's a module")
+ end
+
+ if type NormalClass then
+ container rev_container.add_class(type, name_t.name, obj.superclass.name)
+ else
+ container rev_container.add_module(type, name_t.name)
+ end
end
else
# warn("Unexpected token '#{name_t2.inspect}'")
@@ -1940,7 +1954,9 @@
parse_method_parameters(meth)
if meth.document_self
- container.add_method(meth)
+ container.add_method(meth)
+ elsif added_container
+ container.document_self alse
end
# Having now read the method parameters and documentation modifiers, we
--------------060602060709070007020403--