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

Author Archives: Peter Cooper

By Peter Cooper / December 7, 2010

databasecom.pngMany infrastructure companies have recently adopted a drip-feed pricing model – consider renting servers from Amazon EC2 or monitoring our servers with New Relic RPM. The cloud database industry is still in its infant stages but today Salesforce.com has kicked things up a notch in offering all of its enterprise-scale database technology in a new cloud database service, Database.com.

Last week, engineers at Salesforce gave me a briefing and ran through the system. I was impressed. With its public API and networked nature, Database.com is truly Ruby friendly and the ActiveSalesForce adapter for ActiveRecord can get things running quickly if you’re an ActiveRecord user. Read More

By Peter Cooper / December 7, 2010

It’s time for us to thank the companies who help keep Ruby Inside going by kindly sponsoring our work in return for a little community love. Luckily, they’re all interesting in their own right and have some worthwhile products to check out – no CashForGold or dating sites here!

New Relic — On-demand Application Management

New Relic is a Java and Ruby application performance and reliability monitoring and management service that started life as a Rails-only service (and it’s still great for that!). It’s truly enterprise-grade software but with the flexibility and accessibility of annual, monthly, or “on demand” pricing, catering to nearly all types of customer. Read More

By Peter Cooper / December 6, 2010

Summarize is a new Ruby library that provides bindings to the C-based Open Text Summarizer library. It’s an ideal way to get a “summary” of a document and esteemed Rubyist Jeremy McAnally used it in his RailsRumble-winning app TLDR.it.

Once installed (gem install summarize – if you’re lucky and have the dependencies), Summarize is easy to use since it adds a summarize method to the String class:

your_string.summarize(:ratio =25)

In this case, Summarize returns a summary approximately 25% of the length of the original string in your_string. Read More

By Peter Cooper / December 6, 2010

finches.pngSignificant and serious improvements to the core Ruby language come along as infrequently as TextMate updates. Given that TextMate has had an update recently, an important new Ruby feature was sure to be just around the corner and it is: refinements! Shugo Maeda (who works with Matz and developer of mod_ruby) presented the idea at RubyConf 2010 last month.

In a nutshell, refinements clear up the messiness of Ruby’s monkey patching abilities by letting you override methods within a specific context only. Magnus Holm has done a great write up of the concepts involved, and presents a good example:

module TimeExtensions
refine Fixnum do
def minutes; self * 60; end
end
end

class MyApp
using TimeExtensions

def initialize
p 2.minutes
end
end

MyApp.new # =120
p 2.minutes # =NoMethodError

In this example, rather than adding the minutes method to the Fixnum class in the typical way, it’s been added as a “refinement” within a module which is then used elsewhere to spread the context of the change. Read More

By Peter Cooper / November 29, 2010

rubymine.png JetBrains (of IntelliJ IDEA fame) has today released RubyMine 3.0, the latest version of its cross-platform Ruby and Rails IDE. It follows on almost 18 months to the day from RubyMine 1.0. Back then we noted that the public reception of RubyMine was strong and JetBrains have only made it better since then.

If you’re not already familiar with RubyMine, it’s a cross-platform Ruby and Rails IDE based upon IntelliJ IDEA (to me it’s always seemed faster than the Eclipse-based IDEs) that runs on Windows, Linux, and Mac OS X. It comes with a custom Ruby debugger, as well as version control integration (SVN, Git, Perforce and CVS) and support for several test systems out of the box (specifically RSpec, Cucumber, Shoulda, and Test::Unit). Read More

By Peter Cooper / November 26, 2010

rubydrop.png Ever used Dropbox? It’s awesome. A cross-platform (Windows, Mac, Linux, and even mobile) file syncing and backup service with 2GB for free (or 2.25GB if you sign up with this link). Well, if you’d like to roll out your own system on your own infrastructure, send some thanks to Ryan LeFevre, the creator of RubyDrop, an open source Dropbox clone based on Ruby and git.

Cloning Dropbox sounds like a tall order and in reality, “Dropbox clone” is a big stretch. RubyDrop is quite simple under the hood and focuses on the file syncing part of the problem. Read More

By Peter Cooper / November 22, 2010

mikeperham.pngIn The Ruby Stdlib is a Ghetto, Mike Perham argues that Ruby’s “standard library” (all the libraries that come by default with Ruby installs) is old and crufty and suggests some parts that should be removed.

The Problem

In case you’re unfamiliar with the term, the ever authoritative Urban Dictionary lists ghetto as, among other things:

an impoverished, neglected, or otherwise disadvantaged residential area of a city, usually troubled by a disproportionately large amount of crime

Anyone’s who recently looked up documentation for stdlib-dwelling libraries has probably been a little frustrated. I see rants and raves from time to time on IRC and Twitter and I’m often surprised at how much isn’t documented. Read More

By Peter Cooper / November 19, 2010

railszombies.pngRails for Zombies is an intriguing attempt to teach people how to use Ruby on Rails directly in the Web browser. It comes from Envy Labs (and specifically Gregg Pollack, once of RailsEnvy fame).

The goal of Rails for Zombies is to make the learning process immediately accessible and fun. You’re guaranteed to learn quite a bit too as the in-browser development environment frequently tests you and makes you actually do stuff rather than merely read learning material.

As Gregg points out, what you learn through R4Z won’t be quite enough for you to build your own version of Twitter (or even Twitter for zombies – arf arf) but it covers enough of the basics to put you in a better position to continue with more traditional learning techniques later. Read More

By Peter Cooper / November 14, 2010

appsumo.pngAppSumo is an intriguing “bad ass developer bundle” that brings together $1543 of credit for ten different Web app development related resources (most are Ruby focused or have Ruby APIs) for a mere $47 purchase.

The services include:

  • Twilio – an API driven telephony service (I use this — it’s great)
  • Heroku – the Ruby webapp hosting environment
  • Hoptoad – the errors notification service
  • New Relic – the performance monitoring and application management service
  • As well as Recurly, SendGrid, MongoHQ, SauceLabs, Infochimps and Linode.

Sadly I’m already signed up with most of these services and most of the credits are for new or upgraded accounts only, but if you want to give any of the above services a try or want to build a new app that relies on them, this looks like a steal. Read More

By Peter Cooper / November 10, 2010

If you’ve been following the Ruby scene for a while you’ll have heard of Gregory Brown. He’s the author of O’Reilly’s Ruby Best Practices, creator of the Prawn PDF library, and the head honcho of the Ruby Mendicant University. He does a lot of community funded Ruby work and his latest attempt to help fund his work is Practicing Ruby, an e-mail newsletter and discussion group dedicated to helping intermediate Rubyists to sharpen their skills.

Each week, Gregory will choose a topic that he thinks trips up intermediate Ruby developers from time to time and dig deep into it by sending background information along with discussion points and questions for readers. Read More

By Peter Cooper / November 10, 2010

In Making CI easier to do than not to with Hudson CI and Vagrant, Dr Nic Williams (of EngineYard) presents a walkthrough of setting up a VM-based continuous integration system in order to reliably test your apps across multiple setups:

It’s typically good stuff from everyone’s favorite doctor of Ruby. Read More

By Peter Cooper / November 10, 2010

herokufacebook.pngHeroku, a popular Ruby webapp hosting platform that’s picked up $13m in funding, has today unveiled their new Facebook App package. The package is aimed squarely at people wanting to develop Facebook apps and brings together several of Heroku’s main offerings in a single, discounted monthly package.

Facebook apps represent a sizable portion of the close to 100,000 apps currently being hosted on Heroku, so the company felt it was time to target them directly. The package offers a Ronin-level dedicated database, 20 worker/dyno processes, 1GB of Memcache, New Relic Gold, and $200 of “platform credit” to add other features (such as SSL or the Sendgrid e-mail system). Read More

By Peter Cooper / November 3, 2010

rom.pngA few days ago, Burke Libbey, a Winnipeg based Ruby and Rails developer, gave a presentation called Ruby’s Object Model: Metaprogramming and Other Magic to the Winnipeg.rb Ruby user group. I though it was interesting enough to embed here.

Presentations about metaprogramming and how the Ruby object model works are hardly anything new, but Burke has approached it in a friendly, easy to understand (though terse – but that’s why it’s a presentation) fashion, despite including the relevant C from MRI on the slides. Topics covered include how classes and objects are represented and related to each other, how singleton classes work, how method lookups work, and.. Read More

By Peter Cooper / October 26, 2010

chronic.pngTom Preston-Werner has pushed out version 0.3.0 of Chronic, the popular natural language date and time parsing library for Ruby. It’s a significant release because the last was 0.2.3 back in July 2007! Grab it now with gem install chronic

Despite the long time between releases, Chronic hasn’t gone without attention. It’s been sitting on GitHub and attracting patches for years, but Tom (who’s already pretty busy, y’know, running GitHub) has now decided to bundle it up and push it live.

What does 0.3.0 get you?

  • Improved time-zone support
  • Handles “on” in phrases like “10am on Saturday”
  • Now ignores commas (which could throw it off before)
  • Supports “weekend” and “weekday”
  • Allows numeric timezone offsets (e.g.
  • Read More

By Peter Cooper / October 22, 2010

treetop.pngTreetop is one of the most underrated, yet powerful, Ruby libraries out there. If you want to write a parser, it kicks ass. The only problem is unless you’re into reading up about and playing with parsers, it’s not always obvious how to get going with them, or Treetop in particular. Luckily Aaron Gough, Toronto-based Ruby developer, comes to our rescue with some great blog posts.

Aaron, who has a passion for messing around with parsers and language implementations, recently released Koi – a pure Ruby implementation of a language parser, compiler, and virtual machine. If you’re ready to dive in at the deep end, the code for Koi makes for good reading. Read More