Method: Roby::Application#register_plugin

Defined in:
lib/roby/app.rb

#register_plugin(name, mod, path: nil, &init) ⇒ Object



2894
2895
2896
2897
2898
2899
2900
2901
2902
# File 'lib/roby/app.rb', line 2894

def register_plugin(name, mod, path: nil, &init)
    unless path
        caller_m = /^([^:]+):\d/.match(caller(1)[0])
        path = File.expand_path(File.dirname(caller_m[1]))
    end

    available_plugins.delete_if { |n| n == name }
    available_plugins << [name, path, mod, init]
end