viking-biobot 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{biobot}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeremy Stephens"]
@@ -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
@@ -36,9 +36,9 @@ class TestBase < Test::Unit::TestCase
36
36
  Biobot::Base.new(@config).start
37
37
  end
38
38
 
39
- def test_registers_callback
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viking-biobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Stephens