storage manager: remove fog backend.

Remove in favor of rclone.
This commit is contained in:
evazion
2019-12-13 01:45:43 -06:00
parent 8e93b0fc6c
commit 92aca9ed2d
3 changed files with 0 additions and 45 deletions

View File

@@ -46,8 +46,6 @@ gem 'builder'
gem 'puma'
gem 'scenic'
gem 'ipaddress'
gem 'fog-core'
gem 'fog-backblaze', require: 'fog/backblaze'
# needed for looser jpeg header compat
gem 'ruby-imagespec', :require => "image_spec", :git => "https://github.com/r888888888/ruby-imagespec.git", :branch => "exif-fixes"

View File

@@ -153,7 +153,6 @@ GEM
railties (>= 3.2, < 6.1)
equalizer (0.0.11)
erubi (1.9.0)
excon (0.70.0)
factory_bot (5.1.1)
activesupport (>= 4.2.0)
faraday (0.17.1)
@@ -162,14 +161,6 @@ GEM
ffi (1.11.3)
ffi (1.11.3-x64-mingw32)
flamegraph (0.9.5)
fog-backblaze (0.3.0)
fog-core (>= 1.40, < 3)
fog-core (2.1.2)
builder
excon (~> 0.58)
formatador (~> 0.2)
mime-types
formatador (0.2.5)
get_process_mem (0.2.5)
ffi (~> 1.0)
globalid (0.4.2)
@@ -453,8 +444,6 @@ DEPENDENCIES
factory_bot
ffaker
flamegraph
fog-backblaze
fog-core
httparty
ipaddress
jquery-rails

View File

@@ -1,32 +0,0 @@
class StorageManager::Cloud < StorageManager
attr_reader :bucket, :client, :fog_options
def initialize(bucket, client: nil, fog_options: {}, **options)
@bucket = bucket
@fog_options = fog_options
@client = client || Fog::Storage.new(**fog_options)
super(**options)
end
def store(io, path)
io.rewind # XXX caller should be responsible for this.
data = io.read
client.put_object(bucket, key(path), data)
end
def delete(path)
client.delete_object(bucket, key(path))
end
def open(path)
file = Tempfile.new(binmode: true)
response = client.get_object(bucket, key(path))
file.write(response.body)
file.rewind
file
end
def key(path)
path.delete_prefix("/")
end
end