Sha256: 367a9a4ee179e775c0295947c820c11016b8ff318e7a20519f64e14272c707af

Contents?: true

Size: 863 Bytes

Versions: 16

Compression:

Stored size: 863 Bytes

Contents

require 'mccloud/config/component'
require 'mccloud/template'
require 'ostruct'

module Mccloud
  class Config
    class Template

      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
        template_stub=OpenStruct.new
        template_stub.template=::Mccloud::Template.new(name,env)

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

        yield template_stub

        env.logger.debug("config template"){ "End reading template #{template_stub.template.name}"}

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