Sha256: c4f9f9d18b44ca4bcf6f15b8dd5021ea164a3fa309044c2effa7b27588bd87f8

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require 'benchmark'
require File.join(File.dirname(__FILE__),'../lib/marvin')

LINES = [
  ":irc.darth.vpn.spork.in 366 testbot #testing :End of NAMES list",
  ":Helsinki.FI.EU.Undernet.org PONG Helsinki.FI.EU.Undernet.org :Helsinki.FI.EU.Undernet.org",
  ":testnick USER guest tolmoon tolsun :Ronnie Reagan",
  "LIST #twilight_zone,#42",
  ":WiZ LINKS *.bu.edu *.edu",
  ":Angel PRIVMSG Wiz :Hello are you receiving this message ?",
  ":RelayBot!n=MarvinBo@203.161.81.201.static.amnet.net.au JOIN :#relayrelay",
  ":SuttoL!n=SuttoL@li6-47.members.linode.com PRIVMSG #relayrelay :testing...",
  ":wolfe.freenode.net 004 MarvinBot3000 wolfe.freenode.net hyperion-1.0.2b aAbBcCdDeEfFGhHiIjkKlLmMnNopPQrRsStTuUvVwWxXyYzZ01234569*@ bcdefFhiIklmnoPqstv"
]
PARSERS = [Marvin::Parsers::RagelParser, Marvin::Parsers::SimpleParser, Marvin::Parsers::RegexpParser]

LINES.each do |line|
  
  puts "Processing: #{line}"
  puts ""
  cmd = []
  
  PARSERS.each do |p|
    parser = p.new(line)
    ev    = parser.to_event
    puts "Parser:  #{p.name}"
    if ev.nil?
      puts "Unknown Event"
    else
      puts ev.to_hash.inspect
    end
    puts ""
  end
  puts ""
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Sutto-marvin-0.1.20081120 test/parser_comparison.rb