Sha256: c516e2c28fe911442995ab46438c65ba44e76782c4909d32be2f3b52c98d01da

Contents?: true

Size: 556 Bytes

Versions: 11

Compression:

Stored size: 556 Bytes

Contents

# coding: utf-8
Dir[File.dirname(__FILE__) + '/backends/*.rb'].each {|file| require file  }

module Splash
  module Backends
    include Splash::Config
    include Splash::Constants

    def get_backend(store)
      backend = get_config[:backends][:stores][store][:type].to_s
      aclass = "Splash::Backends::#{backend.capitalize}"
      begin
        return Kernel.const_get(aclass)::new(store)
      rescue
        splash_exit case: :configuration_error, more: "Backend specified for store #{store} inexistant : #{backend}"
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
prometheus-splash-0.5.3 lib/splash/backends.rb
prometheus-splash-0.5.2 lib/splash/backends.rb
prometheus-splash-0.5.0 lib/splash/backends.rb
prometheus-splash-0.4.5 lib/splash/backends.rb
prometheus-splash-0.4.4 lib/splash/backends.rb
prometheus-splash-0.4.3 lib/splash/backends.rb
prometheus-splash-0.4.2 lib/splash/backends.rb
prometheus-splash-0.4.1 lib/splash/backends.rb
prometheus-splash-0.4.0 lib/splash/backends.rb
prometheus-splash-0.3.0 lib/splash/backends.rb
prometheus-splash-0.2.0 lib/splash/backends.rb