Sha256: 89b2eaa3d9e3db2f2c6769ef6ad43be6de6e3c394b5913a3c52c8bc81ccd222a

Contents?: true

Size: 896 Bytes

Versions: 16

Compression:

Stored size: 896 Bytes

Contents

require 'mccloud/config/component'
require 'mccloud/keypair'
require 'ostruct'

module Mccloud
  class Config
    class Keypair

      attr_accessor :components
      attr_reader :env

      def initialize(config)
        @env=config.env
        @components=Hash.new
        env.logger.debug("initalizing keypair")
      end

      def define(name)
        # We do this for vagrant syntax
        # Depending on type, we create a variable of that type
        # f.i. component_stub.vm or component_stub.lb
        keypair_stub=OpenStruct.new
        keypair_stub.keypair=::Mccloud::Keypair.new(name,env)

        env.logger.debug("config keypair"){ "Start reading keypair"}

        yield keypair_stub

        env.logger.debug("config keypair"){ "End reading keypair #{keypair_stub.keypair.name}"}

        components[name.to_s]=keypair_stub.keypair
      end

    end
  end
end #Module Mccloud

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/config/keypair.rb
mccloud-0.0.28 lib/mccloud/config/keypair.rb
mccloud-0.0.27 lib/mccloud/config/keypair.rb
mccloud-0.0.26 lib/mccloud/config/keypair.rb
mccloud-0.0.25 lib/mccloud/config/keypair.rb
mccloud-0.0.24 lib/mccloud/config/keypair.rb
mccloud-0.0.23 lib/mccloud/config/keypair.rb
mccloud-0.0.22 lib/mccloud/config/keypair.rb
mccloud-0.0.21 lib/mccloud/config/keypair.rb
mccloud-0.0.20 lib/mccloud/config/keypair.rb
mccloud-0.0.19 lib/mccloud/config/keypair.rb
mccloud-0.0.18 lib/mccloud/config/keypair.rb
mccloud-0.0.17 lib/mccloud/config/keypair.rb
mccloud-0.0.16 lib/mccloud/config/keypair.rb
mccloud-0.0.15 lib/mccloud/config/keypair.rb
mccloud-0.0.14 lib/mccloud/config/keypair.rb