storage manager: remove fog backend.
Remove in favor of rclone.
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -46,8 +46,6 @@ gem 'builder'
|
|||||||
gem 'puma'
|
gem 'puma'
|
||||||
gem 'scenic'
|
gem 'scenic'
|
||||||
gem 'ipaddress'
|
gem 'ipaddress'
|
||||||
gem 'fog-core'
|
|
||||||
gem 'fog-backblaze', require: 'fog/backblaze'
|
|
||||||
|
|
||||||
# needed for looser jpeg header compat
|
# needed for looser jpeg header compat
|
||||||
gem 'ruby-imagespec', :require => "image_spec", :git => "https://github.com/r888888888/ruby-imagespec.git", :branch => "exif-fixes"
|
gem 'ruby-imagespec', :require => "image_spec", :git => "https://github.com/r888888888/ruby-imagespec.git", :branch => "exif-fixes"
|
||||||
|
|||||||
11
Gemfile.lock
11
Gemfile.lock
@@ -153,7 +153,6 @@ GEM
|
|||||||
railties (>= 3.2, < 6.1)
|
railties (>= 3.2, < 6.1)
|
||||||
equalizer (0.0.11)
|
equalizer (0.0.11)
|
||||||
erubi (1.9.0)
|
erubi (1.9.0)
|
||||||
excon (0.70.0)
|
|
||||||
factory_bot (5.1.1)
|
factory_bot (5.1.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
faraday (0.17.1)
|
faraday (0.17.1)
|
||||||
@@ -162,14 +161,6 @@ GEM
|
|||||||
ffi (1.11.3)
|
ffi (1.11.3)
|
||||||
ffi (1.11.3-x64-mingw32)
|
ffi (1.11.3-x64-mingw32)
|
||||||
flamegraph (0.9.5)
|
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)
|
get_process_mem (0.2.5)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
@@ -453,8 +444,6 @@ DEPENDENCIES
|
|||||||
factory_bot
|
factory_bot
|
||||||
ffaker
|
ffaker
|
||||||
flamegraph
|
flamegraph
|
||||||
fog-backblaze
|
|
||||||
fog-core
|
|
||||||
httparty
|
httparty
|
||||||
ipaddress
|
ipaddress
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user