13th - 19th March 2006

Ruby Weekly News is a summary of the week’s activity on the ruby-talk mailing list / the comp.lang.ruby newsgroup / Ruby forum, brought to you by Tim Sutherland.

Articles and Announcements

  • Best of Ruby Quiz now available
  • “Quizmeister James Edward Gray II selected the best 25 Ruby Quizzes from last year, then carefully collected answers and annotated them. The result is “The Best of Ruby Quiz”, a wonderful book which will teach any Ruby programmer new techniques and approaches to coding.”

    Dave Thomas: “(oh, and I happen to think it’s one of our nicer looking covers, too…)”

  • Ruby Hacking Guide Translation
  • Vincent Isambart said he’d finished translating the second chapter of Minero AOKI’s “Ruby Hacking Guide” into English.

    “This book explains the internals of the ruby interpreter. And even if you do not care about how the interpreter works, I think it can help have a better understanding of Ruby and how to make extension libraries.”

    The news was well received.

  • Next Beta of Rails Recipes available
  • “The fourth beta of Rails Recipes, Chad Fowler’s book or writing real- world Rails, is now available”, announced Dave Thomas.

    “The book now features contributions from three members of the Rails Core Team, and includes countless suggestions for existing readers. This is definitely the book to have on using Rails in the real world.”

  • RubyCorner a meeting place for the Ruby blogging community
  • AnĂ­bal Rojas announced RubyCorner, a directory of Ruby blogs.

    Lyle Johnson pointed out two sites that fill the same role; Artima’s Ruby Buzz and Planet Ruby.

Threads

What's the best way to split this kind of string?

Sam Kong asked how to split a string into sequences of repeated characters (in particular, where the characters are digits), e.g.

"111223133" => ["111", "22", "3", "1", "33"]

Ross Bamford gave two ways of doing it:

s.scan(/0+|1+|2+|3+|4+|5+|6+|7+|8+|9+/)
s.scan(/(\d)(\1*)/).map! { |e| e.join }

obscure ruby bug tracker

Chris describes his long journey trying to find the Ruby bug tracker on rubyforge.

“Maybe a little effort in making the bug tracker a bit easier to find is in order…”

Small optimization tips

Vincent Foley shared a couple of changes that improved performance in his script, including using Set instead of Array when you are only using << and include?.

Set#include? usually takes constant time (having a Hash underneath), while Array#include? is linear in the number of elements in the array.

Constraint Processing (#70)

Jay Anderson created this week’s Ruby Quiz.

“For this quiz the goal is to make a constraint processing library for ruby. A Constraint Satisfaction Problem consists of variables, domains for each variable, and constraints among the variables.”

Python looking better ...

Python got a new homepage, which led to questions about the ruby-lang.org redesign effort which has been quiet since last year.

Curt Hibbs: “I can assure you that it is still progressing. It has been slow progress, but much faster in recent months (thanks to John Long). Hopefully a few more months and it’ll be all finished.”

Why's Poignant Guide site down?

Mark Volkmann was having trouble accessing Why’s Poignant Guide to Ruby.

Mental said there’s been a general problem with Why’s server, which has unfortunately happened while he’s at the SXSW music festival. Fortunately it’s all back up now.

New Releases

Third Drop of RubyCLR

John Lam set out the third release of his RubyCLR bridge.

“There is now a pretty cool Avalon (Windows Presentation Foundation) sample in this release. It renders math equations from a quick and dirty Ruby DSL that I hacked up yesterday. I think it really shows off some of the cool things you can do when you have a powerful client-side rendering engine.”

“I did a lot of perf tuning in this release, so dynamic compilation time of the interop shims should be much faster. Runtime performance is pretty good – I can parse a 7.5MB XML doc using XmlTextReader (a pull-mode XML parser) which results in over a million calls across the interop boundary in about 2s.”

Nabaztag 0.1

Paul Battley:

I’m pleased to announce the public release of our Nabaztag communication library for Ruby.

The Nabaztag (http://www.nabaztag.com/) is a small electronic rabbit with lights, motorised ears, and speech.

The library enables control of the text-to-speech, ear movement, and choreography features of a Nabaztag device. It implements a small DSL for choreography commands.

Paul.

PS - Yes, we actually use this at work!
It performs a couple of announcement functions. First, it reports the success or failure of builds on the continuous integration machine. Second, it announces every time our review aggregation service receives a ping. It’s nothing that couldn’t be handled by a computer playing a few samples (or using OS X’s text-to-speech), but it’s more interesting this way!

rcov 0.2.0 - code coverage tool for Ruby

Mauricio Fernandez posted rcov 0.2.0, a Ruby code coverage tool thats 20-300 times faster than the ‘coverage’ tool.

“typically, the program being inspect runs only ~3 times slower than without rcov (i.e. not 200 times slower as with some other tools)”.

It also features “more accurate coverage information through code linkage inference using simple heuristics”.

This release has prettier output, and a more convenient interface.