File.write

Update: Yay, Ruby 2.0 comes with a IO.write! Use that instead. (Remember that File inherits IO.)
class File
  def self.write(filename, data, mode = "w")
    open(filename, mode) do |file|
      file.write(data)
    end
  end
end

Demo

File.write("/tmp/test", "Hello world!")