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

Update for Shrine 3.0 #37

Merged
merged 4 commits into from
Oct 21, 2019
Merged

Update for Shrine 3.0 #37

merged 4 commits into from
Oct 21, 2019

Conversation

janko
Copy link
Contributor

@janko janko commented Sep 25, 2019

In Shrine 2.x we've already stopped using the #download storage method (see shrinerb/shrine#331 for the rationale). So we can remove it here. The google client should already be doing resumable downloads in the #open method as well, so we shouldn't be losing anything by switching to #open.

Shrine 3.0 now requires the #open method to accept optional keyword arguments. We add the :rewindable option to allow people to disable Down::ChunkedIO's disk caching, which has become a convention across Shrine storages. We also forward any additional options Google::Cloud::Storage::File#download, to give people more control over downloading should they want it.

Lastly, we relax the shrine version constraint to allow Shrine 3.x. Shrine 3.0 isn't officially released yet, but we already have a beta that seems pretty stable, and we'll soon be releasing a RC, so it would be nice if people can already test with GCS.

It's not used anymore in Shrine. The downloads should be resumable in
Storage#open as well, so we shouldn't be losing anything by having only
Storage#open.
@janko
Copy link
Contributor Author

janko commented Sep 25, 2019

I also remembered the Shrine 3.0 requires #open to raise Shrine::FileNotFound on missing file. I'm not sure to how detect it properly, so I was hoping to get some help from you, I added some placeholder code.

I initially wanted to still keep allowing Shrine 2.x, but the new Shrine::FileNotFound exception doesn't exist in 2.x, so I bumped the shrine version specifier to >= 3.x.

@renchap
Copy link
Owner

renchap commented Sep 25, 2019

Thanks @janko!
I am currently on vacation, I will review this and test my app with Shrine 3 once I am back (after the 7th of october). Feel free to ping me if I forget :)

@janko janko force-pushed the shrine-3-0 branch 2 times, most recently from 5f5e4a7 to 099389d Compare September 28, 2019 11:06
@steveclarke
Copy link

Any update on merging this request? I'm ready to upgrade to Shrine 3.0 and this is a blocker. Much appreciated!

@renchap renchap merged commit c5da8ef into renchap:master Oct 21, 2019
@renchap
Copy link
Owner

renchap commented Oct 21, 2019

Thanks @janko!
This will go in the 3.0.0 release of this gem, as this is a breaking change. I will publish it soon.

@janko
Copy link
Contributor Author

janko commented Oct 21, 2019

Thanks! Just a reminder that this PR was still missing detecting unknown file in #open.

@renchap
Copy link
Owner

renchap commented Oct 21, 2019

Woops sorry, I missed this and I was minutes away from releasing the new version. I will have a look then :)

@renchap
Copy link
Owner

renchap commented Oct 21, 2019

I just opened #40 for this.

@renchap
Copy link
Owner

renchap commented Oct 22, 2019

Shrine 3.0 compatibility has just been released in version 3.0.0 🎉

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

Successfully merging this pull request may close these issues.

3 participants