lib/rlyeh/deep_ones/parser.rb in rlyeh-0.0.2 vs lib/rlyeh/deep_ones/parser.rb in rlyeh-0.1.1
- old
+ new
@@ -1,20 +1,24 @@
require 'ircp'
+require 'rlyeh/logger'
module Rlyeh
module DeepOnes
class Parser
+ include Rlyeh::Logger
+
def initialize(app)
@app = app
end
def call(env)
begin
message = Ircp.parse env.data
env.message = message
- @app.call env
+ env.event = message.command.to_s.downcase
+ @app.call env if @app
rescue Ircp::ParseError => e
- p e
+ debug "#{e.class}: #{e.to_s}"
end
end
end
end
end