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

Author Archives: Peter Cooper

By Peter Cooper / January 7, 2010

got-the-cramp.pngCramp (GitHub repo)is a new, asychronous evented Web app framework by Pratik Naik of 37signals (and the Rails core team). It’s built around Ruby’s EventMachine library and was designed to use event-driven I/O throughout – making it ideal for situations where you need to handle a large number of open connections (such as Comet systems or streaming APIs.)

Out of the box, Cramp relies on Rails 3.0-pre’s ActiveSupport and ActiveModel libraries (and won’t work with earlier versions). Using these, it presents you with two layers to develop: controllers and models. Cramp controllers are ostensibly Rack compliant (Rack was designed primarily for synchronous scenarios) but Thin is currently the only HTTP daemon that can run Cramp apps due to its asynchronous app support. Read More

By Peter Cooper / January 4, 2010

coffeescript.png CoffeeScript (GitHub repo) is a new programming language with a pure Ruby compiler. Creator Jeremy Ashkenas calls it “JavaScript’s less ostentatious kid brother” – mostly because it compiles into JavaScript and shares most of the same constructs, but with a different, tighter syntax.

Interesting trivia: Jeremy was inspired to create CoffeeScript based on code he saw while reading Create Your Own Programming Language by Marc Andre Cournoyer!

To get a feel for the language, check out this example code (CoffeeScript on the left, resulting JavaScript on the right):

cofeescriptdemo.png

As a Ruby project, you can get the CoffeeScript compiler installed with a simple gem install coffee-script or check out the code from/on GitHub. Read More

By Peter Cooper / January 4, 2010

rackamole.pngRackamole (GitHub repo) is a Rack application that lets you to monitor the interactions between users and your own Rack-based application (e.g. any Rails or Sinatra app). As well as pumping out information to the console or a log file, there’s a Web interface called Wackamole to give you the skinny on your app activity.

Rackamole’s creator, Fernand Galiana (also of ZiYa charting library fame), says that Rackamole is well suited for determining what parts of your application you need to work on next. It traps and records feature usage, performance issues, and application exceptions, and by integrating as a middle layer between your HTTP server and your Web app, it can work with almost any backend system out of the box. Read More

By Peter Cooper / December 22, 2009

superfriends.pngOvert humor isn’t usually Ruby Inside’s thing, but it’s the holiday season, so there’s nothing wrong with kicking up your heels and having a little fun. Don’t worry – this won’t become a habit. Promise! After the fold, check out a chart showing how programming language fanboys (Ruby’s included) see each other’s respective languages.

language-fanboys.jpg

There’s a higher resolution version available.. Read More

By Peter Cooper / December 21, 2009

friendly.png Friendly is a new Ruby ORM (a la ActiveRecord) that lets you easily use NoSQL ideas on regular database engines, such as MySQL. Developer James Golick has written a blog post introducing Friendly that goes into detail on how it works – with code examples. Effectively you get schema-less, document-like storage (with indexes!) but based around MySQL.

If you’re not familiar with “NoSQL“, it’s a blanket/branding term (somewhat like AJAX or Web 2.0) that covers non-relational forms of databases that, typically, have no need for SQL. A common subset of NoSQL technologies is the “document-based database,” as provided by systems like CouchDB or MongoDB (for which RailsTips author John Nunemaker has evangelized strongly). Read More

By Peter Cooper / December 16, 2009

ninh-bui.pngPhusion Passenger and Ruby Enterprise Edition developers Ninh “Hernandez” Bui and Hongli Lai travelled to San Francisco last week and gave a 35 minute Google Tech Talk called Building A More Efficient Ruby Interpreter.

The talk focused on how the guys (with some help from other sources, including Joe Damato and Aman Gupta) have dug into MRI Ruby 1.8′s internals to get some significant memory usage and thread performance improvements for their Ruby Enterprise Edition branch (they’re not calling it a fork) of Ruby 1.8.

The video is presented in HD so the slides are easy to see and the audio is solid. Read More

By Peter Cooper / December 10, 2009

love-your-library.pngI love checking out new Ruby libraries, and recently many new ones have passed my eyes. The most prominent releases get their own post on Ruby Inside, but often there are less significant libraries that I’d struggle to write 100 words about yet still contribute to Ruby’s lifeblood. This post aims to round up a selection of my recent discoveries.

RConfig – Powerful Ruby configuration management

RConfig, by Rahmal Conda, bills itself as a “complete solution for Ruby configuration management” and it certainly has a compelling feature-set. It supports YAML, XML, and properties files (a bit like INI files) and provides a short hand global access to application configurations in both enumeration-based and dot-notation/method forms. Read More

By Peter Cooper / December 7, 2009

red-specs.pngIt’s long been a bone of contention in the Ruby world that Ruby, as a programming language, doesn’t have an official spec (though RubySpec has been a noble, community effort to build an executable specification for Ruby). Now, though, there’s a draft, official Ruby specification available for you to check out- based on Ruby 1.8.7 (which some aren’t happy about).

From the announcement:

For wider and more application of Ruby language, “Ruby Standardization Working Group” has been established under Information-technology Promotion Agency, Japan (IPA) to define the specification of Ruby language on Oct. 2008. Since then the WG has been drafting the specification of Ruby language. Read More

By Peter Cooper / December 7, 2009

head-palm-slap.png Uh oh, it’s upgrade time again. Today, the official Ruby 1.9 maintainer (Yuki Sonoda, a.k.a. Yugui) announced a heap overflow vulnerability in Ruby 1.9.1 and, subsequently, the release of Ruby 1.9.1-p376 (patch level 376). As the current production level release of Ruby, this is a crucial upgrade – unless you’re still using Ruby 1.8.x, which isn’t affected at all.

As well as fixing the vulnerability, Ruby 1.9.1-p376 also includes over 100 bug fixes on the previous release, none of which are particularly interesting. You can check this release’s change log to see if anything affects you.

If you want to download Ruby 1.9.1-p376 now, the following URLs will work direct:

Further, Danny Tatom has put together a PKGBUILD file for Ruby 1.9.1-p376 for Arch Linux users. Read More

By Peter Cooper / November 27, 2009

amp.png Amp is a new Ruby based project that aims to “change the way we approach VCS” (version control systems). Currently it’s basically a port of the Mercurial version control system – a common alternative to the Git system that’s more popular in Rubyland – but it aims to abstract things to the point where it could be used in place of Git, Bazaar, SVN, CVS, Darcs, and so forth.

The creators of Amp believe that while there are lots of great repository formats out there, none of the official clients are “truly good software” and so they’re aiming to build something that abstracts away all of the pain into a heavily customizable Ruby library and client. Read More

By Peter Cooper / November 21, 2009

maglev.pngMagLev is a new(ish) Ruby implementation built by Gemstone Systems that focuses on providing an integrated object persistence layer and a distributed shared cache – a truly scalable Ruby implementation. Maglev has, however, had an air of vaporware about it, having been hyped up in early 2008 and only available to a small group of alpha testers till now. That changes today with the first public, alpha release!

Back in early 2008, MagLev program manager Bob Walker did an interview with InfoQ about the project where he said that 8 people were working on MagLev, so this is a pretty big deal for them. Read More

By Peter Cooper / November 20, 2009

Looking for a Ruby or Rails job in this economy? They’re still there! They seem to be getting posted daily on jobs.rubynow.com but we’ve got 5 of our own that have come in via the Ruby Inside jobs board.

If you want to post a job to our job board check out our new Post A Job page. It explains it all. It’s $249 for 60 days of exposure with a link on all Ruby Inside and Rails Inside pages, exposure through Simply Hired, and inclusion on a post like this that goes out to all 22,000 subscribers. Most ads get 1-2,000 direct views during their run (and linked from about 240,000 pageviews on our sites in all). Read More

By Peter Cooper / November 18, 2009

macruby05.png MacRuby, a port of Ruby 1.9 to the Mac OS X Objective C common runtime, is today one step closer to a production-ready Ruby implementation with the release of beta 2 of MacRuby 0.5. MacRuby 0.5 has been highly anticipated since it was first mentioned back in March because it promises significant performance improvements, a new LLVM based virtual machine (replacing YARV), and significant compatibility improvements and bug fixes. Even still at this beta stage, 0.5 delivers on these promises.

New in MacRuby 0.5 so far:

  • rdoc and ri now work – thanks to compatibility bug fixes
  • Rack and Sinatra support
  • Experimental support for BigDecimal, OpenSSL, and JSON extensions
  • Compiler with support for building fat binaries (i.e.
  • Read More

By Peter Cooper / November 11, 2009

emailIcon.pngTo date, the main ways to send e-mails from Ruby have been Net::SMTP, TMail, and Rails’ ActionMailer (which uses TMail). Now, however, there’s a fourth option, the simply named “mail” by Mikel Lindsaar.

Mail is a new pure Ruby library designed to handle the generation, parsing, and sending of e-mail in a “Rubyesque” manner. Both the sending and receiving e-mails can be handled through the library and, where necessary, Mail proxies methods from libraries like Net::SMTP and Net::POP3. Ruby 1.9 support has been built in from day one so dealing with different text encodings in your e-mails is easier than ever (Mikel claims this is less than straightforward with TMail). Read More

By Peter Cooper / November 10, 2009

rubies2Welcome to the latest installment in the series of compilation posts summarizing some of my latest findings in the world of all things Ruby. Let’s tackle those links..

Alchemist: Easy Unit Conversion in Ruby

Alchemist is a new Ruby library that aims to take the pain out of performing translation with day to day units, such as miles, kilograms, kelvin, meters, and becquerels. There are a few ways you can perform conversions such as explicitly with a method: 8.meters.to.miles or inline: 10.kilometers + 1.mile. The library’s source code is quite something to look at – there are units I’ve never even heard of before. Read More