Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UploadedFile: Handle content being a Pathname
Dynamic languages... Can't live with them, can't live without them. In #149, we added support for `UploadedFile` being an `StringIO `object, by means of the `if content.respond_to?(:read)` logic. _However_, that had the unintended consequence of breaking the use case when a `Pathname` is provided instead of a string as the `content` paramer, since a `Pathname` _also_ responds to the `read` message... This PR works around that, by adding some extra checking. As an added bonus, I also added some YARD comments to make it more clear what parameter types this method expects/accepts. Fixes #207.
- Loading branch information