From: Mauricio Fernandez Date: 2006-09-12T07:43:01+09:00 Subject: Re: Getting argument names and default values: doable (if hackish) On Tue, Sep 12, 2006 at 06:53:26AM +0900, Ezra Zygmuntowicz wrote: > This is super cool stuff. I'm playing with it now using the version > from your site with the patch applied and it spits out all the method > names but just puts ... instead of the arguments. It does this for > anything i give it from the stdlib or my own code. > > ez engine_yard $ method_args.rb benchmark > # > Benchmark#benchmark (...) > Benchmark#bm (...) [...] > > I'm on OSX Tiger latest with my own compiled ruby1.8.4. Does this > require 1.8.5 or am I doing something stupid? The semantics of set_trace_func have changed somewhat in 1.8.5 [1], so it actually requires 1.8.5. I'll try to 'backport' it to 1.8.4 tomorrow. method_args will also print (...) for methods defined in C extensions, but I'll probably change this to at least show the arity. [1] it was actually a bug fix; IIRC the binding passed to the trace_func for a (c-)return event was the caller's instead of that of the method returned from. This is what broke Binding.of_caller/ruby-breakpoint/Rails' breakpointer. call_stack 0.1.0, which I released last week, can overcome that. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby