def process_file(path)
      code      = File.read(path)
      sexp_node = RubyParser.new.parse(code)
      file      = Mago::RubyFile.new(path)

      sexp_processor = Mago::SexpProcessor.new(file, @ignore)
      sexp_processor.process(sexp_node)

      @report.files << file
      @on_file.call(file) if @on_file
    rescue Errno::ENOENT => err
      handle_error(err.message)
    rescue Racc::ParseError, Encoding::CompatibilityError => err
      msg = "#{path} has invalid ruby code. " << err.message
      handle_error(msg)
    end
def process_file(path)
      code      = File.read(path)
      sexp_node = RubyParser.new.parse(code)
      file      = Mago::RubyFile.new(path)

      sexp_processor = Mago::SexpProcessor.new(file, @ignore)
      sexp_processor.process(sexp_node)

      @report.files << file
      @on_file.call(file) if @on_file
    rescue Errno::ENOENT => err
      handle_error(err.message)
    rescue Racc::ParseError, Encoding::CompatibilityError => err
      msg = "#{path} has invalid ruby code. " << err.message
      handle_error(msg)
    end
Process a file and add a result to the report.

 @param path [String]

 @return [void]