Sha256: ac240241a958ed13b6c5a78942fff50c1e7c13f81f861e336465f5c2ac43bb37

Contents?: true

Size: 973 Bytes

Versions: 13

Compression:

Stored size: 973 Bytes

Contents

class SakuraCloud < Fog::Bin
  class << self
    def class_for(key)
      case key
      when :compute
        Fog::Compute::SakuraCloud
      when :volume
        Fog::Volume::SakuraCloud
      else
        raise ArgumentError, "Unrecognized service: #{key}"
      end
    end

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :compute
          Fog::Logger.warning("SakuraCloud[:compute] is not recommended, use Compute[:sakuracloud] for portability")
          Fog::Compute.new(:provider => 'SakuraCloud')
        when :volume
          Fog::Logger.warning("SakuraCloud[:compute] is not recommended, use Compute[:SakuraCloud] for portability")
          Fog::Compute.new(:provider => 'SakuraCloud')
        else
          raise ArgumentError, "Unrecognized service: #{key.inspect}"
        end
      end
      @@connections[service]
    end

    def services
      Fog::SakuraCloud.services
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/bin/sakuracloud.rb
fog-sakuracloud-0.0.4 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.11 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.10 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.9 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.8 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.7 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.6 lib/fog/bin/sakuracloud.rb
fog-1.23.0 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.4 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.3 lib/fog/bin/sakuracloud.rb
ns-fog-1.22.2 lib/fog/bin/sakuracloud.rb
fog-1.22.1 lib/fog/bin/sakuracloud.rb