29th May - 4th June 2006
Ruby Weekly News is a summary of the week’s activity for the
ruby-talk
mailing list, and its mirror equivalents the
ruby-talk google group and the Ruby forum. (The comp.lang.ruby newsgroup isn’t currently being mirrored, and its posts aren’t included in this summary, however they will be from next week onwards. Take a look at gmane if you wish to use usenet reader.)
This week’s newsletter is brought to you by Tim Sutherland and the ninja summariser.
Articles and Announcements
- Ruby on Rails Workshop in Kansas City !
- It Will Get Better - Article Mini Series
- New leadership for ruby-spreadsheet
- Presentation proposals now being accepted for RubyConf 2006
- Ruby papers in Linux Journal
- Another Rails book announcement
- a good home for some Ruby Projects
- r43, an implementation of the 43 Things API.
- The Ruby Web Bench, a toolkit for performing capacity and functional tests against a website.
- Ironically, The Ruby Programming Shop, a project to adopt orphaned Ruby projects.
The Kansas City Ruby User’s Group proudly present their “Ruby on Rails Workshop”.
“This one-and-half-day workshop will offer a quick introduction to Ruby and the Ruby on Rails web application framework.”
“Sponsored by Reevik, Inc., it will provide web developers with a basic understanding of the concepts, tools and tips needed to build full-featured web applications using Ruby on Rails.”
“The workshop is spread over three half-day sessions on June 19th, 20th, and 21st.”
Not exactly Ruby, but Zach Dennis has begun a mini-series called It Will Get Better which follows a journey “through my eyes and experiences about agile software development, time management, managing expectations, and system administration.”
Daniel Berger’s looking for a new maintainer for the spreadsheet (old site) package. It’s used to write Excel files (whereas parseexcel is for reading them).
David A. Black announced that proposals for presentations are now being accepted for RubyConf 2006, to be held in Colorado in October 20th-22nd.
The deadline for submissions is June 30th.
Linux Journal this week: Ruby Ruby Ruby. A big “Ruby sign” on the cover, right next to DHH’s head.
Tim Beckers says that Ruby is also on the cover of Dr. Dobbs. “This place will get crowded soon.”
Pat Eyler notes that Apress have announced a book “Beginning Ruby on Rails: From Novice to Professional”, and say that more are in the pipeline.
“Please feel free to drop some comments on the blog to voice your support for Ruby books and/or suggestions about how Apress can do them right (topics, how they can get involved in the community, etc.)”
Citing work commitments, Pat Eyler announces that he’s going to have to orphan several of his Ruby projects. To prevent this, he’s in search of new maintainers for (among others):
User Group News
- Toronto RUG meeting Sun 4 June 2006
- Skåne/Sjælland Ruby User Group
- Milwaukee Ruby User Group Meeting
Mike Stok says the next Toronto Ruby User Group meeting will be at Sunday 4th June 2006, at the Linux Caffe on Harbord Street.
The Skåne/Sjælland Ruby User Group (SSRUG) have been gaining momentum following their first two meetings, and are looking for new members.
(Skåne is a province of Sweden, and Sjælland is an island of Denmark.)
The Milwaukee Ruby User’s Group (Wisconsin) is pleased to announce its first meeting, on Wednesday June 7, 2006.
“The Milwaukee RUG would like to thank SpiderLogic for providing space for the meeting.”
Threads
Ruby's Bignum
Aaron Patterson asks whether it’s possible to prevent Ruby from automatically coercing Fixnums into Bignums, since he wants the behavior of 32-bit integer arithmetic. Various suggestions follow, falling into roughly three categories:
- Use pack/unpack to force the result into a 32-bit integer
- Bitwise operations
- Subclassing Integer to provide an Int32 class with the desired behavior
David Balmain notes that (absent that last solution), you’ll still have to use Bignums to represent 32-bit integers at times: on 32-bit platforms, Fixnum has only a 31-bit range.
ruby-dev summary 28606-28636
Minero Aoki summarises the Japanese list ruby-dev, and includes a note on how to load a Ruby file ‘into’ a module: mod.module_eval(File.read("./x.rb")).
Creating Daemon Processes in Windows
Jatinder Singh wants to create a “daemon process” in Windows, in other words “start another process which should continue to run even after the parent process dies.”
Victor Shepelev replies that the daemon concept is called a “service” in Windows, and the win32-service module from the win32utils project lets you work with services from Ruby.
Jatinder Singh: “Thanks Victor! Win32-service helped me achieve what I intended to do.”
Please kill the children as you're leaving
Ohad Lutzky asks a rather grimly-phrased question about processes on Un*x: how does one ensure that forked child processes are reaped when the parent process dies unexpectedly? Ordinarily those children would live on, adopted by the init process.
Several people suggest setting up “heartbeat” pipes, read by the parent process, to which the child processes write; when the parent dies, the pipe breaks, and the children are killed with SIGPIPE. Ara T. Howard has even written slave, a library for exactly this purpose.
Sam Roberts, in turn, hauls out R. Stevens and observes that in theory the children should get killed automatically with SIGHUP if the parent process has made itself their session leader.
What happened the week of March 19th?
Curt Hibbs was looking over the download statistics for the One-Click Ruby Installer for Windows and Instant Rails, and found a big jump from the week of March 19.
Prior to the 19th the one-click installer averaged 10,000 downloads a week, and had been at the level for quite some time. But starting the week of March 19th the downloads tripled to 30,000 a week where they have remained to this day.
“Does anybody know what happened that week?”
There were not (yet) any replies.
Trying to determine presentation author
James Britt is trying to find an attribution for the presentation on ruby-doc.org entitled “Ruby Language Talk” [zip]. “Does anyone know who the author is?”
LWP like library for Ruby?
Robert Nicholson wonders if Ruby has any libraries similar to Perl’s LWP (libwww-perl), i.e. libraries that act like a web browser to help you to scrape data off web pages.
WWW::Mechanize and HTTPAccess2 are mentioned in the replies.
Where can one find examples of masterful Ruby code?
Alder Green asks for examples of masterful Ruby code he could read in order to become a better Ruby programmer.
Greg Donald says that rubyquiz.com is worth looking at (and especially the Best of Ruby Quiz book), while Ross Bamford points to the Facets project (a collection of extensions to Ruby’s core and standard libraries that includes many examples of excellent, short, self-contained pieces of code).
Simon Strandgaard suggests looking at the code in Ruby’s standard library itself, and others say that the blogs RedHanded (by whytheluckystiff) and eigenclass (by Mauricio Fernandez) often show elegant code.
A. S. Bradbury says the gonzui code-browser on RAA (the Ruby Application Archive) provides a web interface for quickly browing the source code of Ruby projects without having to download them.
“If you see a project you’ve heard about or used, or one that just looks interesting why not look through? Certainly, you may not always be looking at great Ruby code, but I think you can learn a lot this way.”
Christian Neukirchen: “I’d say that I’m pretty well-versed in Ruby. I have not yet seen much masterful code. I’m not sure I could point out a medium-sized piece of Ruby that’s *truly* and *completely* masterful.” (“Does masterful code get less and less the more you advance?” he ponders.)
Alexandru Popescu: “It may be like music, where the more one knows and the more one has heard, the harder it is to get excited about new music (though when you do find something good, it can be *really* exciting).”
Hash to OpenStruct (#81)
This week’s Ruby Quiz is by Hans Fugal.
More than a few times I’ve wished I could get a nice nested OpenStruct out of YAML data, instead of the more unwieldy nested hashes. It’s mostly a matter of style. It’s a straightforward task to convert a nested hash structure into a nested OpenStruct, but it’s the sort of task that you can do a lot of ways, and I’ll bet some of you can come up with more elegant and/or more efficient ways than I have so far.
Some tough test cases are posted in the replies, including one by MenTaLguY of a YAML document that’s not a tree.
I'm Collecting Media References for Ruby and Rails
Curt Hibbs announces that he’s collecting URLs to articles, podcasts and videos about Ruby, and about Rails.
“If have such a collections yourself (or just know of some good references), could you please share them on this thread.”
James Britt: http://del.icio.us/tag/ruby.
Ruby Manual
Nathaniel Brown announces the Ruby Manual, a fully searchable Ruby manual that allows you to add comments (like with the PHP documentation). (Also: Rails Manual.)
The sites are generated entirely with Conor Hunt’s Rannotate tool, and are virtually identical to Conor’s Ruby API Documentation and Ruby on Rails API Documentation sites.
There are questions about why Nathaniel created new sites, since these will now split the annotation information between them and Conor’s. More on Conor’s blog.
Conor’s goals with Rannotate are to integrate it into api.rubyonrails.org and ruby-doc.org, have collaborative documentation controlled by the community, and generate diffs that can be directly applied to source code repositories, in order to merge updated documentation into the Ruby (and other) source trees.
This is brain dead, but is it stupid?
Jeff Pritchard starts writing an application to show some simple charts for statistics from his Rails app.
He’s looked at the sparklines and gruff libraries, but finds that the first only supports very simple charts, and the second requires too much time to install.
It occurred to me that the reason they were requiring rmagic and other stuff has to do with needing a way to so some really simple drawing. Sort of like using photoshop to paint a mustache on your girlfriends picture – it works and inspires the expected knee reflex in the girl, but it’s total overkill for the job.
Instead of using one of the existing libraries, he begins thinking about drawing bar-charts by scaling a square block up by the required amount in HTML. For example,
<img src="blublock.jpg" width="5" height="96"> <img src="blublock.jpg" width="5" height="20"> <img src="blublock.jpg" width="5" height="25"> <img src="blublock.jpg" width="5" height="30">
“What do you think, this is clearly brain dead, but is it stupid too?”
Trevor Squires points out css_graphs, a Ruby charting library that uses only CSS, and Kate Rhodes lists SVG::Graph and PlotKit (supports Canvas and SVG charts).
With respect to Jeff’s idea, Dave Howell says that he could use tables with background-coloured cells instead of the blublock.jpg.
New Releases
foxGUIb v0.7 (for FXRuby 1.6)
As a followup to the recent release of FXRuby 1.6.0, Meinrad Recheis announces foxGUIb v0.7, a GUI creator and code generator for FXRuby similar in spirit to Glade and other applications which let you lay out widgets in a point-and-click fashion.
Pimki 1.8.200
Assaph Mehr fixes some bugs in Pimki: The Wiki-based PIM to GetThingsDone!
Madeleine 0.7.2
Madeline, a transparent object persistence framework, re-emerges after a period of two years without any releases. Madeline 0.7.2 includes the following fixes:
- An automatic class with no methods would cause an error
- System sanity check at first use
- Now creates full path to storage files, not just the last directory (reported by Wayne Vucenic)
RMagick 1.12.0
Timothy Hunter makes a new release of RMagick to fix an API incompatibility with Image#level introduced in the last release. “Thanks to Al Evans for reporting it and helping me find a fix.”
“RMagick is an interface to the ImageMagick and GraphicsMagick image processing libraries. RMagick supports more than 90 image formats, including GIF, JPEG, PNG. It includes RVG, a 2D drawing API. RMagick comes with comprehensive HTML documentation.”
Timothy also encourages users to ask web hosting services with very old versions to upgrade, as several memory leaks have been fixed in recent releases. (He later notes he’s been using valgrind to test for leaks.)
Aredridel: “Thank you for that. Fixed our memory usage problems that I was just in the process of narrowing down to the library. Beat me to the punch!”
rcov 0.5.0: code coverage + callsite info, RubyGems, Rant...
Mauricio Fernandez announces the recent release of rcov 0.5.0, a tool useful for evaluating test coverage of Ruby code. For the first time, rcov is now available in gem form, with both Win32 and platform-independent flavors.
id3lib-ruby 0.3.0 (Windows binary gem)
Robin Stocker announces the 0.3.0 release of id3lib-ruby, this time with a Windows binary gem. “id3lib-ruby provides a Ruby interface to the id3lib C++ library for easily editing ID3 tags (v1 and v2) like with pyid3lib.”
“Thanks go to Mauricio Fernandez for his article on how to cross-compile Ruby extensions and to Curt Hibbs for his installer of a mingw-based Ruby.”
win32-dir 0.3.0
Daniel Berger: “In the ongoing effort to Rubyify as much of the Win32 Utils project as we can, I’m pleased to announce the release of win32-dir 0.3.0.”
It’s now pure Ruby, and (in keeping with the trend) now offers a gem.
ruby-breakpoint 0.5.1: Now with fewer bugs
Florian Gross releases an update to ruby-breakpoint to fix some bugs, and announces he’s going to be working on ruby-breakpoint for this year’s Summary of Code.
“If there is anything else I can do to make ruby-breakpoint more useful or easier to use please tell me. Now is the best time to suggest new features!” (Current TODOs include creating a cross-platform GTK2 front-end.)
“ruby-breakpoint lets you inspect and modify state at run time. This allows you to diagnose bugs, patch applications and more all via IRB by simply doing a method call at the place you want to investigate.”
Nebular Gauntlet 0.1
Steven Davidovitz presents version 0.1 of Nebular Gauntlet, an Asteroids-like multiplayer game written in Ruby with Ruby/SDL. It’s still at a very early stage of its development, but the basics of gameplay are already implemented.