Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Author Archives: Peter Cooper

By Peter Cooper / July 28, 2008

norubyforyou.jpg
Photo credit: Blakespot. License: CC 2.0 Attribution

Yuki Sonoda has announced the release of Ruby 1.9.0-3, a snapshot release of the still-experimental Ruby 1.9 (wait until Christmas for the production ready 1.9.1). Minor releases aren’t typically covered here on Ruby Inside, but the dropping of support for nine platforms in Ruby 1.9 might be of significant interest to some:

Ruby 1.9 no longer supports the following platforms because they have no active maintainer.

  • BeOS
  • WinCE
  • OS/2
  • Interix
  • bcc32
  • Classic MacOS
  • djgpp
  • VMS
  • human68k

I will remove platform-specific codes for them from Ruby, unless someone become a maintainer by 25 Sep. Read More

By Peter Cooper / July 28, 2008

It’s time to thank Ruby Inside’s excellent sponsors!

I want these posts to be relevant and useful, so I try to include any news or developments the sponsors have had, so even if you don’t care for what the sponsors are selling or providing, it’s worth a quick check to make sure you’re not missing out on anything useful. If you have any suggestions on how these posts could be better then, of course, leave a comment.

Note: All blurbs and descriptions are written by me and not directly influenced or specified by the sponsors. As such, any opinions stated are mine and not necessarily shared by the sponsor(s)! Read More

By Peter Cooper / July 26, 2008

17125v1.jpg

Until last week, Mark McGranaghan was a full-time Ruby developer for TechCrunch, the popular Web 2.0 news site. He worked extensively on CrunchBase, a wiki-style database of companies, people, and investors in the world of Web 2.0. His last assignment was the free-to-use CrunchBase API which went live last week.

I caught up with Mark to ask him about his time working at one of the world’s most famous blogs with one of the world’s most famous bloggers! You might be surprised to learn that head Cruncher Michael Arrington – who is never slow to point out Twitter’s downtime – is pretty cool with Rails and what works well for his developers works for him. Read More

By Peter Cooper / July 24, 2008

ironruby.png

IronRuby is a .NET implementation of Ruby being developed by Microsoft (specifically, by John Lam). The project has matured significantly in the past year, and IronRuby is well on its way to running Rails applications (it already works with very simple ones). IronRuby’s major benefit is that it allows Ruby code to access a massive range of .NET libraries and services.

Justin Etheredge has put together a great set of tutorial blog posts designed to get you up to speed with IronRuby:

  • Getting IronRuby Up and Running walks you through getting the source code, compiling it with Visual Studio 2008 (if you don’t have this, a link to the free “Express” edition is provided), associating the .rb file extension, and running some initial tests.
  • Read More

By Peter Cooper / July 22, 2008

redcloth.png

RedCloth is a popular Ruby library for converting Textile-formatted text into HTML. Initially developed by WhyTheLuckyStiff, it’s now under the guardianship of Jason Garber, who has just released version 4 (RubyForge or Github). This is a significant update, following on from 3.0.4 which was released almost three years ago, and features a handful of significant improvements and changes:

  • New SuperRedCloth (RedCloth 4.0) is a total rewrite using Ragel for the parsing.
  • Markdown support has been removed.
  • Single newlines become <br> tags, just as in traditional RedCloth and other Textile parsers.
  • HTML special characters are automatically escaped inside code signatures, like Textile 2.
  • Read More

By Peter Cooper / July 22, 2008

foscon.png

FOSCON is a “free, fun gathering” of Ruby developers held alongside the O’Reilly OSCON conference currently taking place in Portland, Oregon. It’s tomorrow (Wednesday, July 23) at CubeSpace (near the Oregon Convention Center) from 6pm. The always proactive Portland Ruby Brigade have organized it, and a surprising number of interesting presentations are already planned, including one on IronRuby from John Lam of Microsoft. A live coding competition will also be taking place. Read More

By Peter Cooper / July 22, 2008

starling.png

It’s been around for a while now, but Starling is a “light-weight persistent queue server that speaks the MemCache protocol.” Starling makes it ridiculously easy to set up a network-accessible queue (or many queues) for, say, asynchronous job processing between multiple processes and machines. It was developed by Twitter to handle the heavy amount of queueing necessary to keep their service ticking over. Starling is proven in production, with not only Twitter using it in anger, but FiveRuns too. FiveRuns have even created their own fork that, they say, is significantly faster.

Why the sudden interest in Starling? Well, Glenn Gillen has written an excellent introductory guide to setting up Starling over at RubyPond.com. Read More

By Peter Cooper / July 21, 2008

rubyfringecrowd.png
(Photo credit: Kieran Huggins)

RubyFringedescribed as a “pricey, limited-attendance smoozefest” by Ruby documentation co-ordinator James Britt or as “an avant-garde conference for developers that are excited about emerging technologies outside of the Ruby on Rails monoculture” by the organizers – went ahead last week and appears to have been a significant hit. A small conference with a reasonably high ticket price (though far less than RailsConf Europe!), RubyFringe was set to be a very unique sort of conference with parties, drinks and out-of-hours entertainment laid on, and a limited number of tickets made available to ensure a more intimate gathering. Read More

By Peter Cooper / July 17, 2008

Picture 1.png

Ruby’s is not known for its deftness with XML. On RubyFlow, I considered calling the community to arms over it, and solicited twenty responses on what the problem is, and what we could do about it. Robert Fischer was lamenting on the state of Ruby’s libxml library, and didn’t seem to like REXML much either. Tim Bray has also had a few complaints about REXML. It seemed there was a problem to be fixed; a gap in the market, as it were, for a decent XML parser for Ruby. Hpricot, despite really being an HTML parser, would have to get us by in the meantime. Read More

By Peter Cooper / July 15, 2008

autumnbot.jpg

Autumn is a framework by Tim Morgan that makes it easy to develop powerful IRC (Internet Relay Chat) bots with Ruby. Version 3, a significant update, was launched just a week ago. The code is available on Github, so it’s ready to fork, tweak and work on to your heart’s content.

An instance of an “Autumn app” is laid out in a similar way to a Rails app. There are config, doc, script, libs, tmp, and log folders, containing much what you’d expect, as well as a leaves folder (Autumn refers to “bots” as “leaves”) that contains any number of folders each containing data, helpers, models, tasks, and “views” for individual bots. Read More

By Peter Cooper / July 14, 2008

engineyardmomoney.jpg

Engine Yard, probably the first major Rails-focused hosting company, has today taken a second round of finance of $15m. This second round, from Benchmark Capital, Amazon.com, and New Enterprise Associates, follows on from January’s $3.5m from Benchmark.

So where will the money go? Ezra Zygmuntowicz says:

We’re going to use this money towards making Ruby the platform of choice for cloud computing and web development in startups and the enterprise alike.

This assertion is without doubt, as Engine Yard continues to fund and support the development of Rubinius and Merb, and supports several popular Ruby and Rails sites with sponsorships. Read More

By Peter Cooper / July 11, 2008

Ilya Grigorik of Igvita has put together a great article called 6 Optimization Tips for Ruby MRI. In it, he walks through six different things you can do to improve the performance of your code when running on the regular Ruby interpreter (MRI). For example, interpolation is quicker than concatenation when working with strings, destructive operations prevent wasteful object duplication, and hand-written blocks are a lot faster than Symbol#to_proc.

And.. metaprogramming, of course, comes in for some much deserved performance criticism:

Ruby has a wonderful property of being highly dynamic, which in turn, allows us to create all kinds of spectacular meta-programming scenarios. Read More

By Peter Cooper / July 9, 2008

shoes-clock.png

You’ve used Shoes, Why The Lucky Stiff’s GUI-app toolkit for Ruby, right? No? You’ve at least heard of it? (If the answer to this is also no, seriously chastise yourself now.)

Ernest Prabhakar has announced that two online “ShoesFests” will be taking place, involving why the lucky stiff and “friends,” with the hope of alluring wannabe hackers (whether on Shoes itself or Shoes-based applications):

The goal of these events is to write and share fun little applications using Shoes, a clever little cross-platform GUI toolkit written in Ruby. This will allow us to test, document, and file bugs on how the various Shoes features work on the different supported platforms (Linux, Windows, Mac), in preparation for our next major release on July 31st, 2008. Read More

By Peter Cooper / July 8, 2008

lonestar.png

Registration for Texas’s own Ruby conference, the Lone Star Ruby Conference, has opened. The overall event takes place between September 4 – 6, 2008 in the Norris Conference Center in Austin, TX. Tickets are $250 for the two-day conference portion, or $425 for one day of training / tutorials followed by the two day conference. The prices shoot up come August 10.

The schedule is bumper packed with some great sessions and tutorials. James Edward Gray II and Gregory Brown will be delivering a three hour training session on Ruby’s IO functionality, Jim Weirich and Joe O’Brien will be delivering a tutorial on Test Driven Development, Gregg Pollack and Jason Seifer (of RailsEnvy fame) will be giving an advanced ActiveRecord workshop, and lots more besides. Read More

By Peter Cooper / July 7, 2008

Trollop is a command-line argument processing library for Ruby. Developer William Morgan says Trollop is “designed to provide the maximal amount of GNU-style argument processing in the minimum number of lines of code.” It makes a refreshing change to the more popular, but generally scary, cmdparse. The homepage features some examples of its usage.

Once you’ve installed trollop with the usual gem install trollop, you could write:

require ‘trollop’

opts = Trollop::options do
opt :http_1_0, “Force HTTP/1.0″
opt :http_1_1, “Force HTTP/1.1″
opt :hide_referer, “Hide referer”, :default =true
opt :connections, “Set number of simultaneous connections”, :default =2
end

p opts

Running the script with no command line options would result in opt becoming:

{:http_1_0=false, :http_1_1=false, :hide_referer=true, :connections=2, :help=false}

You also get a –help (or -h) option for free that describes how to use the options:

Options:
–http-1-0, -h: Force HTTP/1.0
–http-1-1, -t: Force HTTP/1.1
–hide-referer, -i: Hide referer (default: true)
–connections, -c : Set number of simultaneous connections (default: 2)
–help, -e: Show this message

Note that trollop takes care of assigning the short-hand individual letter options, assigning the next letter within the string if the previous ones are taken. Read More