Closed marlinpierce closed 5 months ago
Neat, thanks! The only note I have is that it's probably preferable to return a Tempfile because the contents may be quite large and they'll otherwise be kept in memory.
@morphine00 I provided the download_file
method to return a file IO object. This should allow you to read in blocks, or read the beginning of the file, whatever you would do to avoid reading the whole contents into a string object in memory.. Assuming the URI.open
streams the input, it should provided the IO without reading the string contents into memory and without saving to a file, reading as it is available from the network interface.
This way, there is one method for those who want to handle large files without reading into memory and another method for those who want an easy way to read the contents in a string object.
Ah, I missed that detail, my apologies.
@marlinpierce I'm so sorry, I know it's been a while. When you have a moment, could you update your PR to resolve the conflicts? If you can't get to it now I completely understand, and in that case I'll make a new PR with your changes. I'd like to get this in for you. Thanks!
@bobbrodie the merge conflict is resolved. I'm looking forward to the 0.2.4
release.
Sounds great, thanks @marlinpierce. I've started a thread here about the next version. I think that being since it's been so long, and Ruby <= 3.0 are no longer supported, it probably makes sense to release a 3.0.0 version of the gem without those versions included.
If you're in a spot where that won't work, let's chat and we can sort out a 2.4.0 release that only has backward compatible changes.
If anyone else has feedback on that, I'd love to hear from others as well.
I do like the charm of the version being 0.2.4. The extra zero is a hint that it is also the year.
Adds methods to attachments to download the attachment contents.