Allow RailsSchemaUpToDate to work in directories with numbers

When trying to commit a migration with an ancestor directory that
happened to have a number in it, such as:

  /Users/hhd418/project/db/migrate/20140101123011_my_migration.rb

this pre-commit hook would erroneously report the following error:

> The latest migration version you're committing is 418, but your schema
> file /Users/hhd418/project/db/schema.rb is on a different version.

This was happening because the code that was looking for the "version"
in the filenames was just running a quick regex to find one or more
digits on the full migration file path, which included the user's home
directory that had a number in it. When this happened, it was coming up
with the number in the directory instead of the number in the filename.

To fix this, I added a `File.basename` before running the regex. This
seemed more readable and safer than changing the regex to be something
more specific, such as:

  /\d+(?=_)

Fixes #74.

Change-Id: Iee891c54d46acd53279c4a609b01b245aa4ade16
Reviewed-on: http://gerrit.causes.com/42076
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Tom Dooner <tom.dooner@brigade.com>
Reviewed-by: Henric Trotzig <henric.trotzig@brigade.com>