Sha256: eb732d652b975034138537bfb3f636a6c9a7600e850dcca4be198072a06fcefa

Contents?: true

Size: 896 Bytes

Versions: 16

Compression:

Stored size: 896 Bytes

Contents

require 'mccloud/config/component'
require 'mccloud/definition'
require 'ostruct'

module Mccloud
  class Config
    class Definition

      attr_accessor :components
      attr_reader :env

      def initialize(config)
        @env=config.env
        @components=Hash.new
      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
        definition_stub=OpenStruct.new
        definition_stub.definition=::Mccloud::Definition.new(name,env)

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

        yield definition_stub

        env.logger.debug("config definitions"){ "End reading definition #{definition_stub.definition.name}"}

        components[name.to_s]=definition_stub.definition
      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/definition.rb
mccloud-0.0.28 lib/mccloud/config/definition.rb
mccloud-0.0.27 lib/mccloud/config/definition.rb
mccloud-0.0.26 lib/mccloud/config/definition.rb
mccloud-0.0.25 lib/mccloud/config/definition.rb
mccloud-0.0.24 lib/mccloud/config/definition.rb
mccloud-0.0.23 lib/mccloud/config/definition.rb
mccloud-0.0.22 lib/mccloud/config/definition.rb
mccloud-0.0.21 lib/mccloud/config/definition.rb
mccloud-0.0.20 lib/mccloud/config/definition.rb
mccloud-0.0.19 lib/mccloud/config/definition.rb
mccloud-0.0.18 lib/mccloud/config/definition.rb
mccloud-0.0.17 lib/mccloud/config/definition.rb
mccloud-0.0.16 lib/mccloud/config/definition.rb
mccloud-0.0.15 lib/mccloud/config/definition.rb
mccloud-0.0.14 lib/mccloud/config/definition.rb