Module: Syskit::RobyApp::SingleFileDSL

Defined in:
lib/syskit/roby_app/single_file_dsl.rb

Overview

Module mixed-in the global context to provide toplevel functionality, thus allowing to create 'syskit scripts'

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



22
23
24
25
26
27
# File 'lib/syskit/roby_app/single_file_dsl.rb', line 22

def method_missing(m, *args, &block)
    if m =~ /(?:_def|_dev)$|^define$/
        return global_profile.send(m, *args, &block)
    end
    super
end

Instance Method Details

#add_mission(req) ⇒ Object



10
11
12
# File 'lib/syskit/roby_app/single_file_dsl.rb', line 10

def add_mission(req)
    Roby.app.permanent_requirements << req
end

#add_mission_task(req) ⇒ Object



13
14
15
# File 'lib/syskit/roby_app/single_file_dsl.rb', line 13

def add_mission_task(req)
    Roby.app.permanent_requirements << req
end

#profileObject



16
17
18
19
20
21
# File 'lib/syskit/roby_app/single_file_dsl.rb', line 16

def profile
    if block_given?
        global_profile.instance_eval(&proc)
    end
    global_profile
end