Description
We're trying to make Refile compatible with JRuby. We've almost made it (and it was fairly easy, I have to admit!), but we have one remaining bug.
In Refile we're using file wrappers, that is, we wrap an actual IO into a class which responds to #read
, #eof?
, #close
and #size
. This is all it takes to act as a real IO, because we can now pass them to IO.copy_stream
, and it will work. However, when we wrap images (which are binary), IO.copy_stream
raises an Encoding::UndefinedConversionError
. The error doesn't happen if we pass the image IO directly, only when we use a wrapper (ActionDispatch::Http::UploadedFile
or Refile::File
, they both fail).
We weren't able to reproduce the problem (I posted an attempt of reproducing it), so we were hoping you could help us out. The pull request is refile/refile#187. I think you only need to run bundle install
to set up the test suite, the branch is jruby
on my fork.