Sha256: a379813b6edcc713aea340e130ea9ad09272a6df5260ba895935c92fe9292039

Contents?: true

Size: 945 Bytes

Versions: 10

Compression:

Stored size: 945 Bytes

Contents

require "fog/core"
require "fog/xml"
require "builder"

require File.expand_path("../ecloud/version", __FILE__)
require File.expand_path("../ecloud/ipaddr", __FILE__)

module Fog
  module Compute
    autoload :Ecloud, File.expand_path("../compute/ecloud", __FILE__)
  end

  module Ecloud
    ECLOUD_OPTIONS = [:ecloud_authentication_method]

    autoload :MockDataClasses, File.expand_path("../ecloud/mock_data_classes", __FILE__)

    extend Fog::Provider

    service(:compute, "Compute")

    def self.keep(hash, *keys)
      {}.tap do |kept|
        keys.each{ |k| kept[k] = hash[k] if hash.key?(k) }
      end
    end

    def self.slice(hash, *keys)
      hash.dup.tap do |sliced|
        keys.each{ |k| sliced.delete(k) }
      end
    end

    def self.ip_address
      4.times.map { Fog::Mock.random_numbers(3) }.join(".")
    end

    def self.mac_address
      6.times.map { Fog::Mock.random_numbers(2) }.join(":")
    end
  end
end

Version data entries

10 entries across 8 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/ecloud.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/ecloud.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/ecloud.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/ecloud.rb
fog-ecloud-0.3.0 lib/fog/ecloud.rb
fog-ecloud-0.2.0 lib/fog/ecloud.rb
fog-ecloud-0.1.3 lib/fog/ecloud.rb
fog-ecloud-0.1.2 lib/fog/ecloud.rb
fog-ecloud-0.1.1 lib/fog/ecloud.rb
fog-ecloud-0.1.0 lib/fog/ecloud.rb