I *hate* that.  The docs for `File.expand_path` name the second parameter as `dir_string` which implies it should be a *directory*, not an arbitrary path.  Furthermore, AFAIK `path/to/file/../anotherfile` is not accepted in any standard POSIX scenario, so writing paths relative to a file has undefined meaning.  For example, what if the file is a symlink to a file in another directory?  Does `..` mean the directory containing the symlink, or the directory containing the file?

Unfortunately the docs for `File.expand_path` go on to suggest using `__FILE__` in this inconsistent and semanticly incorrect manner, but I suspect that originated when someone noticed it worked due to a side-effect of the implementation, and then the approach stuck.