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.
@@ -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
@@ -31,7 +31,7 @@ module IRCOutputAPI
31
31
  # method. Don't use puts manually. I will kill violaters. Legally
32
32
  # speaking, that is.
33
33
  def raw(line, report = true)
34
- @socket.puts line
34
+ @socket.puts "#{line}\r\n"
35
35
  report "bot: #{line.inspect}" if report
36
36
  end
37
37
 
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class YAIL
3
- VERSION = '1.4.4'
3
+ VERSION = '1.4.6'
4
4
  end
5
5
  end
@@ -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 ":#{SERVER} NOTICE AUTH :*** Looking up your hostname..."
80
+ add_output "NOTICE AUTH :*** Looking up your hostname..."
81
81
  @connected = true
82
82
  return
83
83
  end
@@ -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 2, @msg[:notice]
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.first[:text]
109
- assert_match %r|you are exempt|i, @notices.last[:text]
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: 15
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 4
10
- version: 1.4.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-03-22 00:00:00 -04:00
18
+ date: 2011-04-20 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21