Ruby IMDB script to order & rate a list of films

I should paste this short script that I've written for converting an unordered list of films into a list ordered by the IMDB score (and also tagged with the genres). It worked great for tidying up the 350+ list of "you must see this" films that people have recommended to me through the years..

It will take an unordered list (with optional bracketted year to improve matching accuracy), e.g.:

The East (2013)
Shutter island
Stephen Fry: The Secret Life of the Manic Depressive
The Departed
Alan Partridge: Alpha Papa
Only God Forgives
You've got mail
Withnail & I
The Draughtsman's Contract
The Deal
Winter's Bone
A World Apart (1988)
We need to talk about Kevin

and will return:

<<<< RESULTS >>>> 
The Departed:  8.5  #Crime #Drama #Thriller
Stephen Fry: The Secret Life of the Manic Depressive:  8.2  #Documentary
Shutter Island:  8.1  #Drama #Mystery #Thriller
We Need to Talk About Kevin:  7.5  #Drama #Thriller
The Draughtsman's Contract:  7.3  #Comedy #Drama #Mystery
Winter's Bone:  7.2  #Drama
A World Apart:  7.1  #Drama
Alan Partridge: Alpha Papa:  7.1  #Comedy
The East:  6.9  #Crime #Drama #Thriller
You've Got Mail:  6.5  #Comedy #Drama #Romance
Only God Forgives:  5.8  #Crime #Drama #Thriller
The Deal:  5.7  #Comedy #Romance

=== Not Found... ===
Withnail & I

You can then paste this list into something like Workflowy or TaskPaper and navigate via the hashtags to filter by genre.

It's available as a Gist. To install, clone the gist, run bundle install, add your films to the provided film_list file, and run ruby IMDB.rb.

iOS 7 Custom Transitions - basic example

There's really not much sample code knocking around for iOS 7 custom transitions yet (or else Google is broken..): I guess that NDA is still only freshly lifted.

I've put together a simple example of how to present a new UIModalPresentationCustom-style Modal UIViewController with a UIViewControllerTransitioningDelegate managing the show. Have a play with this, it's simple enough to be self explanatory and useful for experimenting with - I hope it helps.

View the source on GitHub

Useful resources:

RubyMotion OSX NSTableView example

(using AutoLayout)

I struggled a little to get a basic NSTableView working in RubyMotion, coming from an iOS background, as I couldn't find any conclusive 'hello world'-esque examples. So, here's mine.

clone on github

It's also useful to see how to create your first window, as the difference between NSViewController and NSWindowController isn't immediately obvious either. There's a helpful explanation of this on StackOverflow.

Once I'd got it working, I converted it to use AutoLayout. Note the sequence that I use to setup AutoLayout:


I find this sequence helps categorise what can be a complicated setup (if it were a more complicated controller, at least).

To get started (note that RubyMotion 2 is required for OSX support):

bash $ cd motion-nstableview-example $ rake