Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from jrmey/master

If there was a connection error, it was failing with Ruby 1.9.  See https://github.com/ruby/ruby/blob/v1_9_2_290/lib/net/imap.rb#L3429-3440
  • Loading branch information...
commit 26df8251527a063608daffd8bc6b3b610b67103a 2 parents 8c0f454 + 6fcb728
@ConradIrwin authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/em-imap/connection.rb
View
8 lib/em-imap/connection.rb
@@ -44,7 +44,7 @@ def listen_for_greeting
if response.is_a?(Net::IMAP::UntaggedResponse) && response.name != "BYE"
hello_listener.succeed response
else
- hello_listener.fail Net::IMAP::ResponseParseError.new(response.raw_data)
+ hello_listener.fail Net::IMAP::ResponseParseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
end
end.errback do |e|
hello_listener.fail e
@@ -121,9 +121,9 @@ def listen_for_tagged_response(command)
if response.is_a?(Net::IMAP::TaggedResponse) && response.tag == command.tag
case response.name
when "NO"
- command.fail Net::IMAP::NoResponseError.new(response.data.text)
+ command.fail Net::IMAP::NoResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
when "BAD"
- command.fail Net::IMAP::BadResponseError.new(response.data.text)
+ command.fail Net::IMAP::BadResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
else
command.succeed response
end
@@ -155,7 +155,7 @@ def listen_for_failure
# to hear any more, so we fail all our listeners.
add_response_handler do |response|
if response.is_a?(Net::IMAP::UntaggedResponse) && response.name == "BYE"
- fail Net::IMAP::ByeResponseError.new(response.raw_data)
+ fail Net::IMAP::ByeResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.