Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 673 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 673 Bytes

Shrine::Storage::Redis

Provides a Shrine Storage for storing files in Redis.

Installation

gem "shrine-redis"

Usage

# This example assumes a redis-server instance is running in the background

require "redis"
require "shrine"
require "shrine/storage/redis"

redis = Redis.new

cache = { client: redis, prefix: "cache", expire: 60 }
store = { client: redis, prefix: "store", expire: 3600 }

Shrine.storages = {
  cache: Shrine::Storage::Redis.new(cache),
  store: Shrine::Storage::Redis.new(store)
}

Contributing

You can run the tests with Rake:

$ bundle exec rake test

License

MIT