T
Tim Sutherland
http://www.rubygarden.org/ruby?RubyNews/2005-01-10
Ruby Weekly News 10th - 16th January 2005
-----------------------------------------
A summary of the week's activity on the ruby-talk mailing list / the
comp.lang.ruby newsgroup. This summary is brought to you by Tim Sutherland
(TimSuth).
Articles and Announcements
--------------------------
* [Tutorial: Distributed pipes with DRb]
Ilmari Heikkinen wrote a document (DistributedPipes) that
describes how the author used the DRb (Distributed Ruby) library
to write a distributed mp3 encoding system. This is then
generalised to work with any program that uses pipes for
communication.
* [RedHanded welcomes two bloggers from Japan]
[whytheluckystiff] announced that "Daigo Moriwaki and Michiaki
Baba from Japan will be joining [RedHanded] this week. They will
be blogging about activities in Japan and general Ruby stuffs."
* [Building, Packing and Distributing Ruby Applications]
Erik Veenstra wrote a [tutorial] that describes how to distribute
a Ruby application as a single executable that includes the Ruby
interpreter and the program (using Erik's Tar2RubyScript and
RubyScript2Exe tools).
Threads
-------
[apt-listbugs]
--------------
Thursday wrote:
"I didn't see Debian's apt-listbugs in raa or rubyforge so it was kinda
neat to find out it uses ruby. If you use Debian and Ruby, you might be
interested in taking a look at the code.
http://packages.debian.org/unstable/admin/apt-listbugs
apt-listbugs is written and maintained by Masato Taruishi.
Description:
apt-listbugs is a tool which retrieves bug reports from the Debian Bug
Tracking System and lists them. Especially, it is intended to be invoked
before each upgrade/installation by apt in order to check whether the
upgrade/installation is safe."
[Web Testing in Ruby]
---------------------
Laurent Julliard asked
"I'm trying to find a Ruvby package that would allow us to test a web based
application directly through the Web interface. The idea here is that
the Ruby testing application would basically behave like a web browser
: GET/POST requests, manipulate HTML forms received as objects so
that it is easy to fill them out and send them back to the server"
Daniel Berger said this sounded like Perl's "LWP and/or WWW::Mechanize
modules" and several people listed [WebUnit] which is designed to solve
exactly this problem.
JonathanKohl:
"There is Chris Morris' IEC and the new Watir library. Currently both
utilize the Internet Explorer "automation" interface (referred to as
COM, OLE, ActiveX, etc.) using WIN32OLE. IEC works more with form
submits, while Watir manipulates objects on a web page by sending
messages to objects. Both IEC and Watir can be downloaded from Rubyforge:
http://rubyforge.org/projects/wtr/"
Bret Pettichord:
... "we plan to use dependency
injection to allow Watir-based tests to run either using the IE/COM driver,
like they do currently (Windows only), or a new driver that will use
Selenium to allow the tests to run in any browser on any platform.
Selenium is sever-side test automation software that currently supports
in-browser testing on IE, Mozilla and Firefox on Windows, Mac and Linux.
Seriously. The tests actually run in your browser of choice using a
javascript automation engine that is implanted into the browser from the
server. It's not fast, but it is very accurate and convincing.
You can see this for yourself, if you point a browser of your choice at
http://selenium.thoughtworks.com/demo1/TestRunner.html
This is just a very rough mock up of what we are aiming for. The version of
Selenium that is currently released only works with the static test files
that you see in this demo, which i think is pretty boring. But we have
prototypes checked in that allow Java and Ruby scripts to execute against
this very same API."
[[SUMMARY] LCD Numbers (#14)]
-----------------------------
Last week's [Ruby Quiz] was summarised by James Edward Gray II. The task
was to write a program that displays LCD style numbers at adjustable sizes
in simple ASCII-art with '-' and '|'.
"There were three main strategies used for solving the problem. Some used a
template approach, where you have some kind of text representation of your
number at a scale of one. Two might look like this, for example:
[ " - ",
" |",
" - ",
"| ",
" - " ]
"The second strategy used was to treat each digit as a series of segments that
can be "on" or "off". The numbers easily break down into seven positions:
6
5 4
3
2 1
0
Using that map, we can convert the two above to a binary digit, and some did:
0b1011101"
The third strategy was to use a finite state machine.
[[QUIZ] Animal Quiz (#15)]
--------------------------
This week's [Ruby Quiz] is by Jim Weirich.
"It works like this. The program starts by telling the user to think
of an animal. It then begins asking a series of yes/no questions
about that animal: does it swim, does it have hair, etc. Eventually,
it will narrow down the possibilities to a single animal and guess
that (Is it a mouse?).
If the program has guessed correctly, the game is over and may be
restarted with a new animal. If the program has guess incorrectly, it
asks the user for the kind of animal they were thinking of and then
asks for the user to provide a question that can distinguish between
its incorrect guess and the correct answer. It then adds the new
question and animal to its "database" and will guess that animal in
the future (if appropriate)."
Solutions were posted under the same thread.
[Segfault in timer.rb]
Erlend Oye got segfaults when running RSSScraper under builds of Ruby
1.8.2 and 1.9.1 that he had created with cygwin. They all seemed to be
occuring when Thread.start was called.
Ville Mattila pointed out
"The cygwins signal handling is not most robust and ruby threading
implementation depends on working signals. However there is cygwin1
delopment snapshots that might cure Erlend's problem. Erlend could
you check the latest snapshot from http://cygwin.com/snapshots/
Also I think you'll get better OS features (OLE and stuff like that)
if you use native ruby i.e. one click installer or compile it
yourself (migw or msvc)."
The [One-Click Ruby Installer] for Windows currently uses Microsoft's
Visual Studio compiler (MSVC) and users can also build Ruby with the MingW
system (Minimalist GNU for Windows), see the HowToBuildOnWindows wiki page
for instructions. Neither of these suffer from the cygwin issues.
New Releases
------------
* [XDCC-Fetch 1.239]
martinus was happy to announce the first release of [XDCC-Fetch],
a GUI tool for collecting, searching and downloading broadcasted
XDCC announcements within IRC channels.
* [YARV: Yet Another RubyVM 0.1.0]
SASADA Koichi released version 0.1.0 of [YARV], a project aiming
to develop the fastest Virtual Machine for Ruby in the world.
* [Ruby Facets, v0.6.1]
trans updated [Ruby Facets], a collection of extensions for core
Ruby classes. "Methods are stored in their own files, allowing for
extremely granular control of requirements."
* [sys-uname 0.7.0]
Daniel Berger improved sys-uname, a Ruby library that provides
platform information similar to that returned by the unix uname
command. It works on win32 as well as unix systems. The Windows
support now uses WMI + OLE instead of a C extension.
* [Net::SFTP 0.9.0] [Net::SSH 0.9.0]
Jamis Buck released the first in a planned series of beta releases
of his pure-Ruby SFTP client [Net::SFTP] with the aim to arrive at
version 1.0.0 before too long. Jamis also announced a new version
of [Net::SSH], a pure-Ruby SSH2 client.
* [Syntax 0.5.0]
Jamis Buck intoned "[Syntax] is an experimental Ruby library for
syntax highlighting source code. Currently, it supports Ruby, XML,
and YAML."
* [xmlresume2x 0.2.1]
Thomas Leitner delivered a new release of [xmlresume2x], a tool
which converts résumés stored using the [XML Résumé Library
format] into various output formats.
* [Nitro + Og 0.8.0]
George Moschovitis updated [Nitro], his web application framework
and Og, an object-relation mapping library. Changes include a new
automatic validation system and many important bug fixes.
* [Tar2RubyScript 0.4.3]
Erik Veenstra made some enhancements to [Tar2RubyScript], a tool
that transforms a Ruby program into a single file, easing
distribution.
* [EasyPrompt 0.1.0]
Francis Hwang made the initial release of the EasyPrompt library,
which provides a simple interface for interactive prompts in
command-line programs.
* [Instiki 0.9.2 - OSX build]
Alexey Verkhovsky reports that "[t]hanks to Ben Schumacher, a
native OSX build of Instiki 0.9.2 is now available". (Instiki is a
Wiki implementation.)
* [Nemo 0.1.0 + Wee 0.4.0]
Michael Neumann announced Kevin Howe's Nemo project along with an
updated version of Wee (developed by Michael). "Nemo is a
web-application platform that uses object metadata to
automatically construct web-interfaces (Editors and Viewers). It
is highly object-oriented with strong emphasis on reusable
components."
* [Ruby Vector Graphics 0.3.0]
Tim Hunter issued an update to [RVG], "a library for drawing 2D
graphics with an API based on the SVG specification". It uses
RMagick (the Ruby binding for ImageMagick and GraphicsMagick). New
in this release is support for patterns.
* [Pimki 1.4]
Assaph Mehr updated [Pimki], a personal information manager (PIM)
based on the Instiki wiki system. This release incorporates the
Instiki changes in Instiki 0.9.2, fixes some bugs and adds
features like edit on double-click.
* [CreditCard 1.0]
Lucas Carlson introduced [CreditCard], a library that can "tell
you whether a credit card number is self-consistent using known
algorithms for credit card numbers". Lucas intends to develop a
full payment processing gateway for Ruby in the future.
* [Flash/Ruby 0.1.0]
leon breedt announced the first public release of Flash/Ruby,
which is a Ruby binding for a library he wrote called libflash. It
is used to embed Macromedia Flash in a GTK+ application.
* [RubyScript2Exe 0.3.1]
Erik Veenstra updated [RubyScript2Exe], which collects a Ruby
application along with the Ruby interpreter into a single
executable for Windows or unix. RubyGems support has been
improved, and .dll and .o files are correctly handled.
Ruby Weekly News 10th - 16th January 2005
-----------------------------------------
A summary of the week's activity on the ruby-talk mailing list / the
comp.lang.ruby newsgroup. This summary is brought to you by Tim Sutherland
(TimSuth).
Articles and Announcements
--------------------------
* [Tutorial: Distributed pipes with DRb]
Ilmari Heikkinen wrote a document (DistributedPipes) that
describes how the author used the DRb (Distributed Ruby) library
to write a distributed mp3 encoding system. This is then
generalised to work with any program that uses pipes for
communication.
* [RedHanded welcomes two bloggers from Japan]
[whytheluckystiff] announced that "Daigo Moriwaki and Michiaki
Baba from Japan will be joining [RedHanded] this week. They will
be blogging about activities in Japan and general Ruby stuffs."
* [Building, Packing and Distributing Ruby Applications]
Erik Veenstra wrote a [tutorial] that describes how to distribute
a Ruby application as a single executable that includes the Ruby
interpreter and the program (using Erik's Tar2RubyScript and
RubyScript2Exe tools).
Threads
-------
[apt-listbugs]
--------------
Thursday wrote:
"I didn't see Debian's apt-listbugs in raa or rubyforge so it was kinda
neat to find out it uses ruby. If you use Debian and Ruby, you might be
interested in taking a look at the code.
http://packages.debian.org/unstable/admin/apt-listbugs
apt-listbugs is written and maintained by Masato Taruishi.
Description:
apt-listbugs is a tool which retrieves bug reports from the Debian Bug
Tracking System and lists them. Especially, it is intended to be invoked
before each upgrade/installation by apt in order to check whether the
upgrade/installation is safe."
[Web Testing in Ruby]
---------------------
Laurent Julliard asked
"I'm trying to find a Ruvby package that would allow us to test a web based
application directly through the Web interface. The idea here is that
the Ruby testing application would basically behave like a web browser
: GET/POST requests, manipulate HTML forms received as objects so
that it is easy to fill them out and send them back to the server"
Daniel Berger said this sounded like Perl's "LWP and/or WWW::Mechanize
modules" and several people listed [WebUnit] which is designed to solve
exactly this problem.
JonathanKohl:
"There is Chris Morris' IEC and the new Watir library. Currently both
utilize the Internet Explorer "automation" interface (referred to as
COM, OLE, ActiveX, etc.) using WIN32OLE. IEC works more with form
submits, while Watir manipulates objects on a web page by sending
messages to objects. Both IEC and Watir can be downloaded from Rubyforge:
http://rubyforge.org/projects/wtr/"
Bret Pettichord:
... "we plan to use dependency
injection to allow Watir-based tests to run either using the IE/COM driver,
like they do currently (Windows only), or a new driver that will use
Selenium to allow the tests to run in any browser on any platform.
Selenium is sever-side test automation software that currently supports
in-browser testing on IE, Mozilla and Firefox on Windows, Mac and Linux.
Seriously. The tests actually run in your browser of choice using a
javascript automation engine that is implanted into the browser from the
server. It's not fast, but it is very accurate and convincing.
You can see this for yourself, if you point a browser of your choice at
http://selenium.thoughtworks.com/demo1/TestRunner.html
This is just a very rough mock up of what we are aiming for. The version of
Selenium that is currently released only works with the static test files
that you see in this demo, which i think is pretty boring. But we have
prototypes checked in that allow Java and Ruby scripts to execute against
this very same API."
[[SUMMARY] LCD Numbers (#14)]
-----------------------------
Last week's [Ruby Quiz] was summarised by James Edward Gray II. The task
was to write a program that displays LCD style numbers at adjustable sizes
in simple ASCII-art with '-' and '|'.
"There were three main strategies used for solving the problem. Some used a
template approach, where you have some kind of text representation of your
number at a scale of one. Two might look like this, for example:
[ " - ",
" |",
" - ",
"| ",
" - " ]
"The second strategy used was to treat each digit as a series of segments that
can be "on" or "off". The numbers easily break down into seven positions:
6
5 4
3
2 1
0
Using that map, we can convert the two above to a binary digit, and some did:
0b1011101"
The third strategy was to use a finite state machine.
[[QUIZ] Animal Quiz (#15)]
--------------------------
This week's [Ruby Quiz] is by Jim Weirich.
"It works like this. The program starts by telling the user to think
of an animal. It then begins asking a series of yes/no questions
about that animal: does it swim, does it have hair, etc. Eventually,
it will narrow down the possibilities to a single animal and guess
that (Is it a mouse?).
If the program has guessed correctly, the game is over and may be
restarted with a new animal. If the program has guess incorrectly, it
asks the user for the kind of animal they were thinking of and then
asks for the user to provide a question that can distinguish between
its incorrect guess and the correct answer. It then adds the new
question and animal to its "database" and will guess that animal in
the future (if appropriate)."
Solutions were posted under the same thread.
[Segfault in timer.rb]
Erlend Oye got segfaults when running RSSScraper under builds of Ruby
1.8.2 and 1.9.1 that he had created with cygwin. They all seemed to be
occuring when Thread.start was called.
Ville Mattila pointed out
"The cygwins signal handling is not most robust and ruby threading
implementation depends on working signals. However there is cygwin1
delopment snapshots that might cure Erlend's problem. Erlend could
you check the latest snapshot from http://cygwin.com/snapshots/
Also I think you'll get better OS features (OLE and stuff like that)
if you use native ruby i.e. one click installer or compile it
yourself (migw or msvc)."
The [One-Click Ruby Installer] for Windows currently uses Microsoft's
Visual Studio compiler (MSVC) and users can also build Ruby with the MingW
system (Minimalist GNU for Windows), see the HowToBuildOnWindows wiki page
for instructions. Neither of these suffer from the cygwin issues.
New Releases
------------
* [XDCC-Fetch 1.239]
martinus was happy to announce the first release of [XDCC-Fetch],
a GUI tool for collecting, searching and downloading broadcasted
XDCC announcements within IRC channels.
* [YARV: Yet Another RubyVM 0.1.0]
SASADA Koichi released version 0.1.0 of [YARV], a project aiming
to develop the fastest Virtual Machine for Ruby in the world.
* [Ruby Facets, v0.6.1]
trans updated [Ruby Facets], a collection of extensions for core
Ruby classes. "Methods are stored in their own files, allowing for
extremely granular control of requirements."
* [sys-uname 0.7.0]
Daniel Berger improved sys-uname, a Ruby library that provides
platform information similar to that returned by the unix uname
command. It works on win32 as well as unix systems. The Windows
support now uses WMI + OLE instead of a C extension.
* [Net::SFTP 0.9.0] [Net::SSH 0.9.0]
Jamis Buck released the first in a planned series of beta releases
of his pure-Ruby SFTP client [Net::SFTP] with the aim to arrive at
version 1.0.0 before too long. Jamis also announced a new version
of [Net::SSH], a pure-Ruby SSH2 client.
* [Syntax 0.5.0]
Jamis Buck intoned "[Syntax] is an experimental Ruby library for
syntax highlighting source code. Currently, it supports Ruby, XML,
and YAML."
* [xmlresume2x 0.2.1]
Thomas Leitner delivered a new release of [xmlresume2x], a tool
which converts résumés stored using the [XML Résumé Library
format] into various output formats.
* [Nitro + Og 0.8.0]
George Moschovitis updated [Nitro], his web application framework
and Og, an object-relation mapping library. Changes include a new
automatic validation system and many important bug fixes.
* [Tar2RubyScript 0.4.3]
Erik Veenstra made some enhancements to [Tar2RubyScript], a tool
that transforms a Ruby program into a single file, easing
distribution.
* [EasyPrompt 0.1.0]
Francis Hwang made the initial release of the EasyPrompt library,
which provides a simple interface for interactive prompts in
command-line programs.
* [Instiki 0.9.2 - OSX build]
Alexey Verkhovsky reports that "[t]hanks to Ben Schumacher, a
native OSX build of Instiki 0.9.2 is now available". (Instiki is a
Wiki implementation.)
* [Nemo 0.1.0 + Wee 0.4.0]
Michael Neumann announced Kevin Howe's Nemo project along with an
updated version of Wee (developed by Michael). "Nemo is a
web-application platform that uses object metadata to
automatically construct web-interfaces (Editors and Viewers). It
is highly object-oriented with strong emphasis on reusable
components."
* [Ruby Vector Graphics 0.3.0]
Tim Hunter issued an update to [RVG], "a library for drawing 2D
graphics with an API based on the SVG specification". It uses
RMagick (the Ruby binding for ImageMagick and GraphicsMagick). New
in this release is support for patterns.
* [Pimki 1.4]
Assaph Mehr updated [Pimki], a personal information manager (PIM)
based on the Instiki wiki system. This release incorporates the
Instiki changes in Instiki 0.9.2, fixes some bugs and adds
features like edit on double-click.
* [CreditCard 1.0]
Lucas Carlson introduced [CreditCard], a library that can "tell
you whether a credit card number is self-consistent using known
algorithms for credit card numbers". Lucas intends to develop a
full payment processing gateway for Ruby in the future.
* [Flash/Ruby 0.1.0]
leon breedt announced the first public release of Flash/Ruby,
which is a Ruby binding for a library he wrote called libflash. It
is used to embed Macromedia Flash in a GTK+ application.
* [RubyScript2Exe 0.3.1]
Erik Veenstra updated [RubyScript2Exe], which collects a Ruby
application along with the Ruby interpreter into a single
executable for Windows or unix. RubyGems support has been
improved, and .dll and .o files are correctly handled.