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

Author Archives: Peter Cooper

By Peter Cooper / December 5, 2008

Picture 3.pngEveryone’s favorite Australian Ruby developer, Dr. Nic Williams, has put together a handy slide presentation called How to Package Your Ruby Code where he demonstrates how he packages his various bits of Ruby code using RubyGems. His process is backed by his own NewGem, a library that generates a framework for a new Ruby gem, and Hoe by Ryan Davis.

In his explanatory blog post, Nic also ponders Perl’s CPAN (a gigantic archive of Perl modules) and the module installation process it offers. When you install a module, the tests for the module are run in real time immediately. Read More

By Peter Cooper / December 3, 2008

radvent2008.png If you read Ruby Inside in 2006, you might remember our 2006 Ruby Advent Calendar. It featured the first look at the then-new AWS::S3 library, offered a Ruby code formatter for blog posts (which I still use here!), some Ruby wallpapers, and a lot more.

2007 had no Ruby advent calendar, unfortunately, but this year Lakshan Perera, a Sri Lankan Ruby developer, has put together a good-looking 2008 Ruby Advent Calendar. Day one looked at rolling out a Sinatra and Sequel powered blog. Day two covered deploying Ruby apps with Phusion Passenger (which just hit version 2.0.4). Read More

By Peter Cooper / December 3, 2008

It’s time to thank those great companies and individuals who help keep Ruby Inside (and often other Ruby sites) going. Note: All descriptions and notes are written by Ruby Inside and are not directly influenced by the sponsors. As such, any opinions stated are those of Ruby Inside and not necessarily shared by the sponsor!

New Relic – Rails Performance Monitoring Systems

newreliclogo.pngNew Relic provides high-end performance monitoring solutions for Rails applications and they include 37signals and Shopify amongst their customers (very high praise indeed!) Recently New Relic launched an affiliate program (which you can still join), and has announced that almost 1000 customers now use RPM to manage their production Rails apps! Read More

By Peter Cooper / November 28, 2008

rubyconf-90secs.pngAt RubyConf 2008, other than giving his own Scaling Ruby talk, Gregg Pollack of EnvyCasts was hard at work getting summaries of all of the presentations from the speakers. In RubyConf 2008 in 90 Seconds you get a fast-fire summary of the summaries. In RubyConf in 31 Minutes you get a more complete record – good viewing for anyone who didn’t attend the conference as it gives you a good idea of what’s on the Ruby community’s mind.

One of the coolest features of RubyConf in 31 Minutes is that it’s hosted on Viddler, which has allowed Gregg to tag and comment on the video so that you can see who’s speaking and how to watch their full presentation as you’re watching them give the summary! Read More

By Peter Cooper / November 27, 2008

red-dragon-ref.png If you’ve ever investigated how to build your own compiler, you might be familiar with LLVM (Low Level Virtual Machine), a “compiler infrastructure” that makes it easy(ish) to create virtual machines, code generators, and optimizers of your own. It also has its own intermediate representation language that’s architecture independent and the instruction sets and typing system available are similarly language independent. In theory, if you want to build your own programming language and a compiler for it, LLVM will get you most of the way.

llvmruby is an attempt to bring LLVM’s power into the grasp of Rubyists. LLVM is typically used from C++, but llvmruby lets you use the LLVM compiler infrastructure directly from the Ruby interpreter. Read More

By Peter Cooper / November 22, 2008

rails22.pngRuby’s most popular Web application framework, Ruby on Rails, takes another giant step today with the release of Rails 2.2! It follows on just five months after Rails 2.1, but offers even more significant improvements, particularly in the areas of compatibility, internationalization, and documentation. Read David Heinemeier Hansson’s release post for a quick overview.

Ruby Inside’s sister site, Rails Inside, was launched alongside Rails 2.1 in June, and would, you’d think, be the ideal place for a post like this, but no. Rails is very significant to the Ruby world as a whole, so you’ll still get the biggest of the biggest Rails announcements here on Ruby Inside! Read More

By Peter Cooper / November 20, 2008

happy-xml.jpg HappyMapper is John Nunemaker’s attempt at “making XML fun again” for Rubyists by providing an object to XML mapping library with a succinct syntax. Essentially, you can use HappyMapper to rapidly turn XML into Ruby objects – even nesting them inside and referring to each other. This is powerful stuff. To install, just gem install happymapper

John’s own examples are powerful demonstrations of how it works, so check them out. The first is parsing the XML returned from Twitter. The statues and associated users in that XML can be processed (with the relationship maintained) with the following code:

class User
include HappyMapper

element :id, Integer
element :name, String
element :screen_name, String
element :location, String
element :description, String
element :profile_image_url, String
element :url, String
element :protected, Boolean
element :followers_count, Integer
end

class Status
include HappyMapper

element :id, Integer
element :text, String
element :created_at, Time
element :source, String
element :truncated, Boolean
element :in_reply_to_status_id, Integer
element :in_reply_to_user_id, Integer
element :favorited, Boolean
has_one :user, User
end

statuses = Status.parse(xml_string)
statuses.each do |status|
puts status.user.name, status.user.screen_name, status.text, status.source, ”
end

Added: Or.. Read More

By Peter Cooper / November 17, 2008

ruby18cast.pngEarlier this month, Rails Envy‘s Gregg Pollack gave a talk at RubyConf08 called Scaling Ruby (without the Rails). He answered questions like “How do existing Ruby applications use Threads/Processes to scale?”, “How do we implement an Event Driven application using Ruby EventMachine?”, “What are the current bottlenecks with speeding up Ruby and how can they be fixed?”, and “What does Ruby 1.9 bring to the table to speed things up?” From what I hear, it was a very well received and informative session.

Not all of us could be at RubyConf08, however, so Gregg has taken the whole Ruby scalability topic and put together a solid 40-minute screencast called Scaling Ruby (note: it is NOT a recording of the talkā€”but a separate, professional production). Read More

By Peter Cooper / November 14, 2008

ruby-best-practices.gifBack in March, Ruby developer Gregory Brown raised the idea of receiving donations so he could work on open source Ruby projects full-time. It went well, and out of this project came Prawn, a pure Ruby PDF generation library. Not one to rest on his laurels, Gregory’s now working on a book for O’Reilly called Ruby Best Practices, billed as “for programmers who want to use Ruby the way Rubyists do.” The book will cover how to design “beautiful” APIs and DSLs, along with lots of other general topics that will make your code more expressive and make you a better Ruby developer into the bargain. Read More

By Peter Cooper / November 13, 2008

roxy-new.pngWhen you want your objects to refer to / have associations with other objects, it can quickly become a complex procedure. Ryan Daigle to the rescue! Ryan has built Roxy, a “Ruby Proxy-Object Library.” He’s also put together an awesome blog post with the motivation for developing Roxy and some code examples showing how it works. Roxy gives you the ability to add some rather ActiveRecord-esque functionality to your classes and their instances.

Straight from the horse’s mouth:

Roxy is a basic proxy library that lets you quickly create proxies between your ruby objects. Its syntax is loosely based on Association Extensions in ActiveRecord as that is a well-known use of proxies. Read More

By Peter Cooper / November 8, 2008

merb.pngMerb – a much heralded, highly flexible Ruby-based Web application framework – has reached version 1.0 after two years of development. Congratulations to Merb’s creator, Ezra Zygmuntowicz, and to the large group of associated developers (such as Yehuda Katz and Matt Aimonetti) who’ve kept adding features and pushed Merb forward to be a significant alternative to Rails.

Ruby Inside has been some surveys for the past couple of months, and they still show that only 25% of Ruby Inside’s visitors have ever developed a Merb application. With the stability that the 1.0 release offers (older versions of Merb had a reputation – fair or not – for a constantly shifting API), it’s now a great time to give Merb a try. Read More

By Peter Cooper / November 5, 2008

tweetrow.gif Happy Election Night!

A few days ago, the Obama campaign ran another call for donations and offered the chance for ten donors to sit on the “Front Row to History” – basically the front row of an Obama event in Grant Park, Chicago. Rubyists Bruce Williams (of FiveRuns) and Damon Clinkscales (Austin on Rails) have made it into this group, and they’ve rapidly launched The Tweet Row to History (obamaftw.org) – a Twitter fuelled site with their up-to-the-minute adventures in Chicago.

Naturally, Bruce and Damon are flying the Obama banner pretty strongly, but this is a bipartisan site, so may whoever you voted for win! Read More

By Peter Cooper / November 4, 2008

rmine.pngRubyMine is an all new IDE for Ruby and Rails developers, developed by JetBrains (best known for Java IDE IntelliJ IDEA). RubyMine is built upon the IntelliJ IDEA platform and brings together all of the essential features you’d expect of an IDE (editor, debugging tools, source control integration, code completion, and so forth) along with lots of extra goodies specific to Ruby, such as GUI-based support for RSpec and Test::Unit.

The current release of RubyMine is billed as a “Public Preview” with a full release set for Q1 2009. This public preview is free to use for 30 days and JetBrains are keen to elicit feedback on their RubyMine forum in that time. Read More

By Peter Cooper / November 3, 2008

Here’s the latest events news in the Ruby and Rails worlds as of November, 2008. Please comment if you have other events to mention – people will see them, and we can possibly mention them on the next post:

rubyconf2008.png RubyConf08 – November 6-8, 2008 – Orlando, FL, USA

RubyConf celebrates its 8th birthday! This eighth international Ruby conference takes place at the Omni Orlando Resort at Championsgate in Orlando, Florida later this week. You can stay at the resort itself and enjoy three full days of Ruby conference goodness. The schedule looks ridiculously good – except Giles Bowkett got taken off the speakers list because some of the organizers wouldn’t understand what a sense of humor is even if it slapped them in the face. Read More

By Peter Cooper / November 1, 2008

ffi-useful.png Charles Nutter, of the core JRuby team, writes:

One of the largest problems plaguing Ruby implementations [..] is the ever-painful story of “extensions”. In general, these take the form of a dynamic library, usually written in C, that plugs into and calls Ruby’s native API as exposed through ruby.h and libruby.

The many compiled bridges between external libraries and Ruby pose a problem for alternate implementations like JRuby, because of the complexity involved in exposing internals of the implementation or expensive serialization in both directions. Instead, an interface is necessary so that instead of developing libraries that act only as unique bridges to others, we can just have one library that provides the interface to any arbitrary library of our choice. Read More