FAQ for comp.lang.ruby

H

hal9000

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby! (Revised 2004-10-16)

This FAQ contains information for those who want to:

1) learn more about Ruby, and want to
2) post to comp.lang.ruby or to the ruby-lang mail list, or want to
3) provide anonymous feedback to help us improve Ruby.

This FAQ will be posted monthly. If you are reading the text version
via the mailing list or the newsgroup, note that you can find it on
the web at: http://rubyhacker.com/clrFAQ.html

A German version of this FAQ is maintained by Josef "Jupp" Schugt. It can be
found at: http://oss.erdfunkstelle.de/ruby/

Note that this is *not* the Ruby language FAQ! This can be found at:
http://www.rubygarden.org/iowa/faqtotum/

TABLE OF CONTENTS

1 About Ruby
1.1 What is Ruby?
1.2 Where can I find out more about Ruby?
2 About comp.lang.ruby.
2.1 Tell me about comp.lang.ruby.
2.2 Tell me the posting guidelines for comp.lang.ruby.
2.3 Tell me about the prolific Matz poster.
2.4 How do the mailing list and newsgroup interrelate?
2.5 What are these 6-digit message numbers?
2.6 What is "POLS"?
3 Anything else?

1 About Ruby

1.1 What is Ruby?

Ruby is a very high level, fully OO programming language. Indeed,
Ruby is one of the relatively few pure OO languages. Yet despite
its conceptual simplicity, Ruby is still a powerful and practical
"industrial strength" development language.

Ruby selectively integrates many good ideas taken from Perl,
Python, Smalltalk, Eiffel, ADA, CLU, and LISP. Ruby combines
these ideas in a natural, well-coordinated system that embodies
the principles of least effort and least surprise to a
substantially greater extent than most comparable languages --
i.e., you get more bang for your buck, and what you write is more
likely to give you what you expected to get. Ruby is thus a
relatively easy to learn, easy to read, and easy to maintain
language; yet it is very powerful and sophisticated.

In addition to common OO features, Ruby also has threads,
singleton methods, mixins, fully integrated closures and
iterators, plus proper meta-classes. Ruby has a true
mark-and-sweep garbage collector, which makes code more reliable
and simplifies writing extensions. In summary, Ruby provides a
very powerful and very easy to deploy "standing on the shoulders
of giants" OO scaffolding/framework so that you can more quickly
and easily build what you want to build, to do what you want to
do.

You will find many former (and current) Perl, Python, Java, and
C++ users on comp.lang.ruby that can help you get up to speed in
Ruby.

Finally, Ruby is an "open source" development programming
language.

1.2 Where can I find out more about Ruby?

If you're into IRC, check out #ruby-lang on FreeNode. There are also
many web and print resources listed below:


Ruby's home web site:

http://www.ruby-lang.org/en/ (Ruby home page)

Follow the links to documentation, downloads, the Ruby
Application Archive, the Ruby mail list archives, and
lots of other interesting information.

RubyForge (A major repository with hundreds of Ruby projects)

http://rubyforge.org

Ruby-Doc.org (A large source of Ruby documentation)

RubyCentral.COM (Ruby's other major on-line docs and links site):

http://www.rubycentral.com/

RubyCentral.ORG (Home of RubyCentral, Inc.)

http://www.rubycentral.org/

RubyGarden (An important wiki site, very content-rich)

http://rubygarden.org/

Ruby FAQ:

http://www.rubygarden.org/iowa/faqtotum/

Ruby User's Guide (introductory tutorial):

http://www.ruby-lang.org/~slagell/ruby/

_Why's Poignant Guide to Ruby (A Ruby tutorial on acid, featuring
cartoon foxes)

http://poignantguide.net/ruby/


Note: The list of books below is now frozen. I don't
want to maintain this forever. We all hope the number
of Ruby books increases, of course.

English language Ruby books (recent publication order):

Programming Ruby: A Pragmatic Programmers Guide
2nd edition. See below.

Making Use of Ruby
by Suresh Mahadevan
Wiley; ISBN 0-471-21972-X (2002)

Teach Yourself Ruby in 21 Days
by Mark Slagell
Sams; ISBN: 0672322528 (March, 2002)

Ruby Developer's Guide
by Michael Neumann, Robert Feldt, Lyle Johnson
Publishers Group West; ISBN: 1928994644 (February, 2002)

The Ruby Way
by Hal Fulton
Sams; ISBN: 0672320835 (December, 2001)

Ruby In A Nutshell
by Yukihiro Matsumoto
O'Reilly & Associates; ISBN: 0596002149 (November, 2001)

Programming Ruby: A Pragmatic Programmers Guide
by Dave Thomas and Andrew Hunt
Addison Wesley; ISBN: 0201710897 (2000)
(As of Sept 2004, there is a second edition also. It is
not open-sourced at this time.)
Online version: http://www.rubycentral.com/book/
(Note that this is a *legal* first edition.)
Download:
http://www.pragmaticprogrammer.com/downloads/book.html
Errata:
http://www.pragmaticprogrammer.com/ruby/errata/errata.html

German language Ruby books (author alpha order):

Das Einsteigerseminar Ruby. Der methodische und
ausführliche Einstieg.
by Dirk Engel and Klaus Spreckelsen
ISBN: 3826672429

Programmieren mit Ruby
by Armin Roehrl, Stefan Schmiedl, Clemens Wyss, et al.
dpunkt.de; ISBN 3898641511 (February, 2002)
Online: http://www.approximity.com/rubybuch2/node1_main.html

Programmieren mit Ruby. Handbuch für den pragmatischen
Programmierer.
Dave Thomas & Andy Hunt
Addison-Wesley, 2002; ISBN: 382731965X.
A German translation of the "Pickaxe" (Programming Ruby).

Pickaxe translation by Juergen Katins:
http://home.vr-web.de/juergen.katins/ruby/buch/

Search past postings to comp.lang.ruby or the ruby-lang mail list
(which have been mirrored to each other since mid-2000):

http://groups.google.com/groups?q=comp.lang.ruby
http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml

Local Ruby users and groups in your area:

http://www.pragprog.com/ruby?RubyUserGroups

2 About comp.lang.ruby

2.1 Tell me about comp.lang.ruby

comp.lang.ruby was officially approved in early May, 2000.
(Conrad Schneiker, the former maintainer of this FAQ, was
responsible for the "net paperwork" of creating this group.)
Here is the official charter:

CHARTER: comp.lang.ruby

The comp.lang.ruby newsgroup is devoted to discussions of the
Ruby programming language and related issues.

Examples of relevant postings include, but are not limited
to, the following subjects:

- Bug reports
- Announcements of software written with Ruby
- Examples of Ruby code
- Suggestions for Ruby developers
- Requests for help from new Ruby programmers

The newsgroup is not moderated. Binaries are prohibited
(except the small PGP type). Advertising is prohibited (except
for announcements of new Ruby-related products).

END CHARTER.

2.2 Tell me the posting guidelines for comp.lang.ruby.

(You should also follow these guidelines for the ruby-list mail
list, since it is mirrored to comp.lang.ruby.)

(1) ALWAYS be friendly, considerate, tactful, and tasteful. We
want to keep this forum hospitable to the growing ranks of
newbies, very young people, and their teachers, as well as
cater to fire breathing wizards. :)

(2) Keep your content relevant and easy to follow. Try to keep
your content brief and to the point, but also try to include
all relevant information.

(a) The general format guidelines (aka USENET Netiquette) are
matters of common sense and common courtesy that make life
easier for 3rd parties to follow along (in real time or
when perusing archives):

- PLEASE NOTE! Include quoted text from previous posts
*BEFORE* your responses. And *selectively* quote as much
as is relevant.
- Use *plain* text; don't use HTML, RTF, or Word. Most
mail or newsreader programs have an option for this; if
yours doesn't, get a (freeware) program or use a
web-based service that does.
- Include examples from files as *in-line* text; don't
use attachments.

(b) If reporting a problem, give *all* the relevant
information the first time; this isn't the psychic friends
newsgroup. :) When appropriate, include:

- The version of Ruby. ("ruby -v")
- The compiler name and version used to build Ruby.
- The OS type and level. ("uname -a")
- The actual error messages.
- An example (preferably simple) that produces the
problem.

(c) If reporting a bug, please copy (cc:) your post to:

mailto:[email protected]

This will enter your report into the Ruby bug database.
You can browse the database at:

http://www.ruby-lang.org/cgi-bin/ruby-bugs

(3) Make the subject line maximally informative, so that people
who should be interested will read your post and so that people
who wouldn't be interested can easily avoid it.

*Usefully* describe the contents of your post:

This is OK:

"How can I do x with y on z?"
"Problem: did x, expected y, got z."
"BUG: doing x with module y crashed z."

This is *NOT* OK:

"Please help!!!"
"Newbie question"
"Need Ruby guru to tell me what's wrong"

These prefixes have become common for subject lines:

ANN: (for announcements)
BUG: (for bug reports)
OT: (for off-topic, if you must post off-topic)

(4) Finally, be considerate: don't be too lazy. If you are
seeking information, first make a reasonable effort to look it
up. As appropriate, check the Ruby home page, check the Ruby
FAQ and other documentation, use google.com to search past
comp.lang.ruby postings, and so on.

2.3 Tell me about the prolific Matz poster.

Matz (aka Yukihiro Matsumoto) is the wizard who created Ruby for
us, so be nice to him. He is very busy, so be patient when asking
questions. See the Ruby home page to find out more about him and
his work. I (Conrad Schneiker) founded comp.lang.ruby at his
suggestion. Contrary to lots of skepticism, it was approved on
the first attempt, with 200 yes votes.

2.4 How do the mailing list and newsgroup interrelate?

The mailing list is older. When the newsgroup was created, they
diverged. In mid-2001, Dave Thomas created a two-way gateway
that would "mirror" the newsgroup to the list and vice versa.
(This was accomplished in 200 lines of Ruby code.) It is not
perfect; because of variability in the news feed, sometimes
messages are dropped or duplicated.

The online archive of the mailing list therefore includes most
of the traffic on the newsgroup, excluding the posts that were
made before the creation of the gateway.

Note: Spam or other inappropriate messages are NOT the
responsibility of Dave Thomas, who maintains the gateway. He
does everything in his power to deal with this issue. Do NOT
report spam to his ISP merely because the messages come from
his server.

2.5 What are these 6-digit message numbers?

Historically, every item on the mailing list had a subject
starting with a string like: [ruby-talk:99999]

The message numbers were convenient since they were strictly
serial and formed a good way to refer to a past message. But
they interfered with threading; Matz removed them after the
matter was put to a vote in early 2002.

The news header still refers to this number, should anyone
wish to retrieve it. On the mailing list this number can
now be found in the X-Mail-Count: header.

You can point to a specific message by appending it onto the
ruby-talk.com URL; i.e. http://ruby-talk.com/12345 will refer
to message 12345.

2.6 What is "POLS"?

POLS is an abbreviation for "Principle of Least Surprise" (also
called the Law of Least Astonishment).

This term certainly did not originate in the Ruby community, but
it has been frequently used there -- even overused or abused at
times. After all, *every* language or software system seeks at
some level to adhere to this principle. Is any system designed
to be unintuitive?

It is inappropriate to invoke POLS as a "magic word" when one's
individual expectations are not met. Ruby continues to evolve,
and Matz often makes changes based on people wishes, needs, or
suggestions. But he cannot be bribed or threatened. Make
suggestions if you wish, but think twice before mentioning POLS.


3. Anything else?

If you are new to Ruby (or haven't previously taken the Ruby User
Survey), please take a moment to anonymously tell us about your
programming background and about your Ruby-related interests. The
results will be reported back to the Ruby community from time to
time. This helps us do a better job of helping each other, and to
more effectively expand the Ruby community for our mutual benefit.
The survey is at:

http://dev.rubycentral.com/survey.html

This FAQ was originally produced by Conrad Schneiker.
It is now maintained by Hal Fulton ([email protected]).
I'm interested in corrections and suggestions, but remember that
the purpose of this FAQ is to be a brief and simple introduction
for new comp.lang.ruby readers.

In closing, one of the reasons that Ruby was designed to be
relatively simple, uniform, yet very powerful was to make serious
programming (among other kinds) fun. We hope you will help us
keep comp.lang.ruby fun as well. Enjoy. :)
 
H

Hal Fulton

vruz said:
hello Hal,

Ryan Davis and I updated this:

http://rubygarden.org/ruby?RubyOnIRC

Maybe it's useful to add it into the FAQ, since there's a number of
other popular IRC channels now.

Thanks, vruz.

In addition, I see I have again failed to make a couple of other
changes in the FAQ. (Sorry, Matz.)

I'll bump it higher on my to-do list.
PS: How do you feel now NASA and ESA are drafting plans to visit Europa ?

I have the utmost confidence in this mission. ;)


Hal
 
V

vruz

[snip]
In addition, I see I have again failed to make a couple of other
changes in the FAQ. (Sorry, Matz.)
I'll bump it higher on my to-do list.

Another recurring question I've (all of us) have noticed on the ML is
people trying to decide which GUI toolkits are available or which to
use for a given task.

Whilst this is most of the time matter of personal choice based on
previous programming experience, platform of choice or aesthetic
preference, I think we could at least hint people in some of the
available directions.

I would gladly collaborate to compose such general guidelines to get
started with.
I have the utmost confidence in this mission. ;)

Attempt no landings there

cheers,
vruz
 
H

Hal Fulton

vruz said:
Another recurring question I've (all of us) have noticed on the ML is
people trying to decide which GUI toolkits are available or which to
use for a given task.

Whilst this is most of the time matter of personal choice based on
previous programming experience, platform of choice or aesthetic
preference, I think we could at least hint people in some of the
available directions.

I would gladly collaborate to compose such general guidelines to get
started with.

I like that idea. But it's beyond the scope of the
newsgroup FAQ (which perhaps already has too much
in there not related to the newsgroup).

This would be a good Ruby FAQ or even an article.
A matrix comparing their features would be good, too.


Hal
 
B

Ben Giddings

Another recurring question I've (all of us) have noticed on the ML is
people trying to decide which GUI toolkits are available or which to
use for a given task.

Good call, that is asked a whole lot.
Whilst this is most of the time matter of personal choice based on
previous programming experience, platform of choice or aesthetic
preference, I think we could at least hint people in some of the
available directions.

I would gladly collaborate to compose such general guidelines to get
started with.

Whether it ends up in the FAQ or not, I think that would be an amazing
service to the Ruby-using community. I don't know how you planned to
approach it, but one method might be to have the code speak for itself:
create a simple sample app using the various toolkits, show the code
and give a screenshot of the result. (people love screenshots)

Anything you come up with would be great though. Thanks for proposing
this.

Ben
 
V

vruz

[snip my stuff]
Whether it ends up in the FAQ or not, I think that would be an amazing
service to the Ruby-using community. I don't know how you planned to
approach it, but one method might be to have the code speak for itself:
create a simple sample app using the various toolkits, show the code
and give a screenshot of the result. (people love screenshots)
Anything you come up with would be great though. Thanks for proposing
this.

There is a number of great GUI toolkits, I'd say scarcity is
fortunately not the case when it comes to creating GUIs in Ruby.

Unfortunately, the wide range of options seems to be a recurring
problem when you face the task of getting started anew with your first
GUI-based application in Ruby.

There are some good tutorials or sets of code examples out there
covering the most popular GUI toolkits in Rubyland, written by
knowledgeable developers who are the individuals that know every
corner, every limitation, and every trick of their métier.

Some of them are the ones for Ruby TK, FXRuby, ruby-gnome2, QT/Ruby,
SWin/VuRuby, Ruby/Cocoa, WxRuby, FLTK, RubyWise, ParaGUI, Widestudio,
Apollo, and perhaps many others (please let us know which others have
active Ruby users reading this maillist)

Hal Fulton and I once toyed with the idea of writing a book on Ruby
GUIs, and I believe that's not a bad idea at all judging from the
evident need in that field, yet probably not as popular as to generate
revenue for publishers.

Given the complexity and ambitiousness of a project covering all these
toolkits, I think a different approach is due.

I like the way PLEAC was created, (Programming Language Examples Alike
Cookbook) and I think the approach the PLEAC guys followed could work
very well in this case.
I'm thinking sort of a PLEAC for Ruby GUIs.

That would be something like "PGEAR": Programming GUI Examples Alike in Ruby

In my idea, a PGEAR team would create a basic list of placeholders for
GUI programming examples.

A reference implementation should be provided for at least two Ruby
GUI toolkits. so that other knowledgeable developers who use other
toolkits are able to reproduce the a functionally equivalent example
for their own toolkits.

Example:
1) Hello World window with a button
1.1) implementation in Gtk2, QT, Fox, TK, Wx, etc.
1.2) screenshots

Still, a set of code examples may not be enough for complex tasks.
I would divide the PGEAR in sections, by order of complexity.

A) Brief description of each toolkit, pros and cons, in which
platforms they work, whether they are internationalisable, where to
get them, how to install them

B) Simple widget examples ( à la Hello World, Window creation, basic
event management, basic widget set demonstration, this is the
PLEAC-like section)

C) Compound widget examples ( tabbed panes, treeviews, grids/tables,
here most GUI toolkits differ in their approach)

D) Mixing it all, Practical guide (create a
Konqueror/Finder/Explorer/Nautilus-like user interface, create an
Outlook/Thunderbird/Evolution-like user interface, etc.)

E) Other (features that are unique to a given toolkit)

F) Troubleshooting, etc. (problems commonly found, multihreading
issues, event handling, custom widget development, etc.)

Lately, I like the way manuals end up laid out using Hieraki,
especially the ones in Jamis Buck's Bookshelf... that would be the
editing model I would follow, but then that's just my personal taste,
others may differ.

Please note, that there have been attempts before to document GUI
toolkits in the Rubysphere, to various degrees of success and
accuracy:

http://freeride.rubyforge.org/wiki/wiki.pl?GUIFrameworkProject/GUIComparison
http://rubygarden.org/ruby?WhichGuiShouldIUse
http://rubygarden.org/ruby?ComparingGuiToolkits
http://rubygarden.org/ruby?DoYourRubyGUIResearch
http://trug.stok.co.uk/wiki/index.php?title=Ruby_GUI_Toolkits
http://rubygarden.org/ruby?ComparingGuiToolkits/TakeTwo
http://rubygarden.org/ruby?GeneralGUIComments

Maybe, given enough time and if there's enough support, a
comprehensive index/howto/cookbook can be compiled.

As there is loads and loads of work to be done, I propose people who
are interested AND ARE willing to COLLABORATE to please sign this
wikipage:

http://rubygarden.org/ruby?RubyGUI

cheers,
vruz
 
M

Martin DeMello

Hal Fulton said:
I like that idea. But it's beyond the scope of the
newsgroup FAQ (which perhaps already has too much
in there not related to the newsgroup).

Perhaps simply have pointers to rubygarden pages? You could do this for
the books list too (which IMO is better deleted than frozen).

martin
 
D

Dave Burt

Hal Fulton said:
I like that idea. But it's beyond the scope of the
newsgroup FAQ (which perhaps already has too much
in there not related to the newsgroup).

Let me humbly submit that, as it's possibly as popular a theme as any given
language dogfight on the newsgroup, it's worth putting at least a pointer
into the FAQ. It is a permathread (a very frequently asked question), so it
deserves a place in the newsgroup FAQ.

Cheers,
Dave
 
J

Josef 'Jupp' Schugt

vruz said:
Attempt no landings there

I could understand that someone says 'do not terraform Europa' if there
is life on this moon. But why should one not *land* this moon? Is Europa
a holy site of some religion?

Josef 'Jupp' Schugt
 
J

Joel VanderWerf

Josef said:
I could understand that someone says 'do not terraform Europa' if there
is life on this moon. But why should one not *land* this moon? Is Europa
a holy site of some religion?

It will be if we find an obelisk there.
 
J

Josef 'Jupp' Schugt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joel VanderWerf wrote:
| Josef 'Jupp' Schugt wrote:
|> Is Europa a holy site of some religion?
| It will be if we find an obelisk there.

I knew it was a mistake to run this matrix on a HAL 9000.

Josef 'Jupp' Schugt
- --
Dear President George Walker Bush,
the way in which it is tried to install a software patent directive
clearly shows that the EU not democratic. We urgently need brothers in
arms who help us establish democratic structures.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCPK8Krhv7B2zGV08RAls5AKClCIhbSmEZrtGtqAg6vKEs7r/QrQCg62Ho
2WYQGcqPy6ywLeMMcLc9hbs=
=FPpp
-----END PGP SIGNATURE-----
 
H

Hidetoshi NAGAI

From: vruz <[email protected]>
Subject: Ruby GUI FAQ , was Re: FAQ for comp.lang.ruby
Date: Wed, 16 Mar 2005 15:05:01 +0900
Message-ID: said:
That would be something like "PGEAR": Programming GUI Examples Alike in Ruby

There is a set of a document and scripts which were used in my
"Ruby/Tk seminar". The document was written based on ruby-1.8.2.
Maybe, it is a precious document about the recent Ruby/Tk,
because there were large changes between ruby-1.8.1 and 1.8.2
(compatibility was kept).

Unfortunately, the document is written in Japanese and some of
the example scripts include Japanese characters.
However, I think, almost all of the scripts are still useful
for people who cannot read Japanses.

If you are interested in them, you can get them from
http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk-seminar-20041211.tar.gz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top