Sha256: d753c813b77da4209363086196ebbb219e8e472e84d2868a486c3622977799fd
Contents?: true
Size: 575 Bytes
Versions: 1
Compression:
Stored size: 575 Bytes
Contents
#!/usr/bin/env ruby # -*- coding: utf-8 -*- $LOAD_PATH.unshift 'lib', '../lib' require 'rlyeh' require 'logger' class MyMiddleware include Rlyeh::Dispatcher on :privmsg do |env| p "Middleware: #{env.message}" end def initialize(app) @app = app end def call(env) dispatch env @app.call env end end class MyApp < Rlyeh::Base use Rlyeh::DeepOnes::Logger, :level => Logger::DEBUG use MyMiddleware on :privmsg do |env| p "MyApp1: #{env.message}" end on :privmsg do |env| p "MyApp2: #{env.message}" end end Rlyeh.run MyApp
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rlyeh-0.0.2 | examples/middleware.rb |