[#4076] Ruby/DL — Jamis Buck <jamis_buck@...>

I recently used Ruby/DL to create bindings to the SQLite3 embedded

40 messages 2005/01/03
[#4096] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/04

On Tue, Jan 04, 2005 at 02:53:49AM +0900, Jamis Buck wrote:

[#4099] Re: Ruby/DL — ts <decoux@...> 2005/01/04

>>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:

[#4119] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/05

On Wed, Jan 05, 2005 at 03:05:48AM +0900, ts wrote:

[#4120] Re: Ruby/DL — ts <decoux@...> 2005/01/05

>>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:

[#4125] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/05

On Thu, Jan 06, 2005 at 01:10:34AM +0900, ts wrote:

[#4116] Test::Unit::Collector::Dir won't work with code that modifies $LOAD_PATH — Eric Hodel <drbrain@...7.net>

Any test code that depends upon modifications of $: fails when used

10 messages 2005/01/05

[#4146] The face of Unicode support in the future — Charles O Nutter <headius@...>

Hello Rubyists!

47 messages 2005/01/06
[#4152] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/07

Hi,

[#4167] Re: The face of Unicode support in the future — Christian Neukirchen <chneukirchen@...> 2005/01/09

Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#4175] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/10

Hi,

[#4186] Re: The face of Unicode support in the future — Paul Brannan <pbrannan@...> 2005/01/11

On Mon, Jan 10, 2005 at 11:53:48PM +0900, Yukihiro Matsumoto wrote:

[#4192] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/12

Hi,

[#4269] Re: The face of Unicode support in the future — Wes Nakamura <wknaka@...>

19 messages 2005/01/18
[#4270] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/18

Hi,

[#4275] Re: The face of Unicode support in the future — Wes Nakamura <wknaka@...> 2005/01/19

[#4323] test/unit doesn't rescue a Exception — Tanaka Akira <akr@...17n.org>

test/unit doesn't rescue a Exception in a test method, as follows.

14 messages 2005/01/27
[#8773] Re: test/unit doesn't rescue a Exception — Tanaka Akira <akr@...> 2006/09/02

In article <87is5jb46q.fsf@serein.a02.aist.go.jp>,

[#8776] Re: test/unit doesn't rescue a Exception — "Nathaniel Talbott" <ntalbott@...> 2006/09/03

On 9/1/06, Tanaka Akira <akr@fsij.org> wrote:

[#8777] Re: test/unit doesn't rescue a Exception — Eric Hodel <drbrain@...7.net> 2006/09/03

On Sep 2, 2006, at 6:34 PM, Nathaniel Talbott wrote:

[PATCH] RDoc parse_rb.rb: Logic for def Builtin.method() end

From: Florian Gro<florgro@...>
Date: 2005-01-22 19:28:04 UTC
List: ruby-core #4302
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

Attachments (1)

parse_rb.patch (1.61 KB, text/x-diff)
--- 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 = get_tk
       back_tk = skip_tkspace
       meth = nil
+      added_container = false
 
       dot = get_tk
       if dot.kind_of?(TkDOT) or dot.kind_of?(TkCOLON2)
@@ -1897,8 +1898,21 @@
           prev_container = container
           container = container.find_module_named(name_t.name)
           if !container
-            warn("Couldn't find #{name_t.name}. Assuming it's a module")
-            container = prev_container.add_module(NormalModule, name_t.name)
+            added_container = true
+            obj = name_t.name.split("::").inject(Object) do |state, item|
+              state.const_get(item)
+            end rescue nil
+
+            type = obj.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 = prev_container.add_class(type, name_t.name, obj.superclass.name)
+            else
+              container = prev_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 = false
       end
 
       # Having now read the method parameters and documentation modifiers, we

In This Thread

Prev Next