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.1.1 lib/fog/rackspace/bin.rb
fog-0.1.0 lib/fog/rackspace/bin.rb
fog-0.0.100 lib/fog/rackspace/bin.rb
fog-0.0.99 lib/fog/rackspace/bin.rb
fog-0.0.98 lib/fog/rackspace/bin.rb
fog-0.0.97 lib/fog/rackspace/bin.rb
fog-0.0.96 lib/fog/rackspace/bin.rb
fog-0.0.95 lib/fog/rackspace/bin.rb
fog-0.0.94 lib/fog/rackspace/bin.rb
fog-0.0.93 lib/fog/rackspace/bin.rb
fog-0.0.92 lib/fog/rackspace/bin.rb
fog-0.0.91 lib/fog/rackspace/bin.rb
fog-0.0.90 lib/fog/rackspace/bin.rb
fog-0.0.89 lib/fog/rackspace/bin.rb
fog-0.0.88 lib/fog/rackspace/bin.rb
fog-0.0.87 lib/fog/rackspace/bin.rb
fog-0.0.86 lib/fog/rackspace/bin.rb
fog-0.0.85 lib/fog/rackspace/bin.rb
fog-0.0.84 lib/fog/rackspace/bin.rb
fog-0.0.83 lib/fog/rackspace/bin.rb