Skip to content

Passing in a Pathname object as local for download! fails #29

Description

@ezekg

I'm assuming the Pathname object implements the write method, so this error is mistakenly thrown. Casting the Pathname 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,

download! "some/path", Pathname.new("/some/other/path").parent, {
  recursive: true
}

To fix,

download! "some/path", Pathname.new("/some/other/path").parent.to_s, {
  recursive: true
}

What if we automatically perform a to_s on Pathname objects to catch this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions