This commit is contained in:
albert
2011-08-29 14:49:34 -04:00
parent 03a5fff219
commit 51e8b57a3d
3 changed files with 64 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
class RemoteFileManager
attr_reader :path
def initialize(path)
@path = path
end
def distribute
Danbooru.config.other_server_hosts.each do |hostname|
Net::SFTP.start(hostname, Danbooru.config.remote_server_login) do |ftp|
ftp.upload!(path, path)
end
end
end
def delete
Danbooru.config.other_server_hosts.each do |hostname|
Net::SFTP.start(hostname, Danbooru.config.remote_server_login) do |ftp|
ftp.remove(path)
end
end
end
end