[RDOC] patch for vararg require

J

Jamis Buck

--------------030007020307000708030103
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm doing something funky in my code, where I have a custom #require
method on an object and I delegate a #require call on another object to
the first one. I.e., something like this:

def require( *args )
@object.require( *args )
end

The delegating call kills rdoc with a "Unknown argument type to require:
#<RubyToken::TkMULT:0x403c1c94>".

The attached patch fixes this, causing such constructs to be ignored
with a warning (much like dynamic strings).

- Jamis

--
Jamis Buck
(e-mail address removed)
http://www.jamisbuck.org/jamis

--------------030007020307000708030103
Content-Type: text/x-patch;
name="require_varargs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="require_varargs.patch"

--- parse_rb.rb.original 2004-11-04 07:08:19.430736848 -0700
+++ parse_rb.rb 2004-11-04 07:11:52.964274816 -0700
@@ -2405,6 +2405,10 @@
name = tk.name
when TkDSTRING
warn "Skipping require of dynamic string: #{tk.text}"
+ when TkMULT
+ warn "Skipping require of variable arity"
+ skip_tkspace_comment
+ get_tk
else
error("Unknown argument type to require: #{tk}")
end

--------------030007020307000708030103--
 
D

Dave Thomas

I'm doing something funky in my code, where I have a custom #require
method on an object

The delegating call kills rdoc with a "Unknown argument type to
require: #<RubyToken::TkMULT:0x403c1c94>".

Thanks for the patch. However, I believe that the latest CVS RDoc's
already handle this, issuing a warning for all unknown parameter types.


Cheers

Dave
 
J

Jamis Buck

Dave said:
Thanks for the patch. However, I believe that the latest CVS RDoc's
already handle this, issuing a warning for all unknown parameter types.


Cheers

Dave

Good to know. Thanks, Dave!

- Jamis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Rdoc Hooks ! 1
[ANN] RDoc 3 6
OpenSSL: patch 23
Another Ruby/OpenSSL Patch 2
rdoc bug? 1
Erb rdoc wrong? 1
"postgres" module needs work, author gone, patch included 11
Weekly Python Patch/Bug Summary 2

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top