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

Author Archives: Peter Cooper

By Peter Cooper / February 23, 2010

rbp.pngRuby Best Practices is a book by Gregory Brown (and published by O’Reilly) that looks into the “Ruby way” of doing things in the Ruby language and, specifically, why Rubyists tend to write Ruby the way they do. It’s an engaging book and we took a look at it and interviewed Gregory Brown about it just over a year ago.

Gregory always wanted to be able to give away his book with a Creative Commons license eventually and O’Reilly have kindly allowed him to start doing that, a chapter at a time. So far, the first five chapters are available to download at GitHub (in PDF format). Read More

By Peter Cooper / February 17, 2010

harmony.pngHarmony, from Martin Aumont, is a new Ruby DSL for executing JavaScript and DOM-using code from within Ruby apps. Why’s that cool? Well, it enables you to build your own Ruby-level unit tests for JavaScript code within your Web applications – everything can be under one set of test suites!

Harmony sounds like a significant piece of engineering, but really it’s a wrapper that stands on the shoulder of giants in the form of Johnson, which provides the Mozilla Spidermonkey Javascript runtime to Ruby, and env.js, a DOM environment recreated in JavaScript.

Harmony’s “Hello World” example:

harmony2.png

HolyGrail: The Rails Plugin

If you’re using Rails, HolyGrail is a plugin that brings the power of Harmony to your apps (so far in functional tests only). Read More

By Peter Cooper / February 12, 2010

ruby-quicktips.pngRuby Quicktips is a Tumblr-powered tumblelog (think of a blog but in bite-sized chunks) by Daniel Pietzsch that presents a growing array of Ruby related tips and interesting code snippets. Daniel seems keen for you to contribute, and you can do so on its submissions page. There’s an “about us” post if you want to learn more in general.

Daniel has done a good job of curating the 20 or so tips that he’s put up over the last couple of months, and I bet with your help, it could become a significant resource. Picking up a few tips each week is a great way to keep your mind fresh and the ideas flowing! Read More

By Peter Cooper / February 11, 2010

no-rails-allowed.gifSick of Rails 3.0 yet or still enjoying your Sinatra, Rango, Ramaze, Cramp, or totally non-Web-based development? OK – I’ve sniffed out 12 new, interesting Ruby related libraries or blog posts just for you! with no Rails whatsoever!

Buzzr: Google Buzz Library For Ruby

A few days ago, Google unveiled Buzz – its latest attempt to compete with Twitter and Facebook. Buzzr is a Ruby library by Conor Hunt that helps you interact with the Atom feeds that Buzz puts out.

VirtualBox Gem

VirtualBox is a popular, free and open source virtualization system that allows you to run multiple operating systems under your existing one (think VMware Workstation) and VirtualBox (same name) is also a Ruby library that you can use to control the eponymous program. Read More

By Peter Cooper / February 5, 2010

rails3logo.gif Whenever something’s a really “big deal” in the Ruby world, we cover it – even if it makes more sense on Rails Inside (which is now switching to a user contributions model). Given that, we’ve gone through all the latest and greatest Rails 3.0 related links and put together a ton of them to help you on your way with the recently released Rails 3.0 beta. Enjoy!

Getting Started / Must Reads

Rails 3.0 Release Notes – An epic amount of documentation from the Rails Guides project. If you’re already pretty familiar with Rails 2.x and just want to know what’s new and updated, this is the place to look first. Read More

By Peter Cooper / February 5, 2010

heroku-dog.gif Toto (GitHub repo) is a new lightweight Ruby and Rack-based blogging engine designed specifically for “hackers” by Alexis Sellier. Content is managed entirely through Git – so everything is version controlled – and articles are stored as text files with embedded YAML metadata. At only 300 lines, it’s easy to hack to your own taste, too.

Alexis has decided to push Toto by demonstrating how easy it is to deploy – for free – on the Heroku platform. You can literally get a blog up on Heroku within 5 minutes, even if you haven’t already got a Heroku account (I just tried it). Read More

By Peter Cooper / February 5, 2010

rails-3-logo.pngToday, Rails core member Jeremy Kemper dropped the words that lots of ardent Rails developers have been waiting for: “Rails 3 beta is LIVE.” It’s true! Rails 3.0′s first approved beta/pre-release version is now live and ready for you to install.

rails3betalive.png

Unfortunately, the installation process isn’t as easy as Jeremy explains. RubyGems doesn’t support the installation of prerequisites on pre-release gems, so you need to install them all manually. I think I have some instructions to cover that (works on 1.8.7 and 1.9.1):

gem install i18n tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler
# remember to prefix with “sudo” if your environment needs that

And then, finally:

gem install rails –pre

Worth reading next is a retrospective and summary of the work done for Rails 3.0 so far by Yehuda Katz. Read More

By Peter Cooper / February 2, 2010

macruby_logo.pngMacRuby has hit a significant milestone in its development today: version 0.5! The key features include improved HotCocoa support (though this is now maintained separately from core on GitHub), better Ahead-Of-Time (AOT) compilation, and support for OS X 10.6′s Grand Central Dispatch.

Give It A Go!

If you’ve got a Mac and haven’t yet tried out MacRuby, give it a go – its speed and general level of support for Ruby is very impressive. You can download MacRuby as a standalone package with installer (for OS X 10.6 and higher) or if you’re using RVM, do an update and then rvm install macruby to get the latest nightly build. Read More

By Peter Cooper / January 27, 2010

its-matz-baby.pngRuby’s creator and benevolent dictator Yukihiro “Matz” Matsumoto has done a video interview for InfoQ at the QCon enterprise software development conference. You can watch the video on InfoQ’s page (or, if you’re a member of InfoQ, download an MP3).

In the interview, Matz talks about what he’d do if he were recreated Ruby from scratch today, lazy evaluation, Erlang, actor models, typing, his opinions on alternative Ruby implementations, and continuations.

Matz also recommends reading O’Reilly’s Beautiful Code (Amazon link) but humbly advises against reading Chapter 29 – a chapter that he contributed to the book.

[jobs] The Ruby Inside jobs board has blown up this month with 14 jobs currently active. Read More

By Peter Cooper / January 26, 2010

the-ruby-show.gifIf you try to keep up with the Ruby community you’re probably familiar with the Rails Envy podcast, even if you aren’t subscribed. Well, it’s just relaunched as.. The Ruby Show, hosted by Jason Seifer and Dan Benjamin. They plan to cover the latest Ruby related news on a weekly basis in a similar style to Rails Envy. New episodes come out each Wednesday.

The latest episode of The Ruby Show includes bits on Cramp, the Rails 3 Bug Mash, Friendly, Rails 3 Generators, ActiveModel, and more.

The Background: Rails Envy was a weekly podcast by Gregg Pollack and Jason Seifer and featured Ruby and Rails news interspersed with comedy bits. Read More

By Peter Cooper / January 25, 2010

scottish-ruby-conference.pngIf you fancy a trip to the land of fried confectionary and heart disease, the Scottish Ruby Conference (previously Scotland on Rails) is selling tickets for its third event: Scottish Ruby Conference 2010. It takes place on 26-27 March, 2010 and the early bird tickets sold out in a mere 2 hours.. but there are full price tickets still available at £195 each (still a good deal really).

I’ve edged away from event specific mentions on Ruby Inside due to lack of interest, but the previous Scotland on Rails events attracted many suspiciously high caliber speakers (many not even from Europe) and lots of kudos from the community. Read More

By Peter Cooper / January 20, 2010

stophammertime.png Hammertime (GitHub repo) is a new interactive error console for Ruby by Avdi Grimm, modelled after those found in the Squeak/Smalltalk and LISP environments. It fills some of the same roles as ruby-debug, except in a less intrusive and more Ruby-esque fashion. Be warned though.. currently it’s for Ruby 1.8.x only.

Installation is via RubyGems (gem install hammertime) and the library is activated in your app with require ‘hammertime’. That’s it; you’re good to go. Once activated, any exception raised in your app will result in a Hammertime prompt appearing where you can choose from a number of options, including:

  • Continue (process the exception normally)
  • Ignore (proceed without raising an exception)
  • Permit by type (don’t ask about future errors of this type)
  • Permit by line (don’t ask about future errors raised from this point)
  • Backtrace (show the call stack leading up to the error)
  • Debug (start a debugger)
  • Console (start an IRB session)

For more info, a walkthrough of a basic debugging process using Hammertime is shown in Avdi’s Hammertime blog post. Read More

By Peter Cooper / January 16, 2010

http-is-a-hamster-on-rollerblades-says-marc-andre-cournoyer.gifNorwegian Rubyist August Lilleaas has been busy putting together a ton of examples of using the Net::HTTP Ruby library that comes with most Ruby distributions. I asked him if it’d be okay to put some of them directly on Ruby Inside for reference purposes and he said “No problem!”

It’s worth noting that Net::HTTP has been superseded in many areas by libraries like John Nunemaker’s HTTParty and Paul DIx’s high performance Typhoeus, but as part of the standard library, Net::HTTP is still a popular option though it doesn’t have the easiest API to remember.

Here’s a selection of August’s examples for some of the most common operations. Read More

By Peter Cooper / January 13, 2010

activemodel.gif One of the biggest benefits of bringing Merb developer Yehuda Katz on board to work on Rails 3.0 has been his relentless pursuit of extracting out all of Rails’ magical abilities from their monolithic encasings and into separate, manageable chunks. A case in point is ActiveModel, a new library that provides the model related parts of ActiveRecord but without the database requirements.

Get Rails-like Model Behavior on Any Ruby Class

In extracting the model-building parts of ActiveRecord, ActiveModel makes it possible to add model-like behavior to any Ruby class, with no Rails or databases required. In his latest blog post, ActiveModel: Make Any Ruby Object Feel Like ActiveRecord, Yehuda shows off how to get Rails-style models with validations, serialization, callbacks, dirty tracking, internationalization, attributes, observers and all the other Rails goodness. Read More

By Peter Cooper / January 8, 2010

Looking for a Ruby or Rails job? There are still some good ones out there. They’re getting posted daily on jobs.rubynow.com but we’ve got 6 special ones of our own that have come in via the Ruby Inside jobs board. Jobs this month come from the United Kingdom and the US (Portland, Chicago, Birmingham and Santa Barbara) and are, as usual, Rails heavy.

January 2010′s Jobs

billmonitor.png Rails Developer at BillMonitor (Oxford, United Kingdom) — Billmonitor is a British mobile phone comparison service and they’re looking for a Rails developer to work side-by-side with their Web design team to develop new features and functionality for their site. Read More