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

Author Archives: Peter Cooper

By Peter Cooper / March 14, 2011

The RSpec Book (Amazon.com) by David Chelimsky (plus a cadre of BDD superstars) is a recent release from The Pragmatic Programmers and a handy addition to any TDD-mad or RSpec-using developer’s bookshelf. You can buy a copy from Amazon.com, Amazon.co.uk, or direct from the publisher (more expensive but a PDF version is available).

What is The RSpec Book?

The RSpec Book is a 400 page book by David Chelimsky (RSpec‘s primary maintainer), Dave Astels, Zach Dennis, Aslak Hellesøy (of Cucumber fame), Bryan Helmkamp and Dan North. Its aim is to teach you all about RSpec (RSpec 2.0 – specifically) and BDD (Behavior Driven Development) from the ground up and it promises to “help you write better code, write better tests, and delver better software to your users.”

Robert C. Read More

By Peter Cooper / February 28, 2011

It’s been a killer month for new Ruby and Rails jobs over at the Ruby Inside Jobs board so I’m going to cut the filler to a minimum today.. though if you want to learn more about posting one of your own, check our Post A Job page. The current bonus is you’ll get your job ad into the 4000+ subscriber-strong Ruby Weekly for free!

There are a couple of really appealing jobs in here (particularly the first one) and they span the US with a few in the United Kingdom and one in Australia for good measure:

Innovation Developer – San Francisco, California

salesforce.com, inc. Read More

By Peter Cooper / February 27, 2011

Eloquent Ruby (Amazon.com – print & Kindle) by Russ Olsen is the first Ruby book I’ve read in its entirety within 24 hours; it’s that good. That may be all you need to know before you buy a copy at Amazon.com, Amazon.co.uk or read it on Safari (if you have an account). If you want to learn more though, keep reading.

What Is “Eloquent Ruby”?

Eloquent Ruby is a book published by Addison Wesley and written by Russ Olsen (who also wrote Design Patterns in Ruby a few years ago). It clocks in at around 400 pages and has 31 chapters clocking in at around a punchy 10 pages each. Read More

By Peter Cooper / February 24, 2011

Yes, I’m sad enough to have had this in my calendar for some time but.. it’s Ruby’s 18th “birthday” today! Happy Birthday Ruby! While this means it can drink, vote, and otherwise join its slightly older friends Perl (24) and Python (21) in the nightclubs of Europe, I was surprised to learn that coming of age in Japan is at 20 years old.

From Wikipedia’s Ruby entry:

If you’re interested in learning more, this interview with Matz back in 2001 will give you more history and background to the creation of Ruby.

While Matz has said that February 24, 1993 is Ruby’s “birthday” (back when I Will Always Love You by Whitney Houston was topping the charts), the first public release wasn’t until December 21, 1995 when Ruby 0.95 was released and the first mailing list established. Read More

By Peter Cooper / February 20, 2011

Rails 3 is great. RSpec 2 is great. And Ruby 1.9.2 is really great. Getting them all running together and quickly, however, isn’t entirely straightforward. In this post I demonstrate how to get everything ticking over along with automatically running, super-snappy test runs.

The ultimate outcome is using Ruby 1.9.2 (though much of this is relevant to 1.8 still) to create a Rails 3 app, hook up RSpec 2, and be able to run specs quickly. The first two parts are easy(ish) but the “quickly” part requires some tinkering. Grab a coffee and carry on..

Create a new Rails 3 app

Got Rails 3 installed? Read More

By Peter Cooper / February 19, 2011

It’s been a dies horribilis for MRI Ruby today with two new security vulnerabilities forcing the release of 3 new recommended production versions of the de facto official Ruby interpreter. The first, a vulnerability in FileUtils.remove_entry_secure affects both 1.8 and 1.9 branches, while the second, a $SAFE mode vulnerability, affects only 1.8.

The FileUtils Vulnerability (1.8 and 1.9)

Urabe Shyouhei of the Ruby core team has announced that FileUtils is vulnerable to symlink race attacks and he’s not talking about hate crimes. Ruby versions including and prior to Ruby 1.8.6p420, Ruby 1.8.7p330, Ruby 1.9.1p430 and Ruby 1.9.2p136 are affected so you’re almost guaranteed to be affected. Read More

By Peter Cooper / February 3, 2011

It’s time for us to thank the companies who help to keep Ruby Inside going by kindly sponsoring our work. So.. thank you! (And thank you for reading too, naturally.)

Red Dirt Ruby Conference – April 21-22, 2011 (Oklahoma City)

The Red Dirt Ruby Conference is a Ruby conference taking place in Oklahoma City this April. It’s shaping up to be a great event with keynotes from Aaron Patterson (Nokogiri) and Dr Nic Williams (Engine Yard). Expect sunny weather with temperatures in the low 70s..

Spreadable – Viral Marketing Tools for your Apps

Spreadable is a powerful ‘tell a friend’ referral tool you can easily plug into your site. Read More

By Peter Cooper / February 1, 2011

rubygems.pngRyan Davis has announced the release of RubyGems 1.5.0. It comes just a month after the release of 1.4 which, notoriously, didn’t work with Ruby 1.9.2. These problems have now all been ironed out and Ruby 1.8 and 1.9 users alike can safely upgrade (fingers crossed).

RubyGems is the popular (and official – as of Ruby 1.9) Ruby package manager with which most significant Ruby libraries and tools are distributed. The 1.5 release sees it pick up a few bug fixes and some enhancements, including:

  • Ruby 1.9 support
  • Post-build hooks that can cancel the gem install
  • Gem.find_files is now 40% faster (on Ruby 1.9)
  • Better errors for corrupt Gem files, including paths
  • A new UPGRADING documentation file to help with Ruby 1.9-related issues
  • gem update no longer erroneously tries to update RubyGems itself by default

To upgrade to RubyGems 1.5.0, run:

gem update –system

Alternatively, you can learn more in the new UPGRADING documentation, or if you don’t already have RubyGems for some reason, you can download it from RubyGems.org. Read More

By Peter Cooper / January 26, 2011

cleveralgorithms.pngClever Algorithms is a newly released book by Jason Brownlee PhD that describes 45 algorithms from the Artificial Intelligence (AI) field with Ruby-based examples. It’s well produced and, notably, free in its PDF and online formats. A print copy is available at a small cost.

The book kicks off with a chapter of background regarding AI and its problem domains and moves on to an array of algorithms in the probabilistic, neural networking, stochastic, swarm, and evolutionary spaces.

Ruby purists will note that even though the demonstrations are in Ruby, they’re not very Ruby like. Classes are rarely defined and using methods defined in the main context as functions is the order of the day. Read More

By Peter Cooper / January 21, 2011

Rails Ready is essentially just a shell script but one you might find useful if you’re running Ubuntu (or – update – CentOS) and want to get the installation process done and over as quickly as possible. It follows on rather nicely to our last post: Ruby Installer: Ruby and Rails on Windows in a Single, Easy Install!

If you have the time or you’re installing this on your main development machine, however, I would recommend following Ryan Biggs’ RVM based instructions (or my equivalent screencast) because RVM gives you more developer-level control later on (such as gem sets). Read More

By Peter Cooper / January 18, 2011

railsinstaller.pngRailsInstaller is a new project from Wayne E Seguin (of RVM fame) that brings RubyInstaller-style simplicity to getting Ruby and Rails set up on Microsoft Windows (XP, Vista, or 7). In a single wizard-driven installation you get Ruby 1.8.7-p330 (with DevKit), Rails 3.0.3, Git, and SQLite 3.

Rails Installer was developed with help from Luis Lavena (a Ruby on Windows expert) and Dr. Nic Williams (Engine Yard’s resident Australian comedian) and its release comes just weeks after Wayne was (re)hired by Engine Yard to work on new open source initiatives.

To get started, go to railsinstaller.org, download the “Rails Welcome Kit” and run the installer. Read More

By Peter Cooper / January 13, 2011

webkit.pngEloy Duran (of the Dutch Rails consultancy Fingertips) has put together an interesting side project: a WebKit plugin written in MacRuby. His ‘MacRubyWebKitPluginExample’ project on GitHub is a short, self contained example of how to pull it off, so it’s worth checking out if you want to do something similar. Eloy’s example simply allows Ruby code to be supplied by a text box in a WebView and then executed by MacRuby on the back end.

Here’s a video showing it in action:

Before you get too excited, there are some significant provisos. Eloy explains:

So it’s early days, but these problems seem surmountable, and in the interim it could be a useful technique for those of you building MacRuby OS X apps with custom WebKit WebViews. Read More

By Peter Cooper / January 12, 2011

Screen shot 2011-01-12 at 2.32.49 AM.pngParslet is a new “simple parser framework” for Ruby built by Kaspar Schiess. It follows the PEG (parsing expression grammar) style of parsing and its primary goals are to be simple, testable, and to have extensive and powerful error reporting features (something that Kaspar states Treetop sorely lacks).

If you’ve already used Treetop, you might wonder what the hoopla is about. The key difference is that Parslet does not generate code to represent the parsing grammars you create as Treetop does – it works directly from rules defined using standard Ruby syntax (Treetop has its own Ruby-esque grammar language). Parslet’s error messages are also significantly nicer than Treetop’s when you inevitably run into trouble with your grammar as they’re generated by Parslet itself and don’t spring from Treetop’s internally generated code. Read More

By Peter Cooper / January 11, 2011

jruby-new-logo.pngThe JRuby team has announced the release of JRuby 1.6.0 Release Candidate 1. The final release is still a little way off but the bulk of the work is in place. It’s billed as the “largest release of JRuby to date” which, given how awesome 1.5 was, is a big deal, especially as it adds initial Ruby 1.9.2 language and standard library compatibility (though 1.8.7 is still the “default”).

So, what’s new?

  • Ruby 1.9.2 language and API compatibility (use the –1.9 command line option to get it)
  • Ruby 1.9.2 stdlib included (even in jruby-complete.jar)
  • General performance and stability improvements
  • RubyGems 1.4.2 included
  • Experimental C extension support (!)

The JRuby team are especially keen for people to try out the new Ruby 1.9.2 support so that they can round out and perfect their 1.9.2 compatibility before the final release. Read More

By Peter Cooper / January 7, 2011

ruby-core.pngYou may imagine that the ruby-core mailing list is a 24/7 programming disco dealing with core Ruby implementation topics.. but no, it’s usually a low-traffic list with calm discussion of bugs and patches. This week, however, some Interesting Stuff™ has happened and the kimono has been lifted on a few issues including, notably, a potential Ruby 1.8.8.

Yui Naruse, one of the core Ruby committers, was trying to dispel myths that the Japanese-language ruby-dev mailing list is a hotbed of illicit Ruby implementation activity by inviting people to ask any implementation-related questions they liked in ruby-core. From the results of this, we can pick up a few tidbits:

What’s going on with Ruby 1.9.1? Read More