Any reason you chose not to go with [`Pathname#relative_path_from`](http://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html#method-i-relative_path_from) here? This feels a bit like a hack and like we're relying on a heuristic. If it's possible to avoid string manipulation like this, I think it's worth a try. :)