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
978 B
Ruby
Raw Normal View History

2013-08-18 15:11:16 -04:00
module RubyTest
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
def self.prof_on_start()
2013-08-18 17:22:14 -04:00
Prof::cons_show("RubyTest: on_start")
end
def self.prof_on_connect()
2013-08-18 17:22:14 -04:00
Prof::cons_show("RubyTest: on_connect")
end
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
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
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