Unify Memory storage with S3 and GCP storages

Hi there

We’ve changed our test storage to Memory as suggested here and got a problems because of difference between interfaces of Google Cloud Storage and Memory Storage (I understand that gcloud isn’t supported by Shrine itself, so I’ve checked if S3 interface is the same and it is).

I’d suggest to create stub methods of #prefix, #host and #bucket to make Memory storage interface compatible with S3 and GCP storages.

Hi :wave: How are you using these three methods? I’m not sure if stubbing is a good general solution, because different apps might want different values to be stubbed. I would generally reach for Minio if my app required these methods.

Note that you can always subclass memory storage:

class Shrine::Storage::StubbedMemory < Shrine::Storage::Memory
  def prefix
    nil
  end

  def bucket
    nil
  end
end

Shrine.storages = {
  cache: Shrine::Storage::StubbedMemory.new,
  store: Shrine::Storage::StubbedMemory.new,
}