You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reporter.rb
    path of file: ./repos/dawnscanner/lib/dawn
    
    the code of the file until where you have to start completion: require 'fileutils'

mo
    
    def write(output)

      puts output if @filename.nil?

      unless @filename.nil?
        # $logger.warn "I will use codesake.css, bootstrap.min.css and bootstrap.js stored in ./support/ directory" if @format == :html
        File.open(@filename, "w") do |f|
          f.puts output
        end
        $logger.info "#{@filename} created (#{output.length} bytes)"
      end