Try
raw = File.open(fname).read
Edit: The problem with this is that it doesn't close the file, as OP stated.
However this does work with ruby 1.9.3p448:
raw = File.open(fname, &:read)
This is just to demonstrate the use of the &/symbol representation of a block in ruby. As sawa points out, in actual practice one would ordinarily do:
raw = File.read(fname)