Sha256: a5784ccf5ced169892e673d07842e0ff96fdc17284593ad31e502f1fb26d8e08

Contents?: true

Size: 770 Bytes

Versions: 98

Compression:

Stored size: 770 Bytes

Contents

module Fog

  def self.providers
    @providers ||= {}
  end

  def self.providers=(new_providers)
    @providers = new_providers
  end

  module Provider

    def self.extended(base)
      provider = base.to_s.split('::').last
      Fog.providers[provider.downcase.to_sym] = provider
    end

    def [](service_key)
      eval(@services_registry[service_key]).new
    end

    def service(new_service, path, constant_string)
      Fog.services[new_service] ||= []
      Fog.services[new_service] |= [self.to_s.split('::').last.downcase.to_sym]
      @services_registry ||= {}
      @services_registry[new_service] = [self.to_s, constant_string].join('::')
      require File.join('fog', path)
    end

    def services
      @services_registry.keys
    end

  end
end

Version data entries

98 entries across 98 versions & 17 rubygems

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/core/provider.rb
cifrado-0.2.0 vendor/fog/lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/core/provider.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/core/provider.rb
fog-1.19.0 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/core/provider.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/core/provider.rb