Could you do this with Dir.getwd ?