[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Wanted: A nice clean ruby app to disect

Curt Hibbs

3/18/2005 2:10:00 PM

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.



6 Answers

James Gray

3/18/2005 3:05:00 PM

0

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-t...

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

3/18/2005 3:31:00 PM

0

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

3/19/2005 5:32:00 AM

0

Thanks, I'll take a look.

James Edward Gray II wrote:
>
> 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-t...
>
> 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
>
>
>
> --
> 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

3/19/2005 5:35:00 AM

0

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

3/19/2005 6:07:00 AM

0


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/proje...)?

Mike



Curt Hibbs

3/19/2005 1:36:00 PM

0

Mike Clark wrote:
>
> 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/proje...)?

Thanks, I'll take a look.

Curt