Ruby v1.9.1 does not have Dir.home, so we need a fallback

On ruby 1.9.1, the login method errors out with "NoMethodError: undefined method `home' for Dir:Class", since Dir.home was not introduced until ruby 1.9.2