Sha256: 9772c8c6e6d07c6092a8c8ce9a3acd7139cdfbd155d0dc8a0aa63fc8b8072173
Contents?: true
Size: 650 Bytes
Versions: 32
Compression:
Stored size: 650 Bytes
Contents
require 'blather/client/dsl' $stdout.sync = true module Ping extend Blather::DSL def self.run; client.run; end setup 'echo@jabber.local/ping', 'echo' status :from => Blather::JID.new('echo@jabber.local/pong') do |s| puts "serve!" say s.from, 'ping' end message :chat?, :body => 'pong' do |m| puts "ping!" say m.from, 'ping' end end module Pong extend Blather::DSL def self.run; client.run; end setup 'echo@jabber.local/pong', 'echo' message :chat?, :body => 'ping' do |m| puts "pong!" say m.from, 'pong' end end trap(:INT) { EM.stop } trap(:TERM) { EM.stop } EM.run do Ping.run Pong.run end
Version data entries
32 entries across 32 versions & 3 rubygems