Class: Gaudi::Deployment

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

Overview

A Deployment is a collection of Programs compiled for multiple platforms

It maps to a directory structure of deployment

|name
   |platform1
   |platform2
        |program1.cfg
        |program2.cfg

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, system_config) ⇒ Deployment

Returns a new instance of Deployment

Raises:


154
155
156
157
158
159
160
# File 'lib/gaudi/helpers/components.rb', line 154

def initialize name,system_config
  @name=name
  @directories=determine_directories(name,system_config.source_directories)
  @system_config=system_config
  raise GaudiError,"Cannot find directories for #{name} " if @directories.empty?
  validate
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


153
154
155
# File 'lib/gaudi/helpers/components.rb', line 153

def name
  @name
end

Instance Method Details

#platformsObject

Returns the list of platforms this Deployment has programs for


162
163
164
# File 'lib/gaudi/helpers/components.rb', line 162

def platforms
  Rake::FileList[*@directories.pathmap("%p/*")].existing.pathmap('%n')
end

#programs(platform) ⇒ Object

A Program instance for every program configuration on the given platform


166
167
168
# File 'lib/gaudi/helpers/components.rb', line 166

def programs platform
  Rake::FileList[*@directories.pathmap("%p/#{platform}/*.cfg")].existing.map{|cfg| Program.new(cfg,name,@system_config,platform)}
end

#to_sObject


169
170
171
# File 'lib/gaudi/helpers/components.rb', line 169

def to_s
  name
end