Actions
Bug #6340
closedRedefine Net::HTTPResponse#to_ary to avoid implicit conversion errors
Bug #6340:
Redefine Net::HTTPResponse#to_ary to avoid implicit conversion errors
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Backport:
Description
I've hit a nasty and subtle bug in code using the deprecated Net::HTTPResponse to_ary conversion: https://github.com/joshfrench/rakismet/pull/17
Up to Ruby 1.9.2 the method generated a warning, but in 1.9.3 it's removed completely.
The problem is, array conversion still happened implicitly and without warnings, but the second variable (which should have been assigned with the response's body) did not get assigned at all.
I suggest redefining the method with an explicit exception to make this mistake less subtle.
Files
Actions