Provides Google Cloud Storage (GCS) storage for Shrine.
gem "shrine-google_cloud_storage"
The GCS plugin uses Google's Application Default Credentials. Please check documentation for the various ways to provide credentials.
require "shrine/storage/gcs"
Shrine.storages = {
cache: Shrine::Storage::GoogleCloudStorage.new(bucket: "cache"),
store: Shrine::Storage::GoogleCloudStorage.new(bucket: "store"),
}
Firstly you need to create an .env
file with a dedicated GCS bucket:
# .env
GCS_BUCKET="..."
Warning: all content of the bucket is cleared between tests, create a new one only for this usage!
Afterwards you can run the tests:
$ bundle exec rake test