Class: Locomotive::Steam::Repositories

Inherits:
Object
  • Object
show all
Includes:
Morphine
Defined in:
lib/locomotive/steam/repositories.rb

Instance Method Summary collapse

Instance Method Details

#build_adapter(options) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/locomotive/steam/repositories.rb', line 48

def build_adapter(options)
  name = ((options || {})[:name] || :filesystem).to_s
  begin
    require_relative "adapters/#{name.downcase}"
  rescue LoadError => e
    puts 'Not a Steam built-in adapter'
    puts e.inspect
    puts e.backtrace
  end
  klass = "Locomotive::Steam::#{name.camelize}Adapter".constantize
  klass.new(options)
end