Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wanted: A nice clean ruby app to disect

0 views
Skip to first unread message

Curt Hibbs

unread,
Mar 18, 2005, 9:09:36 AM3/18/05
to
We've started a new Ruby Users Group in Saint Louis, Missouri (US). We had our first get together last night over dinner (many thanks to Dave Thomas who also came since he was in town). About 90% of our members are new to Ruby, and we decided that a good way to get started would be to dissect the code of a Ruby app to learn Ruby and its idioms first-hand from *real* code.

There's *lots* of Ruby open source projects and lots of code available for study. But we have to pick something. I'm looking for some Ruby code that is not too complex, but also not trivially simple. Something that is fairly clean and makes good use of Ruby idioms. And, preferable, something that makes good use of unit tests.

What would you recommend?

Curt

PS
I'll thank you in advance for your suggestions as I'll be offline today at a computer conference.

James Edward Gray II

unread,
Mar 18, 2005, 10:05:00 AM3/18/05
to
On Mar 18, 2005, at 8:09 AM, Curt Hibbs wrote:

> We've started a new Ruby Users Group in Saint Louis, Missouri (US). We
> had our first get together last night over dinner (many thanks to Dave
> Thomas who also came since he was in town). About 90% of our members
> are new to Ruby, and we decided that a good way to get started would
> be to dissect the code of a Ruby app to learn Ruby and its idioms
> first-hand from *real* code.
>
> There's *lots* of Ruby open source projects and lots of code available
> for study. But we have to pick something. I'm looking for some Ruby
> code that is not too complex, but also not trivially simple. Something
> that is fairly clean and makes good use of Ruby idioms. And,
> preferable, something that makes good use of unit tests.
>
> What would you recommend?

I sure learn a lot reading the Ruby Quiz submissions every week.

Are they too complex, too simple, clean? Do they have unit tests and
make use of Ruby idioms? Sometimes. In my opinion, that's what makes
them such a valuable tool. You see so many different styles and you
can decide what works and what doesn't. I've adopted some
habits/tricks in my own code that I've seen in solutions.

Are the submissions perfect? No way, but I consider that another
feature. Sometimes I spend a lot of time playing with a certain
solution to figure out how it works. It's a rewarding search that
teaches me a lot. I'll give an example, just because it's fresh in my
mind:

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/122593

Take a look at that submission from the Crosswords quiz. Glance down
at the "main" code in:

if $0 == __FILE__
# ...
end

See if you can find the subtle "bug" in that code. It works, but not
the way the author intended. (Sadly, I found that one after I wrote
that summary.)

Don't stop there. The rest of that solution is quite interesting. I
had to insert a few print statements to fully understand it, when I
went over it. Even better, there's a handful of other great solutions
for that round. Compare and contrast. That way you get to see
everyone's take on just how to use Ruby to accomplish the same task.

Enough of the commercial. I'm clearly biased. I just get a lot out of
the quizzes and hope everyone else finds them to be a valuable resource
as well.

James Edward Gray II

Sascha Ebach

unread,
Mar 18, 2005, 10:31:01 AM3/18/05
to
Curt Hibbs schrieb:

> We've started a new Ruby Users Group in Saint Louis, Missouri (US).
> We had our first get together last night over dinner (many thanks to
> Dave Thomas who also came since he was in town). About 90% of our
> members are new to Ruby, and we decided that a good way to get
> started would be to dissect the code of a Ruby app to learn Ruby and
> its idioms first-hand from *real* code.
>
> There's *lots* of Ruby open source projects and lots of code
> available for study. But we have to pick something. I'm looking for
> some Ruby code that is not too complex, but also not trivially
> simple. Something that is fairly clean and makes good use of Ruby
> idioms. And, preferable, something that makes good use of unit tests.
>
>
> What would you recommend?

Rails?

It has everything you asked for. So now you are going to ask what to
pick from Rails? ;)

Sascha


Curt Hibbs

unread,
Mar 19, 2005, 12:31:49 AM3/19/05
to
Thanks, I'll take a look.

> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005
>


Curt Hibbs

unread,
Mar 19, 2005, 12:35:24 AM3/19/05
to
Sascha Ebach wrote:
>
> Curt Hibbs schrieb:
> > We've started a new Ruby Users Group in Saint Louis, Missouri (US).
> > We had our first get together last night over dinner (many thanks to
> > Dave Thomas who also came since he was in town). About 90% of our
> > members are new to Ruby, and we decided that a good way to get
> > started would be to dissect the code of a Ruby app to learn Ruby and
> > its idioms first-hand from *real* code.
> >
> > There's *lots* of Ruby open source projects and lots of code
> > available for study. But we have to pick something. I'm looking for
> > some Ruby code that is not too complex, but also not trivially
> > simple. Something that is fairly clean and makes good use of Ruby
> > idioms. And, preferable, something that makes good use of unit tests.
> >
> >
> > What would you recommend?
>
> Rails?

Surely you don't mean Rails, itself. That would be way too complex.

> It has everything you asked for. So now you are going to ask what to
> pick from Rails? ;)

Its a possibility, but I was thinking something more along the lines of a
console app. That way we'd be going through mostly pure ruby code without
having to drag in understanding of a larger framework.

Curt

Mike Clark

unread,
Mar 19, 2005, 1:06:57 AM3/19/05
to

On Mar 18, 2005, at 7:09 AM, Curt Hibbs wrote:

> We've started a new Ruby Users Group in Saint Louis, Missouri (US). We
> had our first get together last night over dinner (many thanks to Dave
> Thomas who also came since he was in town). About 90% of our members
> are new to Ruby, and we decided that a good way to get started would
> be to dissect the code of a Ruby app to learn Ruby and its idioms
> first-hand from *real* code.
>
> There's *lots* of Ruby open source projects and lots of code available
> for study. But we have to pick something. I'm looking for some Ruby
> code that is not too complex, but also not trivially simple. Something
> that is fairly clean and makes good use of Ruby idioms. And,
> preferable, something that makes good use of unit tests.
>
> What would you recommend?

Have you looked at RubLog (http://rubyforge.org/projects/rublog)?

Mike

Curt Hibbs

unread,
Mar 19, 2005, 8:35:47 AM3/19/05
to

Thanks, I'll take a look.

Curt


0 new messages