From: Ezra Zygmuntowicz Date: 2006-09-12T13:26:23+09:00 Subject: Re: Getting argument names and default values: doable (if hackish) On Sep 11, 2006, at 4:07 PM, Mauricio Fernandez wrote: > On Tue, Sep 12, 2006 at 06:53:26AM +0900, Ezra Zygmuntowicz wrote: >> >> 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? > > Alright, it took only 1 line to make it work on both 1.8.5 and > previous > versions: > > $ ruby183 -v method_args-pre185.rb benchmark > ruby 1.8.3 (2005-09-21) [i686-linux] > Benchmark#benchmark (caption = "", label_width = nil, fmtstr = nil, > *labels) > Benchmark#bm (label_width = 0, *labels) > Benchmark#bmbm (width = 0) > Benchmark#measure (label = "") > [...] > > I've updated the code on eigenclass.org; could you give it a try? > (btw. no need to apply the patch in the comments, I had already > done so) > > -- > Mauricio Fernandez - http://eigenclass.org - singular Ruby > Sweet! It works great now. Thanks Mauricio. ez romper_room # ruby -v ruby 1.8.4 (2005-12-24) [i686-darwin8.5.1] ez romper_room # method_args.rb benchmark # Benchmark#benchmark (caption = "", label_width = nil, fmtstr = nil, *labels) Benchmark#bm (label_width = 0, *labels) Benchmark#bmbm (width = 0) Benchmark#measure (label = "") Benchmark#realtime () Benchmark::Job#initialize (width) Benchmark::Job#item (label = "") Benchmark::Job#report (label = "") Cheers- -Ezra