Module: Syskit::Actions::ProfileDefinitionDSL

Included in:
Syskit::Actions
Defined in:
lib/syskit/actions/profile.rb

Instance Method Summary collapse

Instance Method Details

#profile(name, &block) ⇒ Syskit::Actions::Profile

Declares a new syskit profile, and registers it as a constant on this module

A syskit profile is a group of dependency injections (use flags) and instance definitions. All the definitions it contains can then be exported on an action interface using LibraryExtension#use_profile



739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/syskit/actions/profile.rb', line 739

def profile(name, &block)
    if const_defined_here?(name)
        profile = const_get(name)
    else
        profile = Profile.new("#{self.name}::#{name}", register: true)
        const_set(name, profile)
        profile.doc MetaRuby::DSLs.parse_documentation_block(/.*/, "profile")
    end
    if block
        profile.instance_eval(&block)
    end
    profile
end