Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment download contents #422

Merged
merged 5 commits into from
Apr 6, 2024

Conversation

marlinpierce
Copy link
Contributor

@marlinpierce marlinpierce commented Dec 22, 2023

Adds methods to attachments to download the attachment contents.

@morphine00
Copy link

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.

@marlinpierce
Copy link
Contributor Author

marlinpierce commented Dec 29, 2023

@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.

@morphine00
Copy link

Ah, I missed that detail, my apologies.

@bobbrodie bobbrodie added the Enhancement Enhancements to existing features label Apr 1, 2024
@bobbrodie bobbrodie added this to the v2.4.0 milestone Apr 1, 2024
@bobbrodie
Copy link
Member

@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!

@marlinpierce
Copy link
Contributor Author

@bobbrodie the merge conflict is resolved. I'm looking forward to the 0.2.4 release.

@bobbrodie bobbrodie merged commit 29c506c into sumoheavy:master Apr 6, 2024
@bobbrodie
Copy link
Member

bobbrodie commented Apr 6, 2024

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.

@marlinpierce
Copy link
Contributor Author

I do like the charm of the version being 0.2.4. The extra zero is a hint that it is also the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't get attachment contents, seems jira-ruby might be using the wrong endpoint?
3 participants