Update writer.rb

Fix file for use with ruby 1.9.3