Travis-CI -- A Distributed Continuous Integration Platform

Travis-bickle

How healthy does your application feel?

You can measure the health of your Ruby projects easier with Travis-CI.

Travis-CI is a distributed build platform for Ruby applications. It’s the easiest continuous integration service for Ruby that I have ever used. Set up your project by first signing in to Travis-CI via your Github account. Then simply flip on a service hook for any public Ruby project you have on Github that you want Travis-CI to build.

Whenever you make a commit, Github sends a notification to Travis-CI. Travis-CI fetches your code, runs the default rake task (or a custom build script), and notifies you of the result — a fairly standard CI workflow. But Travis-CI has an impressive architecture. Travis-CI runs on Heroku, and leverages resque for queueing build requests. Developed using Backbone.js, the front-end application updates build and queue status receiving events from the application via Pusher.

But what has got me most excited about this project are the intangibles.

I set up Jsonify on Travis-CI quite easily, but my first build failed. I received the failure notification via e-mail, but before I had even had a chance to investigate, Michael Klishin of the Travis-CI team members, pointed out that I had Ruby 1.9 specific code in my specs, but I had not configured my Travis builds to run against 1.9.

In no time at all, I configured my builds to only run against Ruby 1.9. Not only that, but it motivated me to remove those Ruby compatibility issues. In a short time, I fixed the problems, configured .travis.yml for Ruby 1.9 and 1.8.7, and my builds were green.

Travis-CI allows you to configure a build matrix for your project, based on a number of different criteria including the Ruby version, Gemfile, and environments. The Ruby on Rails builds recently moved to Travis-CI, and DHH rightfully raved about this killer feature.

The other thing I like about Travis-CI is that the team is committed to building a solid system, first — not sacrificing stability for features. There’s a lot of room in Travis-CI for developers to help out. Travis-CI is using a lot of interesting technologies which should make development fun. If you are looking for an open-source project to help out on, Travis-CI is one that has a lot to offer and is going to make a big difference in the open-source world.

Creating a Rails3 Custom Template Handler

While the technique for creating Rails 3 custom template handlers is not particularly well-documented, it was pretty easy to setup. Here’s the code that I used for Jsonify.

require 'action_view'

module ActionView
  module Template::Handlers
    class JsonifyBuilder < Template::Handler
      include Compilable

      self.default_format = Mime::JSON

      def compile(template)
        "json = ::Jsonify::Builder.new();" +
          template.source +
        ";json.compile!;"
      end
    end
  end
end

ActionView::Template.register_template_handler :jsonify, ActionView::Template::Handlers::JsonifyBuilder

Then in my gemspec I added …

s.add_dependency "actionpack", "~> 3.0.0"

My next task … implement unit tests for this code … any tips?

Builder-style JSON views for Rails applications

I have been scratching an itch lately that I am pretty excited about ...

A lot of my Ruby and Rails coding includes building RESTful APIs, typically presenting data (representations) in both JSON and XML formats. In my opinion, these representations are part of the view layer of the application. That is, I want to be able to peer into the views folder and see files that correspond to my controller actions.

Rails provides great support for XML views via Builder, but JSON representations do not have the same support.

Jsonify provides this ability.

Say Hello to Orkie

P12

I have really been enjoying taking care of this orchid I fondly named "Orkie".

Plants and I don't normally get along so well. But this little guy I think of as a pet. And, you know, that makes it easier to care for him.

I keep a misting sprayer close by for lite morning showers. My wife also has a friend who has about 60 orchids. She is on call should we have any concerns.

By the way, the anti-psychotics seem to be working good.

1 of 1
Posterous theme by Cory Watilo