From 2fdcb17098eb941c41a09e6a3dcb8a6f7cdefcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janko=20Marohni=C4=87?= Date: Mon, 29 Apr 2024 09:51:12 +0200 Subject: [PATCH] Bump to 3.6.0 --- CHANGELOG.md | 10 ++++++++++ doc/release_notes/3.6.0.md | 23 +++++++++++++++++++++++ doc/storage/s3.md | 10 ++++++++++ lib/shrine/version.rb | 2 +- website/sidebars.json | 1 + 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 doc/release_notes/3.6.0.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ba45a2c..3f8988261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 3.6.0 (2024-04-29) + +* Add Rack 3 support (@tomasc, @janko) + +* Make a copy of attacher context hash when duplicating the attacher (@reidab) + +* An uploaded file can be implicitly re-opened after it has been closed (@jrochkind) + +* Add new `:copy_options` for initializing the S3 storage (@hkdahal) + ## 3.5.0 (2023-07-06) * Migrate website to Docusaurus v2 (@janko) diff --git a/doc/release_notes/3.6.0.md b/doc/release_notes/3.6.0.md new file mode 100644 index 000000000..1f06cfac1 --- /dev/null +++ b/doc/release_notes/3.6.0.md @@ -0,0 +1,23 @@ +--- +title: Shrine 3.6.0 +--- + +## New features + +* The S3 storage now accepts `:copy_options` when initializing. This can be used for supporting Cloudflare R2 by removing `:tagging_directive` when copying file from temporary to permanent storage. + + ```rb + Shrine::Storage::S3.new(bucket: BUCKET, copy_options: {}, **s3_options) + ``` + +## Other improvements + +* Rack 3 is now supported. + +* When duplicating the attacher, the `Attacher#context` hash is now copied as well, instead of being kept the same between the two attachers. + +* After `UploadedFile#close` was called, `UploadedFile#opened?` will return `false` and the uploaded file can be implicitly re-opened again. + +## Backwards compatibility + +* Shrine API that is returning a rack response triple will now return headers as an instance of `Rack::Headers` on Rack 3, which is a subclass of `Hash`. This should keep user code that references header names in mixed case working (in addition to lowercase), but could theoretically cause issues for code explicitly requiring headers to be an instance of `Hash`. diff --git a/doc/storage/s3.md b/doc/storage/s3.md index 345902b5b..fa68ef7c9 100644 --- a/doc/storage/s3.md +++ b/doc/storage/s3.md @@ -124,6 +124,16 @@ uploader.upload(file, upload_options: { acl: "private" }) the uploader level won't be forwarded for generating presigns, since presigns are generated using the storage directly. +## Copy options + +If you wish to override options that are passed when copying objects from +temporary to permanent storage, you can pass `:copy_options`: + +```rb +# Removes default :tagging_directive, which isn't supported by Cloudflare R2 +Shrine::Storage::S3.new(copy_options: {}, **s3_options) +``` + ## URL Host If you want your S3 object URLs to be generated with a different URL host (e.g. diff --git a/lib/shrine/version.rb b/lib/shrine/version.rb index 839be8edc..99e651824 100644 --- a/lib/shrine/version.rb +++ b/lib/shrine/version.rb @@ -7,7 +7,7 @@ def self.version module VERSION MAJOR = 3 - MINOR = 5 + MINOR = 6 TINY = 0 PRE = nil diff --git a/website/sidebars.json b/website/sidebars.json index 3a6c686e3..668f63a03 100755 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -109,6 +109,7 @@ }, "release_notes": { "Shrine 3.x": [ + "release_notes/3.6.0", "release_notes/3.5.0", "release_notes/3.4.0", "release_notes/3.3.0",