Sha256: ecb46d0eada49954f9c36e45a07df488bf72a13faf4eb172d9aadc4435783292

Contents?: true

Size: 947 Bytes

Versions: 96

Compression:

Stored size: 947 Bytes

Contents

module Rackspace
  class << self
    if Fog.credentials[:rackspace_api_key] && Fog.credentials[:rackspace_username]

      def initialized?
        true
      end

      def [](service)
        @@connections ||= Hash.new do |hash, key|
          credentials = Fog.credentials.reject do |k,v|
            ![:rackspace_api_key, :rackspace_username].include?(k)
          end
          hash[key] = case key
          when :files
            Fog::Rackspace::Files.new(credentials)
          when :servers
            Fog::Rackspace::Servers.new(credentials)
          end
        end
        @@connections[service]
      end

      def directories
        self[:files].directories
      end

      def flavors
        self[:servers].flavors
      end

      def images
        self[:servers].images
      end

      def servers
        self[:servers].servers
      end
      
    else

      def initialized?
        false
      end

    end
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/rackspace/bin.rb
fog-0.2.28 lib/fog/rackspace/bin.rb
fog-0.2.27 lib/fog/rackspace/bin.rb
fog-0.2.26 lib/fog/rackspace/bin.rb
fog-0.2.25 lib/fog/rackspace/bin.rb
fog-0.2.24 lib/fog/rackspace/bin.rb
tecnh-fog-0.2.23.vpc lib/fog/rackspace/bin.rb
fog-0.2.23 lib/fog/rackspace/bin.rb
fog-0.2.22 lib/fog/rackspace/bin.rb
fog-0.2.21 lib/fog/rackspace/bin.rb
fog-0.2.20 lib/fog/rackspace/bin.rb
fog-0.2.19 lib/fog/rackspace/bin.rb
fog-0.2.18 lib/fog/rackspace/bin.rb
fog-0.2.17 lib/fog/rackspace/bin.rb
fog-0.2.16 lib/fog/rackspace/bin.rb
fog-0.2.15 lib/fog/rackspace/bin.rb
fog-0.2.14 lib/fog/rackspace/bin.rb
fog-0.2.13 lib/fog/rackspace/bin.rb
fog-0.2.12 lib/fog/rackspace/bin.rb
fog-0.2.11 lib/fog/rackspace/bin.rb