452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
|
# File 'lib/cfhighlander.dsl.template.rb', line 452
def CfhighlanderTemplate(&block)
if @parent_dsl.nil?
instance = Cfhighlander::Dsl::HighlanderTemplate.new
puts "Processing higlander component #{@name}\n\tLocation:#{@highlander_dsl_path}" +
"\n\tConfig:#{@config}"
else
instance = @parent_dsl
puts "Processing higlander component #{@name}\n\tLocation:#{@highlander_dsl_path}" +
"\n\tConfig:#{@config}\n\tParent: #{@parent_template}"
end
instance.config = @config
@mappings.each do |key, val|
instance.addMapping(key, val)
end
unless @version.nil?
instance.version = @version
instance.config['component_version'] = @version
end
instance.name = @template.template_name
instance.instance_eval(&block)
unless @distribution_bucket.nil?
instance.DistributionBucket(@distribution_bucket)
end
unless @distribution_prefix.nil?
instance.DistributionPrefix(@distribution_prefix)
end
unless @distribution_format.nil?
instance.Forma
end
@potential_subcomponent_overrides.each do |name, config|
if (not instance.subcomponents.find {|s| s.name == name}.nil?)
instance.config['components'] = {} unless instance.config.key? 'components'
instance.config['components'][name] = {} unless instance.config['components'].key? name
instance.config['components'][name]['config'] = {} unless instance.config['components'][name].key? 'config'
if config.key? 'components'
if config['components'].key? name
if config['components'][name].key? 'config'
config = config['components'][name]['config']
end
end
end
instance.config['components'][name]['config'].extend config
end
end
instance.loadComponents
return instance
end
|