viking-biobot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/biobot.gemspec +1 -1
- data/lib/biobot/base.rb +4 -4
- data/test/biobot/test_base.rb +2 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/biobot.gemspec
CHANGED
data/lib/biobot/base.rb
CHANGED
@@ -22,10 +22,6 @@ module Biobot
|
|
22
22
|
@client = Jabber::Client.new(@jid)
|
23
23
|
@presence = Jabber::Presence.new
|
24
24
|
|
25
|
-
@client.add_message_callback do |message|
|
26
|
-
process(message) if message.body
|
27
|
-
end
|
28
|
-
|
29
25
|
@threads = []
|
30
26
|
end
|
31
27
|
|
@@ -45,6 +41,10 @@ module Biobot
|
|
45
41
|
@client.auth(@password)
|
46
42
|
@client.send(@presence)
|
47
43
|
|
44
|
+
@client.add_message_callback do |message|
|
45
|
+
process(message) if message.body
|
46
|
+
end
|
47
|
+
|
48
48
|
@@periodicals.each do |(method, delay)|
|
49
49
|
thread = Thread.new { loop { self.send(method); sleep(delay) } }
|
50
50
|
@threads << thread
|
data/test/biobot/test_base.rb
CHANGED
@@ -36,9 +36,9 @@ class TestBase < Test::Unit::TestCase
|
|
36
36
|
Biobot::Base.new(@config).start
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def test_registers_callback_on_start
|
40
40
|
@client.expects(:add_message_callback)
|
41
|
-
Biobot::Base.new(@config)
|
41
|
+
Biobot::Base.new(@config).start
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_message_processing_chain
|