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

By Peter Cooper / May 13, 2010

Need a new Ruby or Rails job? They’re getting posted daily on jobs.rubynow.com but we’ve got 8 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 and, as is proving typical, are Rails heavy.

Ruby on Rails Developer (San Francisco, California)

SideReel is a fast-growing Web site with millions of users that aims to be the center of the online TV world! They are looking for an experienced Ruby on Rails software engineer to help build a community-based site focused on helping people find entertainment online. Read More

By Peter Cooper / May 12, 2010

Following on five months after the release of the popular JRuby 1.4, the JRuby team have delivered JRuby 1.5!

Forgetting the de facto “official” Ruby implementations of 1.8.x and 1.9.1/2, JRuby is the fastest and most stable Ruby implementation available and already has 9 years of progress under its belt. JRuby takes a lot of its performance and versatility from running on the Java Virtual Machine (JVM), which has provided JRuby’s developers with a solid base from which to optimize how Ruby is implemented.

JRuby 1.5.0′s release notes provide the full detail, but essentially the biggest new features are:

  • Native launcher for UNIX-based platforms
  • Ant support (effectively a Java based built tool, a la make)
  • Rails 3 related fixes
  • Updates to the standard library, RubyGems, and RSpec
  • ruby-debug is now included
  • Significantly improved Windows support (a breath of fresh air for Windows-based Ruby developers used to getting second best in the Ruby world)
  • Overall performance improvements

I don’t use JRuby in production myself, but everyone I know who does attests to its stability and performance. Read More

By Peter Cooper / May 7, 2010

Pusher is a new Web service from New Bamboo that makes it easy to push data to users of your web applications “live”, outside of the request response cycle. They’ve embraced Web Sockets technology and built a REST API to which you can post events. Its flexible channels are based on a publish/subscribe model and you can send events as JSON which communicate with all connected browsers.

Websockets are part of the specification for HTML5, and are essentially long-running native TCP connections in the browser. These allow a client to establish a connection to a server, and have immediate feedback when there are events they need to be notified of. Read More

By Peter Cooper / May 5, 2010

Dropbox is a popular file hosting service (4m+ users) that provides synced backup and file hosting to OS X, Windows, and Linux users. You get up to 2GB of space for free. RDropbox is a library by Tim Morgan (of Autumn fame) that takes advantage of the official Dropbox API from Ruby.

With RDropbox you can log into a Dropbox account using OAuth and then upload and download files. A requirement, however, is that you apply for Dropbox API access and are approved, as the API is not fully open to the public without going through the approval process (this appears to be in order to avoid overloading their service). Read More

By Peter Cooper / May 5, 2010

In the UK there’s a cliché that goes: “You wait hours for a bus, and then three come along at once!” So it went with these three Ruby date and time libraries. They all made an appearance on RubyFlow last week and are all useful in their own ways, depending on how you’re working with dates and times.

ice_cube – Fast querying and expansion of event recurrence rules

ice_cube is a library by John Crepezzi that provides “fast querying and expansion of recurrence rules in Ruby.” What this means is that you can create schedules powered by date recurrence rules that can be quite complex (e.g. Read More

By Peter Cooper / April 28, 2010

When you want to inspect your objects in Ruby, Object#inspect, p, or awesome_print are all valuable. You’re stuck with plain-text, though, and primarily designed to look at object data rather than object models. If you want to drill down into parent classes, see object and class relationships, etc, then, check out DrX, a visual object inspector for Ruby!

DrX bills itself as a “small object inspector”, but its key features are that it shows results visually (in a GUI interface) and that it focuses on showing the object model behind your objects, rather than the data contained within. A visual example of a DrX session should give you the idea:

Usage

Once DrX is installed (more on that in the next section), you just require ‘drx’ it into your app (or even within irb) and then use the Object#see method to get DrX into action:

require ‘drx’
123.see

Even this rudimentary example will bring up an interesting graph. Read More

By Peter Cooper / April 28, 2010

Nestful is a simple HTTP/REST client library for Ruby, developed by Alex MacCaw (of Juggernaut) fame. Nestful allows you to consume basic Web services easily, usually in a single line of code. It can deal with JSON, buffered downloads, and callbacks out of the box.

HTTParty is the current, de-facto simple HTTP/REST client library used by most Rubyists (when net/http won’t do or when Typhoeus is too overkill) but Nestful differs enough from HTTParty to live alongside it. While HTTParty encourages you to build up some structure and separate the types of resources you’re accessing into classes (that HTTParty then extends), Nestful offers a simpler, “just call a method from anywhere” approach. Read More

By Peter Cooper / April 27, 2010

Cinch (or GitHub repo) is a new Ruby “microframework” for creating IRC bots. Effectively, Cinch is a library that both abstracts away all of the complexities of dealing with IRC servers and presents a DSL for rolling out your own functionality.

Cinch’s Hello Bot example demonstrates how you can easily create a bot that connects to an IRC server (irc.freenode.org), joins a channel (#cinch) and then replies to greetings:

irc = Cinch.setup :verbose =true do
server “irc.freenode.org”
nick “Cinchbot”
channels %w(#cinch)
end

irc.plugin “hello” do |m|
m.reply “Hello, #{m.nick}!”
end

irc.run

Cinch isn’t the first attempt at building a DSL for creating bots in Ruby. Read More

By Peter Cooper / April 20, 2010

Coderpath is a weekly podcast by Ruby developers Miles Forrest and Curtis McHale where they typically interview a different Ruby developer and discuss some of their current work. Most of the episodes are in an interview format and guests so far include a handful of Ruby developers you’ll know (such as DHH and Ryan Bates).

The latest episode is a 35 minute interview with Wayne E Seguin, the developer of Ruby Version Manager. Before that was yours truly, sounding like a total crackhead. Coming up next week is Obie Fernandez of HashRocket.

Here are the episodes so far:

Naturally, you can subscribe via iTunes or use their direct podcast feed with your favorite podcatching software. Read More

By Peter Cooper / April 19, 2010

The latest installment of our series of roundup posts, covering some of our latest findings in the world of all things Ruby. These items wouldn’t make it in as separate posts, but they should be of enough interest to Rubyists generally to make it a worthwhile browse for most readers.

Camping 2.0 Released

Back “in the day”, a gentleman and scholar called Why The Lucky Stiff built a teeny, tiny webapp framework called Camping. It was like an extremely light mix of Rails and Sinatra, except that Sinatra didn’t even exist at the time. In late 2009, Why went missing and still hasn’t reappeared, but Magnus Holm picked up the torch and has released Camping 2.0. Read More

By Peter Cooper / April 14, 2010

Three years after Microsoft first announced it was dipping a toe into the Ruby implementation waters, IronRuby 1.0 has been released. IronRuby is Microsoft’s attempt at bringing Ruby natively to the DLR that runs on top of .NET (and Mono), and with version 1.0, it has finally reached maturity with Jimmy Schementi calling it the “first stable version.”

IronRuby 1.0 is available to download in two different forms – a .NET 4.0 Windows installer or ZIP file, and a .NET 2.0 SP1 Windows installer or ZIP file. The .NET 4.0 version has faster startup times and is more feature complete (in terms of .NET integration) but the .NET 2.0 SP1 version will run on the Mono cross-platform, open source .NET platform. Read More

By Peter Cooper / April 7, 2010

awesome_print is a Ruby tool that provides “pretty printing” support for your objects. It’s a bit like p, pp or, if you prefer, puts obj.inspect, but with significantly improved, contextual, colored output. Its creator and maintainer is Michael Dvorkin of Fat Free CRM fame.

Being able to see “inside” Ruby objects on the fly can prove useful whether you’re debugging some code your tests did not dare reach or you’re just playing around in irb. The most common way to examine objects is with p or the inspect method, but these don’t format their output in a particularly easy-to-read way. pp – part of the standard library – is a pretty printer that improves matters but it still leaves a lot to be desired. Read More

By Peter Cooper / April 1, 2010

Hot on the heels of Sinatra 1.0 comes the official release of Padrino (or GitHub repo), a webapp framework that provides an extra layer of functionality on top of Sinatra (like helpers, generators, admin interface, and internationalization). Padrino is Sinatra 1.0 compatible.

Developers Davide D’Agostino, Nathan Esquenazi and Arthur Chiu love Sinatra and its development philosophy, but want to provide a deeper, standardized layer of functionality on top of the typical Sinatra stack. True to form, Padrino extends Sinatra with a wealth of extra features:

  • Namespaced route aliases
  • Nested routes
  • Controllers
  • i18n / Internationalization
  • Mailer system
  • Django-esque admin interface
  • Unified logging
  • Tag, asset, for, and tag helpers for use in views
  • App, model and controller generators

Most of these features can be added to Sinatra already, either manually or by selecting from a wide assortment of independent plugins. Read More

By Jimmy Schementi / April 1, 2010

With Microsoft’s IronRuby and Silverlight, Ruby can become a first-class citizen in the browser on Windows, Linux and OS X.. think <script type=”text/ruby”> – yes, it’s possible! This walkthrough will get you started with using Ruby in the browser for HTML and vector-graphics-based applications. IronRuby enables Web developers to use Ruby to write client-side browser applications and even reuse code between the server and the client.

Background

IronRuby is a Ruby 1.8.6-compatible implementation, with ever-increasing support for 1.9 features that runs on Microsoft’s Common Language Infrastructure. The CLI blesses IronRuby with some powerful features like an efficient just-in-time compiler and sophisticated garbage collector. Read More

By Peter Cooper / March 26, 2010

Supermodel is a new library by Alex Maccaw that uses the Rails 3.0 ActiveModel library to provide ActiveRecord-esque in-memory “database” storage in Ruby.

Supermodel is best demonstrated with a basic example:

require ‘supermodel’

class Person < SuperModel::Base; end

a = Person.new( :name => “Jim” )
a.save

Person.find_by_name(‘Jim’) # => #<Person>
Person.all # => [#<Person>]

This is just the start! Out of the box, Supermodel supports validations, callbacks, observers, dirty change tracking, and serialization. It also allows you, with only a little magic, to go beyond ephemeral memory-only structures and marshall your SuperModel-based objects to disk or even to a Redis store. Read More

Recently Popular Posts