tkellem 0.8.9 → 0.8.10
Sign up to get free protection for your applications and to get access to all the features.
data/lib/tkellem/irc_server.rb
CHANGED
data/lib/tkellem/tkellem_bot.rb
CHANGED
@@ -340,7 +340,7 @@ class TkellemBot
|
|
340
340
|
|
341
341
|
def list
|
342
342
|
public_networks = Network.all(:conditions => 'user_id IS NULL')
|
343
|
-
user_networks = user.reload.try(:networks) || []
|
343
|
+
user_networks = user.try(:reload).try(:networks) || []
|
344
344
|
if user_networks.present? && public_networks.present?
|
345
345
|
r "Public networks are prefixed with [P], user-specific networks with [U]."
|
346
346
|
end
|
data/lib/tkellem/version.rb
CHANGED
@@ -5,16 +5,21 @@ include Tkellem
|
|
5
5
|
|
6
6
|
describe BouncerConnection, "connect" do
|
7
7
|
before do
|
8
|
-
u = User.create(:username => 'speccer')
|
9
|
-
u.password = 'test123'
|
10
|
-
u.save
|
11
|
-
tk = mock(TkellemServer)
|
8
|
+
@u = User.create(:username => 'speccer')
|
9
|
+
@u.password = 'test123'
|
10
|
+
@u.save
|
11
|
+
@tk = mock(TkellemServer)
|
12
12
|
@b = mock(Bouncer)
|
13
|
-
|
14
|
-
|
13
|
+
@bc = em(BouncerConnection).new(@tk, false)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should ignore blank lines" do
|
17
|
+
@bc.should_receive(:error!).never
|
18
|
+
@bc.receive_line("")
|
15
19
|
end
|
16
20
|
|
17
21
|
it "should connect after receiving credentials" do
|
22
|
+
@tk.should_receive(:find_bouncer).with(@u, 'testhost').and_return(@b)
|
18
23
|
@bc.receive_line("NICK speccer")
|
19
24
|
@bc.receive_line("PASS test123")
|
20
25
|
@b.should_receive(:connect_client).with(@bc)
|
@@ -22,6 +27,7 @@ describe BouncerConnection, "connect" do
|
|
22
27
|
end
|
23
28
|
|
24
29
|
it "should connect when receiving user before pass" do
|
30
|
+
@tk.should_receive(:find_bouncer).with(@u, 'testhost').and_return(@b)
|
25
31
|
@bc.receive_line("USER speccer@testhost")
|
26
32
|
@bc.receive_line("PASS test123")
|
27
33
|
@b.should_receive(:connect_client).with(@bc)
|
data/spec/irc_server_spec.rb
CHANGED
@@ -47,6 +47,14 @@ describe Bouncer, "connection" do
|
|
47
47
|
s.server_msg(IrcMessage.parse(":speccer!test@host ping :HAI"))
|
48
48
|
end
|
49
49
|
|
50
|
+
it "should ignore blank lines" do
|
51
|
+
b = mock("bouncer", :trace => nil)
|
52
|
+
b.should_receive(:failsafe).and_yield
|
53
|
+
s = em(IrcServerConnection).new('connected', b, false)
|
54
|
+
b.should_receive(:server_msg).never
|
55
|
+
s.receive_line("")
|
56
|
+
end
|
57
|
+
|
50
58
|
def tk_server
|
51
59
|
$tk_server ||= TkellemServer.new
|
52
60
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkellem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 43
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 10
|
10
|
+
version: 0.8.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Palmer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-02-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: eventmachine
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
requirements: []
|
181
181
|
|
182
182
|
rubyforge_project:
|
183
|
-
rubygems_version: 1.8.
|
183
|
+
rubygems_version: 1.8.11
|
184
184
|
signing_key:
|
185
185
|
specification_version: 3
|
186
186
|
summary: IRC bouncer with multi-client support
|