Dir.chdir
can change to an absolute path:
Dir.chdir("/var/spool/mail")
Can it change to a relative path such as:
Dir.chdir("log/spool/mail")
Yes, although the docs don't make it very clear, it can certainly do so.
See the following transcript, which first goes to the root directory then uses relative movement to get to /tmp
:
pax$ ruby <<EOF
...> puts ""
...> Dir.chdir("/")
...> puts Dir.pwd
...> Dir.chdir("tmp")
...> puts Dir.pwd
...> EOF
/
/tmp