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

By Peter Cooper / March 23, 2010

In November 2007, we casually mentioned a new Ruby webapp library called Sinatra. It took a year to capture the imagination of the Ruby community as a whole and we eventually covered it in more depth but today we’re proud to (exclusively) announce that Sinatra has today reached its landmark 1.0 release!

Impromptu release party in the official #sinatra channel on irc.freenode.net, anyone? :-)

Sinatra is well known in the Ruby community for providing developers with a simple way to put together Web apps big and small. The canonical ultra-simple example:

require ‘rubygems’
require ‘sinatra’

get ‘/hi’ do
“Hello World!”
end

Sinatra’s lead developers — Ryan Tomayko, Simon Rozet, and Blake Mizerany — have done a great job, along with about 50 other contributors, to produce a slick and powerful Web application DSL for Rubyists. Read More

By grantmichaels / March 23, 2010

IronRuby is an open source Ruby implementation being developed at Microsoft with the .NET CLR in mind. It’s reasonably mature and as well being a regular implementation, it provides the ability to use Ruby directly within the Web browser through Microsoft’s Silverlight Flash-esque framework. Windows seems to get a bad rap in the Ruby community so we thought we’d turn the spotlight on some of the cool things IronRuby’s doing nowadays.

Being based on the .NET CLR presents some unique challenges for IronRuby. So far IronRuby passes 86% of the RubySpec (compared to a 98% pass rate for the MRI on Windows) but this number is creeping up every week. Read More

By Peter Cooper / March 20, 2010

MessagePack GitHub repo is a new binary-based object serialization protocol and library built with efficiency and speed in mind. Developer Sadayuki Furuhashi presents it as a faster alternative to JSON that has similarly broad support across several popular languages.

Serialization is the process of taking an object (such as a string, hash, or even something of your own creation) and turning it into a single time of data that can be transmitted down a network connection, stored in a file, or similar. Protocols like JSON, YAML, and XML are commonly used for this purpose, but for the highest efficiency, binary protocols are an alternative. Read More

By Peter Cooper / March 19, 2010

RubyFlow is Ruby Inside’s community driven sister site where you can post cool Ruby links you want to share (even of your own stuff). With 20–80 posts each week, there’s too much to cover on Ruby Inside, but I want to provide a regular roundup of the “best of” RubyFlow. This instalment covers early March — enjoy!

By Peter Cooper / March 19, 2010

EventMachine is a simple(ish), fast, event-driven I/O library for Ruby. Its goal is to provide highly scalable I/O performance with an easy-to-use API wrapped around the nastiest parts of the process (since typical Ruby coding practices aren’t particularly event-driven friendly). Aman Gupta has put together an awesome 114-page deck of slides (also available as a PDF) that walks through EventMachine with lots of practical code examples.

The presentation walks through:

  • Who uses EventMachine (a lot of big guys – Heroku, GitHub, 37signals, Engine Yard, PostRank)
  • What EventMachine is good for
  • Ruby’s other I/O solutions (and why they suck)
  • What a “reactor” is
  • How to write asychronous code with EventMachine’s API
  • How EventMachine provides event-compatible iterators and timers
  • EventMachine’s message channels

Even though Aman’s slides are meant to go alongside a live presentation, they stand well on their own and provide more than enough incentive to check out EventMachine is event-driven I/O is something that would benefit you, so stop reading this post and get flicking through Aman’s awesome slides! Read More

By Peter Cooper / March 15, 2010

Want to develop a Mac OS X app without getting waist deep in Objective C? MacRuby is the answer, and it’s now mature enough to use directly from XCode to build fully-featured Ruby-powered Mac apps. “Jean Pierre Hernandez” of Phusion presents a walkthrough of how to do it, step by step.

The tutorial walks through:

  • Creating a new project in XCode
  • Designing an interface with Interface Builder
  • Customizing form widgets
  • Writing a controller in MacRuby
  • Connecting the controller to the window

Any knowledge of XCode, Objective C, and Interface Builder will enable you to get through this walkthough a lot quicker, but it’s not essential. Read More

By Peter Cooper / March 9, 2010

rumap.pngRuby User Groups (RUGs, for short) are typically informal organizations put together to encourage Ruby developers with certain areas to get together, share ideas, and, often, to have some fun. If you’re lacking for inspiration or want to get to know some Rubyists within certain parts of the world (or just around the corner, if you’re lucky), heading to a Ruby User Groups’ meeting can open a lot of doors. But how can you find them?

RubyUserGroups.org

rugs.png

RubyUserGroups.org is a new site by Joe Pym and Karl Doody (who run the West Midlands RUG) that presents you with a map (centered on your current location) with all of the local Ruby user groups located. Read More

By Peter Cooper / March 8, 2010

vagrant_chilling.pngVagrant is a Ruby-based tool for building and deploying virtualized development environments. It uses Oracle’s open-source VirtualBox virtualization system along with the Chef configuration management engine along with lots of Ruby goodness to automate the creation and provisioning of virtual machines for development purposes.

If you thought rolling out new VMs using Amazon EC2 was easy, Vagrant brings an even simpler system to your local development machine. From the command line, starting is as easy as:

sudo gem install vagrant
vagrant box add base http://files.vagrantup.com/base.box
mkdir vagrant
vagrant init
vagrant up

Be warned, though – as a 370MB download, adding that box image isn’t a quick process! Read More

By grantmichaels / March 2, 2010

jruby1JRuby is undoubtedly the most mature of the alternative Ruby implementations. Supporting Ruby 1.8.7 and 1.9.1 (mostly!) and JIT compilation, JRuby is already in use in mission critical Ruby apps and runs scarily fast on the JVM. In this interview with JRuby core member, Charles Nutter, we dig deep into what makes JRuby tick.

A great deal of conversation on IRC, as well as quite a number of lengthly emails, were eventually corralled into the following Q/A session between Charles Nutter and myself.

JRuby and Rails are the ideal solution for building new enterprise web applications. With JRuby’s ability to seamlessly integrate with anything Java, and Rails’ strong REST principles, these new applications will be 100% WOA compliant themselves, and also may trivially extend WOA compliance to the underlying Java systems. Read More

By Peter Cooper / February 25, 2010

NewRelic_inline.pngNew Relic’s RPM, an application performance monitoring and reporting system, has today announced it has added full support for Sinatra and Rack-based Ruby applications to its traditionally Rails-centric service. It’s been possible to hack in support for non-Rails apps into New Relic before, but this move brings them officially into the fold with all of the features only Rails apps used to be able to take advantage of.

New Relic’s press release on the news includes a typically “press release sounding” quote from Ryan Tomayko, but as a key contributor to Sinatra and Rails, and as a GitHub employee, it seems worth quoting:

Rack has given Ruby web developers a tremendous amount of freedom to innovate and experiment with new ways of building web applications. Read More

By Peter Cooper / February 25, 2010

Over on the Ruby Best Practices blog, somenums.pngRobert Klemme walks through the process of building a new numeric class from scratch in Ruby – taking into account all the gotchas and considerations that pop up along the way. Robert’s task is harder and more involved than you’d initially suspect.!

Robert chooses to build a HexNum class that can represent integers that are then displayed as hex numbers. There are considerations to be made with handling conversions from existing numeric types and his new HexNum class, conversions to other types, supporting standard comparison methods, and overloading.

All of the above concerns are covered in the post with all the quality and detail you should expect from the RBP blog by now. Read More

By Peter Cooper / February 24, 2010

garbage.jpgGarbage Collection and the Ruby Heap is a presentation given by Joe Damato and Aman Gupta at the recent LA Ruby Conference. You only get the slides for now (all 70 of them!), but they’re very detailed and can almost work as a standalone concise e-book on Ruby’s garbage collection system.

Joe and Aman take a look at C memory management vs Ruby and show the difference between the stack and the heap. As a garbage collected language, Ruby takes the easy route by putting everything on the heap and the presentation demonstrates how the MRI (Matz’s Ruby 1.8) does this, as well as how objects are tracked within memory (right down to the underlying C structs). Read More

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

Recently Popular Posts