2013-08-18 15:11:16 -04:00
|
|
|
module RubyTest
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_init(version, status)
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: init, " + version + ", " + status)
|
2013-08-18 18:54:56 -04:00
|
|
|
Prof::register_command("/ruby", 0, 1, "/ruby", "RubyTest", "RubyTest", cmd_ruby)
|
|
|
|
Prof::register_timed(timer_test, 5)
|
2013-08-18 17:22:14 -04:00
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_on_start()
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: on_start")
|
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_on_connect()
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: on_connect")
|
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_on_message_received(jid, message)
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: on_message_received, " + jid + ", " + message)
|
2013-08-18 15:11:16 -04:00
|
|
|
end
|
2013-08-18 18:54:56 -04:00
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.cmd_ruby()
|
2013-08-18 18:54:56 -04:00
|
|
|
return Proc.new {
|
|
|
|
| msg |
|
|
|
|
|
|
|
|
if msg
|
|
|
|
Prof::cons_show("Ruby command called: " + msg)
|
|
|
|
else
|
|
|
|
Prof::cons_show("Ruby command called with no arg")
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.timer_test()
|
2013-08-18 18:54:56 -04:00
|
|
|
return Proc.new {
|
|
|
|
Prof::cons_show("Ruby timer fired.")
|
|
|
|
}
|
|
|
|
end
|
2013-08-18 15:11:16 -04:00
|
|
|
end
|