Open ezekg opened 8 years ago
For reference, here's an issue that was reported to me with a stack trace: https://github.com/ezekg/theme-juice-cli/issues/73
Similar behavior occurs for upload!
-- passing a Pathname object as the 'remote' argument raises an exception when the channel is closed. Converting the 'remote' to a string does not raise an exception -- in both cases the upload itself succeeds.
I think instead of write we could check for is_a?(StringIO)
i don't see it docmented that user can passin anything that accepts a write
I'm assuming the
Pathname
object implements thewrite
method, so this error is mistakenly thrown. Casting thePathname
object to a string fixes the issue, but this was rather hard to debug since the error message was about using an in-memory buffer.To reproduce,
To fix,
What if we automatically perform a
to_s
onPathname
objects to catch this?