1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00
profanity/plugins/RubyTest.rb

38 lines
1002 B
Ruby
Raw Normal View History

2013-08-18 15:11:16 -04:00
module RubyTest
def RubyTest.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
def RubyTest.prof_on_start()
Prof::cons_show("RubyTest: on_start")
end
def RubyTest.prof_on_connect()
Prof::cons_show("RubyTest: on_connect")
end
def RubyTest.prof_on_message_received(jid, message)
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
def RubyTest.cmd_ruby()
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
def RubyTest.timer_test()
return Proc.new {
Prof::cons_show("Ruby timer fired.")
}
end
2013-08-18 15:11:16 -04:00
end