File.open(name, mode) receives a block, executes it, and then closes the file.
A programming language can't figure out what the inverse of open() is without someone somewhere telling it to close(). The point of the idiom is to have a library figure that out so that users don't have to. Therefore, Ruby supports it fully (there where API developers are sane, that is).
Case by case, the block scoping idiom is a good way to handle it.