Skip to content

Commit

Permalink
Bump to 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Apr 29, 2024
1 parent 9c1dc78 commit 2fdcb17
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
23 changes: 23 additions & 0 deletions doc/release_notes/3.6.0.md
Original file line number Diff line number Diff line change
@@ -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`.
10 changes: 10 additions & 0 deletions doc/storage/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/shrine/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.version

module VERSION
MAJOR = 3
MINOR = 5
MINOR = 6
TINY = 0
PRE = nil

Expand Down
1 change: 1 addition & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2fdcb17

Please sign in to comment.