Skip to content

Commit

Permalink
Merge pull request #3 from davidbalbert/support-ruby-2.0
Browse files Browse the repository at this point in the history
Fix changed method signature in Ruby 2.0
  • Loading branch information
tessro committed Sep 15, 2014
2 parents edddae2 + 878ea06 commit fc97765
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/net/imap/response_parser/gmail.rb
@@ -1,5 +1,5 @@
class Net::IMAP::ResponseParser::Gmail < Net::IMAP::ResponseParser
def msg_att
def msg_att(n = nil)
match(T_LPAR)
attr = {}
while true
Expand Down Expand Up @@ -34,7 +34,11 @@ def msg_att
when /\A(?:X-GM-THRID)\z/ni
name, val = uid_data
else
parse_error("unknown attribute `%s'", token.value)
if n # Ruby >= 2.0.0
parse_error("unknown attribute `%s' for {%d}", token.value, n)
else # Ruby <= 1.9.3
parse_error("unknown attribute `%s'", token.value)
end
end
attr[name] = val
end
Expand Down

0 comments on commit fc97765

Please sign in to comment.