Skip to content

refile/refile-fog

Repository files navigation

Refile::Fog

Build Status

A backend for Refile which provides storage in multiple cloud storage services via the Fog cloud services gem.

If you're looking for a backend for Amazon S3, please use Refile's build in S3 backend. It is far superior to using S3 via Fog.

Installation

Add this line to your application's Gemfile:

gem 'refile-fog'

You also need to add the storage provider you use.

Example for google storage:

gem 'fog-google'
gem 'google-api-client', '~> 0.8.6'

Set up Refile to use the fog backend:

# config/initializers/refile.rb

require "fog/google"
require "refile/fog"

credentials = {
  provider: "Google",
  aws_access_key_id: "zyx",
  aws_secret_access_key: "12345",
  directory: "my-app"
}

Refile.configure do |config|
  config.cache = Refile::Fog::Backend.new(prefix: "cache", **credentials)
  config.store = Refile::Fog::Backend.new(prefix: "store", **credentials)
end

License

MIT