OSS探訪GitHubでログイン

storage・metadata・processing・direct uploadをpluginで組み合わせるRuby file attachment toolkit

スコアの見方

OSS規模スコアはStars・Watchers・Forks・Contributorsを対数圧縮して重み付けした現在の規模指標(上限なし)です。発掘スコアは現在のOSS規模スコアから発掘時点のOSS規模スコアを引いた値、更新ペースは直近30日Commit数、成長モメンタムは直近の観測期間におけるOSS規模スコア差、OSS健全度は取得できた更新状況・Community Health・Releaseの0〜100評価です。

Stars
3,285
主要言語
Ruby
ライセンス
MIT
リポジトリ最終更新
2026/09/20
ページ内ナビ

概要

ShrineはRuby application向けfile attachment toolkitです。FileSystemやS3等のstorageへstreaming upload/downloadし、metadata、validation、processing、direct/resumable upload、backgrounding、ActiveRecord/Sequel integration等をpluginで必要な分だけ追加できます。現在のversionは3.10.0です。

特徴と向いている用途

公式資料に基づく紹介・実機未検証 · 内容確認日:

主な特徴

cache/storeを分離しstreamingでfileをstorageへ転送する

temporaryなcacheとpermanentなstoreを分け、FileSystemやS3等のstorageへIO objectをuploadできます。streaming upload/downloadを前提にし、大きなfileでもmemory消費を抑えやすい構成です。

出典:[2][4]

validation・metadata・derivatives・direct upload・backgroundingをpluginで追加する

MIME typeやdimension等のmetadata/validation、thumbnail等のderivative、presigned/direct/resumable upload、background processing、ActiveRecord/Sequel integrationをapplication要件に合わせて選べます。3.10.0ではfallback storageとdata URI size limitも追加されています。

出典:[2][5]

向いている用途

画像・動画・document uploadをDB lifecycleと安全に結び付けたいRuby applicationに向く

uploadをrequest processだけに閉じず、cloud storage、background processing、direct upload、ORM persistenceを段階的に組み合わせたいRails/Ruby backendに適します。

出典:[2]

導入前の確認

3.10.0はRuby 3.2+。storage権限・MIME検証・path traversal・upload sizeをapplication側で設計する

gemspecはRuby 3.2以上を要求します。3.8.0ではFileSystem storageのpath traversal対策、3.10.0ではdata URIの事前size limitが追加されています。client提供のContent-Typeだけを信頼せずmetadata analyzer/validationを使い、storage credential、object visibility、最大file size、direct upload policyを明示してください。

出典:[4][5][2]

参考にした公式資料

  1. [1]shrinerb/shrine — GitHub repository(2026-10-06)
  2. [2]Shrine — README(2026-10-06)
  3. [3]Shrine — version source(2026-10-06)
  4. [4]Shrine — shrine.gemspec(2026-10-06)
  5. [5]Shrine — CHANGELOG(2026-10-06)
  6. [6]Shrine — MIT License(2026-10-06)
編集部からの補足

file uploadを単一gemの固定workflowに閉じず、storage・processing・ORM・direct uploadを必要な分だけ組み合わせられます。MIME判定、最大size、storage権限、path安全性をapplication側の明示的なpolicyとして設計してください。

3ステップで試す

  1. 1

    ソースを取得

    git clone --depth 1 https://github.com/shrinerb/shrine.git
  2. 2

    リポジトリへ移動

    cd shrine
  3. 3

    公式手順を確認

    READMEのInstallation / Quick Start / Getting Startedにある公式コマンドを続けて実行してください。

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
公式READMEで確認

成長

成長の推移 · 直近30日

3,285 Stars

推移データを蓄積中です。

開発アクティビティ

直近90日・週次

Commit(直近30日)
3
Open PR
1

開発アクティビティを蓄積中です。

Built with

カテゴリとタグ

タグ

GitHubデータ

GitHubのデータGitHubの詳細データを見る

GitHub Topics

  • file-upload
  • ruby
  • rack
  • storage
  • attachment
  • filesystem
  • s3
  • background-jobs
  • direct-upload
  • orm
  • metadata
Stars
3,285
Forks
279
Watchers
36
Open Issues
0
Contributors
109
所有者種別
Organization
主要言語
Ruby
ライセンス
MIT
リポジトリ最終更新
2026/09/20

このOSSの使い方や活用事例をMarkdownで投稿できます。管理者が承認した後に公開されます。

情報の誤りを報告

掲載内容に誤りや古い情報があればお知らせください。

このページを読んで、次に何をすればよいか分かりましたか?