net-yail 1.4.4 → 1.4.6
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/lib/net/yail/event.rb +5 -0
- data/lib/net/yail/output_api.rb +1 -1
- data/lib/net/yail/yail-version.rb +1 -1
- data/tests/mock_irc.rb +1 -1
- data/tests/tc_yail.rb +7 -6
- metadata +4 -4
data/lib/net/yail/event.rb
CHANGED
@@ -107,6 +107,11 @@ class YAIL
|
|
107
107
|
data[:server?] = false
|
108
108
|
end
|
109
109
|
|
110
|
+
# Since "from" is something of a standard we rely on for all kinds of messages, we default
|
111
|
+
# to an empty string so that at the least one can rely on not getting a crash for some of
|
112
|
+
# the edge cases (like "NOTICE :ERROR from foo.bar.com")
|
113
|
+
data[:from] ||= ""
|
114
|
+
|
110
115
|
case msg.command
|
111
116
|
when 'ERROR'
|
112
117
|
data[:type] = :error
|
data/lib/net/yail/output_api.rb
CHANGED
data/tests/mock_irc.rb
CHANGED
@@ -77,7 +77,7 @@ class MockIRC
|
|
77
77
|
# Handles a connection command (USER) or errors
|
78
78
|
def handle_connected(cmd)
|
79
79
|
if cmd =~ /^USER (\S+) (\S+) (\S+) :(.*)$/
|
80
|
-
add_output "
|
80
|
+
add_output "NOTICE AUTH :*** Looking up your hostname..."
|
81
81
|
@connected = true
|
82
82
|
return
|
83
83
|
end
|
data/tests/tc_yail.rb
CHANGED
@@ -99,14 +99,15 @@ class YailSessionTest < Test::Unit::TestCase
|
|
99
99
|
wait_for_irc
|
100
100
|
assert_equal 1, @msg[:welcome]
|
101
101
|
assert_equal 1, @msg[:endofmotd]
|
102
|
-
assert_equal
|
102
|
+
assert_equal 3, @msg[:notice]
|
103
103
|
|
104
104
|
# Intense notice test - make sure all events were properly translated
|
105
|
-
assert_equal ['fakeirc.org', 'fakeirc.org'], @notices.collect {|n| n[:server]}
|
106
|
-
assert_equal ['', ''], @notices.collect {|n| n[:nick]}
|
107
|
-
assert_equal ['AUTH', 'Bot'], @notices.collect {|n| n[:target]}
|
108
|
-
assert_match %r|looking up your host|i, @notices
|
109
|
-
assert_match %r|you are exempt|i, @notices
|
105
|
+
assert_equal ['fakeirc.org', 'fakeirc.org', ''], @notices.collect {|n| n[:server]}
|
106
|
+
assert_equal ['', '', ''], @notices.collect {|n| n[:nick]}
|
107
|
+
assert_equal ['AUTH', 'Bot', 'Bot'], @notices.collect {|n| n[:target]}
|
108
|
+
assert_match %r|looking up your host|i, @notices[0][:text]
|
109
|
+
assert_match %r|you are exempt|i, @notices[1][:text]
|
110
|
+
assert_match %r|ERROR|i, @notices[2][:text]
|
110
111
|
|
111
112
|
# Test magic methods that set up the bot
|
112
113
|
assert_equal "Bot", @yail.me, "Should have set @yail.me automatically on welcome handler"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-yail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 6
|
10
|
+
version: 1.4.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Echols
|
@@ -15,7 +15,7 @@ autorequire: net/yail
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-20 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|