I am trying to write a script which automatically checks out or updates a Subversion URL based on whether a specified directory exists or not.
For some reason, my co
All the other answers are correct, however, you might have problems if you're trying to check directory in a user's home directory. Make sure you expand the relative path before checking:
File.exists? '~/exists'
=> false
File.directory? '~/exists'
=> false
File.exists? File.expand_path('~/exists')
=> true