Module: Dabcup::Storage::Driver

Defined in:
lib/dabcup/storage/driver/s3.rb,
lib/dabcup/storage/driver/ftp.rb,
lib/dabcup/storage/driver/base.rb,
lib/dabcup/storage/driver/sftp.rb,
lib/dabcup/storage/driver/local.rb

Defined Under Namespace

Classes: Base, FTP, Local, S3, SFTP

Class Method Summary collapse

Class Method Details

.build(url) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dabcup/storage/driver/base.rb', line 7

def self.build(url)
  if url.include?('file://')
    Dabcup::Storage::Driver::Local.new(url)
  elsif url.include?('ssh://')
    Dabcup::Storage::Driver::SFTP.new(url)
  elsif url.include?('ftp://')
    Dabcup::Storage::Driver::FTP.new(url)
  elsif url.include?('s3://')
    Dabcup::Storage::Driver::S3.new(url)
  elsif url.include?('ftp://')
    Dabcup::Storage::Driver::FTP.new(url)
  else
    raise "No driver found for '#{url}'"
  end
end