Class: Gaudi::Configuration::BuildConfiguration

Inherits:
Loader
  • Object
show all
Defined in:
lib/gaudi/helpers/configuration.rb

Overview

For each set of sources we identify as a unit/component/group BuildConfiguration corresponds to the configuration file that describe the dependencies to the rest of the system.

Instance Attribute Summary collapse

Attributes inherited from Loader

#config, #configuration_files

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Loader

#merge, #read_configuration, #to_s

Constructor Details

#initialize(prefix) ⇒ BuildConfiguration


573
574
575
576
577
# File 'lib/gaudi/helpers/configuration.rb', line 573

def initialize prefix
  @config={'prefix'=>prefix}
  @configuration_files=Rake::FileList.new  
  keys   
end

Instance Attribute Details

#config=(value) ⇒ Object (writeonly)

Sets the attribute config


554
555
556
# File 'lib/gaudi/helpers/configuration.rb', line 554

def config=(value)
  @config = value
end

#configuration_files=(value) ⇒ Object (writeonly)

Sets the attribute configuration_files


554
555
556
# File 'lib/gaudi/helpers/configuration.rb', line 554

def configuration_files=(value)
  @configuration_files = value
end

Class Method Details

.load(configuration_files) ⇒ Object

I guess this is what you call a Factory Method?


556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/gaudi/helpers/configuration.rb', line 556

def self.load configuration_files
  cfg=nil
  configuration_files.each do |cfg_file|
    if cfg
      cfg.merge(cfg_file)
    else
      ld=Loader.new(cfg_file)
      raise GaudiConfigurationError, "No prefix in configuration #{cfg_file}" unless ld.config['prefix']
      cfg=BuildConfiguration.new(ld.config['prefix'])
      cfg.merge(cfg_file)
      cfg.configuration_files<<cfg_file
    end
  end
  raise GaudiConfigurationError, "No BuildConfiguration configuration files in '#{configuration_files}'" unless cfg
  return cfg
end

Instance Method Details

#keysObject


579
580
581
# File 'lib/gaudi/helpers/configuration.rb', line 579

def keys
  load_key_modules(Gaudi::Configuration::BuildModules)
end