hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Tuesday

2006.02.14

Ideas for Ruby 2 Manners #

by why in inspect

If I could clean up the little quacks that Ruby gives here and there.

Object.inspect

Currently:

 => #<Object:0xb7cd5ed0>
 => #<Book:0xb7cc4d00 @title="Gorbachev's Finger Tricks",
    @author="Gorbachev", @length=150>
 => #<File:ruby.h>

Slight polish:

 => (Object)
 => (Book @title="Gorbachev's Finger Tricks" 
    @author="Gorbachev" @length=150)
 => (File ruby.h)

Proc.inspect

Currently:

 => #<Proc:0xb7d19aa0@(irb):4>

Show arity?

 => (Proc |a,*b|)

Backtraces and Warnings

Currently:

 bin/tiny_wm.rb:4: parse error, unexpected '='
 $d = = X11::Display.new
       ^

 bin/tiny_wm.rb:2:in `require': no such file to load -- X11/Display (LoadError)
        from bin/tiny_wm.rb:2

 ArgumentError: wrong number of arguments (3 for 1)
        from (irb):1:in `gets'
        from (irb):1

 /home/why/bin/warn.rb:2: warning: parenthesize argument(s) for future version

Slight polish:

 ParseError in bin/tiny_wm.rb (line 4): 
   unexpected '='
   > $d = = X11::Display.new
   >       ^

 LoadError in bin/tiny_wm.rb (line 2) at `require':
   no such file to load -- X11/Display
        from bin/tiny_wm.rb (line 2)

 ArgumentError in irb (line 1) at `gets': 
   wrong number of arguments (3 for 1)
        from irb (line 1)

 Warning in /home/why/bin/warn.rb (line 2):
   parenthesize argument(s) for future version

We should avoid wrapping the `message’ inside the initial line of a backtrace. It is often the most crucial part.

It sure would be nice to have the ability to customize the look of your backtraces. To have backtrace objects like in Sydney. I’d like to brightly ANSI highlight the backtrace line which refers to $PROGRAM_NAME, give a dark color to trace lines from the stdlib and medium highlight everything else.

I’m sure all of you out there can give help here. But you know what I mean about some of these?

Another 150 RailsConf Seats #

by why in cult

Maybe these will be gone by the time I actually finish this message, but a new wing has been added to ChooChooConf. Do not delay—here’s the registration page.

YARV Merged Matz #

by why in cult

(Koichi Sasada has requested I print the following. He is the scribe.)

In an article entitled RubySpaMeeting2006, daigo wrote that “YARV will merge Ruby 1.9 on Valentine’s Day.” In fact, at that time, YARV will only merge into a CVS branch, not to 1.9 HEAD (matz’ plan).

However, the result is YARV merged matz! matz has an acount for the YARV subversion repository. This is because YARV has some problem with CVS. Most of it is filenames. There are some “yarv…” files. YARV is only a code name and it should vanish with the Ruby 2.0 release. So, I and matz and other YARV developers will rename the files and the API calls (which has same problem: vanish yarv_… API) and so on.

I hope that Ruby development VCS will be Subversion when YARV is finally merged.

YARV (on subversion repository) works fine (... but there are some errors on make test, test-all). Please check your Ruby applications on YARV. Bug reports are very welcome.