module Cxxproject

todo…

can be used as wrapper for other tasks

Constants

ALL_BUILDING_BLOCKS

stores all defined buildingblocks by name (the name should be unique)

VERSION

Public Class Methods

add_unique(res, bb) click to toggle source
# File lib/cxxproject/buildingblocks/building_block.rb, line 33
def self.add_unique(res, bb)
  res.delete(bb)
  res.push(bb)
end
find_by_tag(tag) click to toggle source
# File lib/cxxproject/buildingblocks/building_block.rb, line 38
def self.find_by_tag(tag)
  ALL_BUILDING_BLOCKS.values.find_all{|o|o.tags.include?(tag)}
end
resolve_by_name(name) click to toggle source
# File lib/cxxproject/buildingblocks/building_block.rb, line 27
def self.resolve_by_name(name)
  res = ALL_BUILDING_BLOCKS[name]
  raise "BuildingBlock #{name} not defined" unless res
  res
end
sorted_building_blocks() click to toggle source
# File lib/cxxproject/buildingblocks/building_block.rb, line 16
def self.sorted_building_blocks
  todo = ALL_BUILDING_BLOCKS.keys.dup
  res = []
  while not todo.empty?
    bb = resolve_by_name(todo.pop)
    add_unique(res, bb)
    todo += bb.dependencies
  end
  return res.reverse
end