Project Assemblies

Most of the time, a project will have a single assembly, so Alki makes having a single project wide assembly especially easy.

First, in your project’s lib directory create a ruby file for your assembly. If your assembly is to be called MyAssembly, create lib/my_assembly.rb. If it’s namespaced put it in a subdirectory as usual (i.e. MyModule::MyAssembly would go in lib/my_module/my_assembly.rb).

Your assembly file just needs two lines:

require 'alki'

It will detect the project root and what class name it should create automatically.

Second, a config directory must be created in the project root, and in that directory an assembly.rb file should be created. It should contain an Alki do …​ end block which contains the top level definition for your Assembly.

Alki do
  # Assembly DSL ...

Alki.project_assembly! defaults can be overridden by passing in the following keyword arguments:


Set the name of the assembly. Should be formatted how you would put it in a require call (e.g. if MyModule::MyAssembly is desired, use 'my_module/my_assembly'). Default is determined from the filename of the caller.


Set directory where assembly config files are found. Default is <project root>/config.


Sets the name of the main config file to load. Defaults to assembly.rb.

results matching ""

    No results matching ""