Ruby Weekly News 14th - 20th March 2005



Note: I may have accidently posted this twice - my usenet connection is
playing up. Please send any feedback to (e-mail address removed) rather than
the gmail address this post is sent from.

Ruby Weekly News 14th - 20th March 2005

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

Articles and Announcements

* RubyGems Documentation Site

Jim Weirich announced the RubyGems Documentation Site, replacing
previous Wiki-based documentation. It now uses the Hieraki
(which is also used for the official Ruby on Rails

* 2005 International Obfuscated Ruby Code Contest

Todd Nathan announced the "final stretch" of the 2005
Obfuscated Ruby Code Contest (IORCC). "In addition to a covented
of claiming you are most obscure Ruby coder for 12 months time,
also have a shot at over 750 USD worth of prizes", from a number

The deadline for submissions is midnight on March 31, 2005.
(It's not
clear what timezone.)

Quote of the Week

Paul Duncan enthusiastically announced Raggle.

"After a more than a year of near-death rescue missions,
high-speed car
chases, and hair-splitting battles with evil masterminds, the
Raggle Task Force (Codename: R4) has emerged once again to release
Raggle 0.4.0, the most powerful Ruby-based console RSS aggregator
humanity has ever seen!"


Interesting threads this week included:

nonblock extension for win32?

We covered this thread last week, but there were some significant
additions this time around. Bill Kelly asked if it was likely that
some of
the libraries in Win32 Utils would become part of standard Ruby.
Berger replied "No. At best some of the Win32 Utils packages might
included with the one-click Installer."

Curt Hibbs responded positively, saying "I would really like to
some/many/all of the win32 utils in the one-click installer. But I
am way
over extended. I'll get to it eventually, but if someone wants to
help out
it would speed things up."

Later on, Shashank Date announced a One-click installer for
that makes it much easier to install the win32utils packages.

Advice on PDF::Writer

Austin Ziegler is "in the middle of a major overhaul to
including many API changes. He's almost ready to make a release, but
API for tables is still being worked on. Should he release now, and
make another API-incompatible change later, or wait?

Several people thought he should release it now. vruz:

"Having the thing out will help to improve things faster and
Austin from the pressure of packing everything in a short period

Another good reason for releasing now is not all generated
will make use of tables."

One Click Installer

DaZoner asked if there would be a new release of the Ruby One-Click
Windows Installer beyond 1.8.2-14 anytime soon?

Wolfgang Nádasi-Donner said he'd had problems with using irb with a
keyboard in the latest release. Stephan Kämper posted a link to the

Curt Hibbs attempted to reply, but didn't actually write anything.
we'll find out his answer next week!

Ruby UTF-8

Peter C was writing a Ruby program which included Japanese strings
(encoded in UTF-8).

He was getting errors like

c:\> ruby -Ku myFile.rb
jpn.rb:1: undefined method `' for main:Object

The file was created in Windows notepad.

Wolfgang Nádasi-Donner explained that notepad writes a "Byte Order
(BOM) at the beginning of UTF-8 encoded files.

Florian Gross suggested a workaround:

"Another one is to have an assignment to a scratch variable at the
beginning of the script. Ruby will parse the BOM as the part of
variable name and thus not complain about it."

Florian had posted a comment about this issue on ruby-core some
months ago
and thought Ruby should be able to accept files with a BOM.

Naming tips for popen4-style library?

Jonathan Paisley wrote a new popen library featuring an OO
independent access to stdin, stdout, stderr, plus the ability to
signals to a child process and get its exit status. It is also

He has initially called it Popen4 (the name of the Python library it
modelled after), but is looking for a better name. (He later

Daniel Berger recalled an Open4 class written by Ara Howard a year
This returned the pid of the child process as well as the streams.
win32-open3 package has an Open4 module that uses the same API as

Daniel felt that the Ruby community should try to reach consensus on
API for this feature.

Jonathan had previously discussed this issue with Ara and agreed
that it
would be good to decide on an API and behaviour.

Opening for an entry level position in SLC Utah

A job to develop a Ruby on Rails application was posted. Jeremy
said that people looking for Rails work should list themselves on
AvailableForHire page on the Rails wiki.

There is also a job postings page.

async http request

Bob Aman was writing a Rails application (a common theme these
days). He
has a page which needs to query a web service, retrieve some RSS
feeds and
do SQL queries. Currently he was executing these one after the
after. How
could he do them all at the same time?

James Britt said he should use threads.

Codefest Grant - RubyGems cleanup and enhancement

Continuing this thread from last week, Mauricio Fernández responded
to a
question about the status of RPA (Ruby Production Archive).

"The port/package manager (rpa-base) and the incipient
(repository, VCS, wiki) are unsatisfactory under our (admittedly
criteria. They will undergo major restructuring. Had they been
adequate, RPA would have been proposed for widespread public
long ago, but it was in a testing phase for a reason."

As far as the idea of combining RubyGems and RPA, Mauricio argued
they have fundamentally different goals. For example, RPA aims to
with existing tools (like rpm, FreeBSD ports etc.) and provide
created by a dedicated team. In comparison, RubyGems is intended to
used instead of rpm etc. and packages are usually created by whoever
developed the application or library.

Mauricio also said he would appreciate it if RubyGems developers
describe their goals in a similar way to the RPA Manifesto.

Chad Fowler said he did not want RubyGems to have a manifesto, but
his take on the purposes of RubyGems:

"1. A package format for Ruby libraries and applications.
2. A system for managing installation of such packages from both
and remote sources.
3. A "master source"/repository for such packages.
4. Intended to be Ruby's standard for package creation and

Austin Ziegler disagreed with Mauricio's comments, saying

"Nothing about RubyGems *prevents* any of the above. Nothing. The
can be translated into "native" tools, and the RPA-base layer
could be
implemented on top of RubyGems as a platform (e.g., making the
sitelibdir and DATADIR support work), and since Matz seems to have
indicated that RubyGems will become part of the core when it's
then it will work transparently."

There was some push-back on that last part - Matz had previously
said he
wanted the RubyGems and RPA teams to agree on a common system. Matz

"I just don't want to discourage one side by merging another. If
RPA camp
say "OK, we go our way, nevertheless Gems merged in the
that's fine for me. Did they?"

There was no answer at the time this edition "went to press".

Robby Russell created the site to get his feet
with Rails. It takes a long URL and returns a link like that forwards you to the real site.

There was some discussion of the approach taken. Thomas Hurst
pointed out, a Ruby-based link-forwarding server he'd written.

Hal Fulton asked

"Had you considered a scheme in which the original domain name is
part of
the shortened URL?
That way we could at least confirm what domain we were directed

eval/binding question

Stefan Kaes discovered that

def test1
eval "x=25"
eval 'print "x=#{x}\n"'


def test2
eval "x=25"
print "x=#{x}\n"



test.rb:189:in `test2': undefined local variable or method `x' for
main:Object ( NameError)
from test.rb:192

So test1 finds the variable, but test2 doesn't.

Matz explained

"local variables should be determined at compile time, thus local
variables defined first in the eval'ed string, can only be
accessed from
other eval'ed strings. In addition, they will be more ephemeral in
Ruby2, so that these variables will not be accessed from outside.

In summary, I recommend you not to use local variables for your
They are wrong tool for it."

Stefan felt that it would be better to allow the variables to be
from outside, and Matz responded

"But it's not good strategy to persuade me to use "your
expectation" or
"your surprise". This "limitation" has a lot of good aspects, such
better performance, better error detection, etc. I'd love to pay
cost of small restriction for these benefits as a language

Stable sort?

Hal Fulton wanted a "stable" sort algorithm, i.e. one where if two
elements are judged to be equal in the ordering (where <=> returns
0) they
end up in the same order relative to one another in the output as
were in the input.

Ruby's Enumerable#sort uses the Quicksort algorithm, which is not

Matz thought that the following would be a slightly inefficient
but not too bad:

n = 0
ary.sort_by {|x| n+= 1; [x, n]}

MS Windows automation - howto use it?

Axel wanted to automate an application using the WIN32OLE library.
How to
you get from the following code to something that works for a
application? What should the argument to be, and how do
find out what methods are available on the resulting object?

ie ='InternetExplorer.Application')
ie.visible = true

Thomas pointed out the #ole_methods method. This tells you what
the underlying COM interface supports, but not what arguments they
Adelle Hartley pointed to an OLE Object Browser written in Ruby that
provides more information.

Dave Burt decided to write his own OLE browser.

Ruby mentions at Microsofts Competitive Influentials Summit

Gordon Hartley noticed some references to Ruby in a blog.

`Richard Monson-Haefel asks "Is there a place for AOP in .NET or
is it
too sophisticated for your developers." Don's take is "My
platform should allow me to write code w/ a couple of beers in
me." He
ragged a bit on Java developers and said their main problem is
think they're smarter than they are. He also said that if he could
change one thing at MSFT, it would be that Ruby becomes the
language of

Examples for racc?

Ben Giddings wanted some examples of code that use the Racc parser.

Charles Comstock suggested looking in the sample or test directories
the Racc source tarball, and Luke Graham mentioned LittleLexer as an
alternative parser.

Using C++ libraries in Ruby

T E wanted to know if it was possible to use C++ libraries from

Nikolai Weibull referred to the ruby embedded into c++ page by Simon
Strandgaard. It shows how to access C++ classes from Ruby, as well
as Ruby
classes from C++.

Ruby works well with C, so an alternative is to simply access the
via a C interface.

Texas Hold'Em

Matthew D Moss came up with this week's Ruby Quiz,

Interpret sets of hands in the "Texas Hold'Em" card game (a
variation of
Poker), to report "Full House", "Two Pair", "Flush" etc.

There was some fun discussion about poker.

Wanted: A nice clean ruby app to disect

Curt Hibbs was part of a new Ruby User's Group in Saint Louis,
Missouri in
the U.S. "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
learn Ruby and its idioms first-hand from *real* code."

What applications would the community recommend?

James Edward Gray II suggested the Ruby Quiz solutions. Mike Clark
RubLog would be worth looking at.

Paul Graham recommends Ruby

Joe Van Dyk read an article by Paul Graham on his recommendations
undergraduate computer science students and noticed that it

If you want to work at a cool little company or research lab,
you'll do
better to learn Ruby on Linux.

how do you duck-type something to String, so String believes you?

Sam Roberts had implemented a class which defined #to_str (which
that the class should be considered a String, as opposed to merely
defining #to_s). "That's all fine, but that doesn't mean that String
allow itself to be compared to my class." (Via String#==.)

Navindra Umanee warned that

"String is also strongly-typed in C as T_STRING, so Ruby
duck-typing is
not going to save you here. Ruby is riddled with that sort of
probably for efficiency and implementation reasons."

ES said that the String#== method turns str==other into other==str
other is not T_STRING. This means that Sam simply needs to define an
method in his class that compares against a String.

New Releases

* PageTemplate 1.2.0

Brian Wisti improved PageTemplate, a library for using text
in web projects. Additions include comment syntax and unless.

* Alexandria 0.5.0

Laurent Sansonetti released Alexandria 0.5.0. It is a GNOME
application for managing book collections. Export-to-XHTML
support has
been added, as has support for loaning, books without ISBN
and many bug fixes.

* FastCST 3.0, FastCST 0.4: SMTP+POP3 Distribution, FastCST 0.4
Packaging Fix

Zed A. Shaw put up another release of FastCST, an experimental
changeset tool. Version 0.3 added YAML meta-data support for
changesets, plus get and put commands. Version 0.4 added send,
and read commands to integrate the tool with email.

A tutorial was also written.

* Orbjson 0.0.4 released

James Britt added support for asynchronous requests to Ruby
This library provides Ruby-Javascript integration for JSON-RPC
requests, making it easier to write web applications which use
Ruby on
the server and Javascript on the client. He later announced a
he'd written for the library.

* MuraveyWeb-Ruby CMS

Dmitry V. Sabanin announced the first public release of
MuraveyWeb, a
CMS built with Ruby on Rails. It features separation of content
views. "With MW you can create and manage your content and then
MW API and Ruby On Rails you can build views to display it the
way you

* RubyGems 0.8.7, RubyGems 0.8.8

Jim Weirich announced RubyGems 0.8.7, a popular tool for
packaging and
installing Ruby programs and libraries. This was quickly
followed by
RubyGems 0.8.8 to fix an important bug for developers who create

"First the numbers, 220 different gems available, over 25,000
downloads of RubyGems, and nearly 190,000 gems downloads."

New features include a cleanup command to delete old versions of
a gem
and dependency to show dependencies. A library called
gemconfigure has
been written to allow a Ruby program to be version sensitive
depending on RubyGems where that capability is not needed.
addition is gemwhich, a program to help users to locate
RubyGems-managed files.

* Ruby/LDAP 0.9.1: LDAP API (RFC1823) library

Ian Macdonald recently took over maintenance of Ruby/LDAP from
Tateishi. The latest release includes some API tweaks.
Connections can
now be rebound with new credentials and an LDIF module has been

* RbTET a Ruby TET API binding

Neil Moses announced the first release of a Ruby binding to TET
Environment Toolkit).

* webgen 0.3.1

Thomas Leitner released a new version of webgen, a tool for
web pages from page description and template files. Major
include improved picture gallery support, automatic validation
files and configurable page file output names.

* Nitro + Og 0.13.0

George Moschovitis improved Nitro (a web application framework)
and Og
(an object-relational mapper). Nitro now has a Mailer subsystem,
AJAX example (which shows how to develop a Google Suggest-style
and a Rails compatible directory structure. Og is better
from Nitro, has database-related validations and many bugfixes.

* Pimki 1.6

Assaph Mehr released Pimki 1.6, a PIM based on the Instiki Wiki.

* Ruby/ZOOM 0.1.0

Laurent Sansonetti was "happy to announce the first release of

"Ruby/ZOOM provides a Ruby binding to the Z39.50
Model (ZOOM), an abstract object-oriented programming interface
to a
subset of the services specified by the Z39.50 standard, also
known as
the international standard ISO 23950." (Used mainly for book
information retrieval.) It will be integrated into the next
release of
the Alexandria book collection manager.

* One-click installer for win32utils

On behalf of the win32utils team, Shashank Date announced
0.0.3 of the "one-click installer for win32utils".

"This installer will install win32utils modules which are
with the latest one-click installer for Ruby on the Windows

* Kashmir/Elusion 0.2

Christian Neukirchen set out the first public release of
Kashmir/Elusion, a templating engine that "tries to walk on the
path between the mess of raw evaluated Ruby like ERB and the
sterileness of data-driven templating like Amrita."

* RhizMail 0.1.0

Francis Hwang release RhizMail 0.1.0, a "test-friendly" library
sending out emails that are customised to the destination user.

* Raggle 0.4.0

Paul Duncan warned "It's SHOCKING... It's DARING! It's
It was in fact Raggle 0.4.0, a web and console based RSS

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

No members online now.

Forum statistics

Latest member

Latest Threads