Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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 #1

Merged
merged 2 commits into from over 2 years ago

2 participants

Jeremy Suriel Conrad Irwin
Jeremy Suriel

Make NoResponseError and BadResponseError connection failures compatible with Ruby 1.9

Conrad Irwin ConradIrwin merged commit 26df825 into from September 12, 2011
Conrad Irwin ConradIrwin closed this September 12, 2011
Conrad Irwin

Hi jrmey,

Thank you very much :). As a warning, I've not used em-imap on ruby-1.9 much at all.

Ultimately I'd like to stop depending on Net::IMAP quite so hackily, but in the meantime, please feel free to submit patches!

Conrad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Sep 02, 2011
Make NoResponseError and BadResponseError connection failures compati…
…ble with Ruby 1.9
b8e0c80
Sep 08, 2011
Make NoResponseError and BadResponseError connection failures compati…
…ble with Ruby 1.9
6fcb728
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  lib/em-imap/connection.rb
8  lib/em-imap/connection.rb
@@ -44,7 +44,7 @@ def listen_for_greeting
44 44
           if response.is_a?(Net::IMAP::UntaggedResponse) && response.name != "BYE"
45 45
             hello_listener.succeed response
46 46
           else
47  
-            hello_listener.fail Net::IMAP::ResponseParseError.new(response.raw_data)
  47
+            hello_listener.fail Net::IMAP::ResponseParseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
48 48
           end
49 49
         end.errback do |e|
50 50
           hello_listener.fail e
@@ -121,9 +121,9 @@ def listen_for_tagged_response(command)
121 121
           if response.is_a?(Net::IMAP::TaggedResponse) && response.tag == command.tag
122 122
             case response.name
123 123
             when "NO"
124  
-              command.fail Net::IMAP::NoResponseError.new(response.data.text)
  124
+              command.fail Net::IMAP::NoResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
125 125
             when "BAD"
126  
-              command.fail Net::IMAP::BadResponseError.new(response.data.text)
  126
+              command.fail Net::IMAP::BadResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.data.text : response))
127 127
             else
128 128
               command.succeed response
129 129
             end
@@ -155,7 +155,7 @@ def listen_for_failure
155 155
         # to hear any more, so we fail all our listeners.
156 156
         add_response_handler do |response|
157 157
           if response.is_a?(Net::IMAP::UntaggedResponse) && response.name == "BYE"
158  
-            fail Net::IMAP::ByeResponseError.new(response.raw_data)
  158
+            fail Net::IMAP::ByeResponseError.new((RUBY_VERSION[0,3] == "1.8" ? response.raw_data : response))
159 159
           end
160 160
         end
161 161
       end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.