3 Sep 2012

RubyMotion is ready for the primetime

If you’ve been following the Ruby community at all over the last few months you have probably heard of RubyMotion. Quite simply put, it lets you write iPhone and iPad apps using Ruby, by compiling to a native iOS app. Out of the box, your code will look very similar to Objective-C code and use the same Cocoa Touch libraries, although it will all be Ruby. It was written by Laurent Sansonetti, the author of the MacRuby project, which it’s largely based on. I have long been intrigued by writing iOS apps, but have been put off by the steep…read more

13 Jun 2012

Meteor: Rails for JavaScript

The last while I heard a lot of good things about Meteor, a Javascript application framework. Over the last few years, starting with sammy.js and then backbone, a million others similar frameworks have been popping up all over the show.  To get an idea, just have a look at all the available framework demos TodoMVC, or all the previews at TodoMVC labs. Enter Meteor So with all these options, what makes meteor special? To get a sense of the magic, I urge you to head on over the website and watch the screencast. No really, go and watch it, it’s really worth it.…read more

12 Mar 2012

What the hell is a Hypermedia API, and why should I care?

Ruby on Rails has recently announced that the HTTP patch method will become the new primary HTTP method for updates. A lot of discussion as well as general Rails bashing ensued all over the internet, as well as a storm of tweets. My favorite however, was from Ryan Dahl, the creator of node.js:     And so to the possible annoyance of Mr Dahl, I would like today to delve deep into realms of Http nerdom, and discuss the new  hotness in REST: The Hypermedia API. I have seen it being mentioned more often lately and I decided to try…read more

5 Jan 2012

Hosting your own gem server, simply

So why would you want to host your own gem server? Well recently, I had to share some in-house code between different proprietary rails apps. We needed this code and all it’s dependencies to be easily installed on different development machines and we wanted to support multiples versions of the code in the Rails apps. Does this sound like a job for rubygems and bundler? Yes? Well that’s what I thought too, except for fact that for bundler to find a gem, it needs to be available in one of the sources in your Gemfile. Like I mentioned, this was…read more

8 Dec 2011

A survey of the Ruby-MongoDB landscape

There are quite a few ways to consume MongoDB using Ruby out there, so much so that it can actually be a bit confusing. In this post will attempt at giving a brief outline of all the options available to you. To decide which are the most popular mongo gems worth mentioning, I had a look at what ruby-toolbox has to say and used some of my own research and experience. It seems that most mongo gems tends to fall in one of three camps: High-level ActiveRecord/Datamapper  like: Mongomapper & Mongoid Lightweight: mongomatic & mongo_odm Native driver: The MongoDB Ruby driver Mongomapper and Mongoid The…read more

6 Dec 2011

Google analytics and Haml

Recently, at work I had to  setup google analytics for a Rails 3.1 site using Haml. I ran into a snag or two along the way and this how I solved them. First off, in my application layout Haml file, I created the following js filter to add the analytics script   google_account_id is loaded from a yaml config file. We had created two analytics web properties: one for our test/dev environment and another for production. The test property is just to test that analytics is working and receiving data, but since it was running from a non-public url (I…read more

23 Nov 2011

The Rails 3 asset pipeline in (about) 5 minutes

Even though the asset pipeline was announced a few months ago and has been available in Rails 3.1 for a while now, it’s taken me some time to getting  to complete understanding what it’s all about. I’ve tried to condense what I’ve learned here in a post that you can hopefully digest in 5 minutes or so. The basics As David Heinemeier Hansson said at Railsconf 2011, the asset pipeline has one main goal, that is to make it easy to treat assets such as js code and css as first class citizens in your Rails app. Practically it does…read more