Sha256: 218eb6a39f0881fe8b2bf710835de00c839602b4b21012eaa30577bb89b87ab6

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

require 'fog/credentials'

require 'fog/aws/bin'
require 'fog/local/bin'
require 'fog/new_servers/bin'
require 'fog/rackspace/bin'
require 'fog/slicehost/bin'
require 'fog/terremark/bin'
require 'fog/vcloud/bin'
require 'fog/bluebox/bin'

module Fog
  class << self

    def services
      services = []
      [::AWS, ::Local, ::NewServers, ::Rackspace, ::Slicehost, ::Terremark, ::Vcloud, ::Bluebox].each do |service|
        if service.initialized?
          services << service
        end
      end
      services
    end

    def directories
      directories = {}
      services.each do |service|
        if service.respond_to?(:directories)
          directories[service] = service.directories
        end
      end
      directories
    end

    def flavors
      flavors = {}
      services.each do |service|
        if service.respond_to?(:flavors)
          flavors[service] = service.flavors
        end
      end
      flavors
    end

    def images
      images = {}
      services.each do |service|
        if service.respond_to?(:images)
          images[service] = service.images
        end
      end
      images
    end

    def servers
      servers = {}
      services.each do |service|
        if service.respond_to?(:servers)
          servers[service] = service.servers
        end
      end
      servers
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-0.2.11 lib/fog/bin.rb
fog-0.2.10 lib/fog/bin.rb
fog-0.2.9 lib/fog/bin.rb
fog-0.2.8 lib/fog/bin.rb
fog-0.2.7 lib/fog/bin.rb
fog-0.2.6 lib/fog/bin.rb
fog-0.2.5 lib/fog/bin.rb
fog-0.2.4 lib/fog/bin.rb
fog-0.2.3 lib/fog/bin.rb
fog-0.2.2 lib/fog/bin.rb
fog-0.2.1 lib/fog/bin.rb