Sha256: 56a6f4381adb0f4ffaddfa8b7c25c9d2ff6191fcc6eeaf5316b86fd97a0924e7
Contents?: true
Size: 967 Bytes
Versions: 14
Compression:
Stored size: 967 Bytes
Contents
module Dandelion module Adapter class InvalidAdapterError < StandardError; end class MissingDependencyError < StandardError attr_reader :gems def initialize(gems) @gems = gems end end class Base class << self @@adapters = {} def adapter(name) @@adapters[name] = self end def create_adapter(name, options = {}) klass = @@adapters[name] raise InvalidAdapterError if klass.nil? klass.new(options) rescue LoadError raise MissingDependencyError.new(klass.required_gems) end attr_reader :required_gems def requires_gems(*gems) @required_gems = gems end end def initialize(options) end end end end require 'dandelion/adapter/noop' require 'dandelion/adapter/ftp' require 'dandelion/adapter/sftp' require 'dandelion/adapter/ftps' require 'dandelion/adapter/s3'
Version data entries
14 entries across 14 versions & 1 rubygems