has_many_polymorphs
has_many_polymorphs copied to clipboard
commit bacaeb095f..., 'fix invalid byte sequence...' breaks gem on ruby 1.8.x
trafficstars
The new code in question is:
open(filename, :encoding=>"utf-8") do |file|
the error reported is:
open-uri.rb:32:in `initialize': can't convert Hash into String (TypeError)
The same error occurs using File.open:
File.open(filename, :encoding=>"utf-8") do |file|
Presumably this only works in Ruby 1.9. I'm building Ruby 1.9 now to check. In the latest Pickaxe book this is the method described for setting the encoding to utf-8 when using File.open:
File.open(filename, 'r:utf-8')
This method also doesn't work in 1.8.x
Also see comments on this commit:
http://github.com/fauna/has_many_polymorphs/commit/bacaeb095f5e8cf7427679b2755680ab24f8503e
reverted in this commit in a fork:
http://github.com/stepheneb/has_many_polymorphs/commit/fd531f3310b2fbcf06a9e46e7fe55d71f5585ae3