1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
10 | ruby language support (C) Novell Inc. |
11 \----------------------------------------------------------------------/
13 Author: Duncan Mac-Vicar <dmacvicar@suse.de>
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version
18 2 of the License, or (at your option) any later version.
23 #include <ycp/pathsearch.h>
24 #define y2log_component "Y2Ruby"
25 #include <ycp/y2log.h>
27 // This is very important: We create one global variable of
28 // Y2CCRuby. Its constructor will register it automatically to
29 // the Y2ComponentBroker, so that will be able to find it.
30 // This all happens before main() is called!
34 Y2Component *Y2CCRuby::provideNamespace (const char *name)
36 y2debug ("Y2CCRuby::provideNamespace %s", name);
37 if (strcmp (name, "Ruby") == 0)
39 // low level functions
41 // leave implementation to later
46 // is there a ruby module?
47 // must be the same in Y2CCRuby and Y2RubyComponent
48 string module = YCPPathSearch::find (YCPPathSearch::Module, string (name) + ".rb");
52 y2milestone("Find module result: '%s'", module.c_str());
55 y2milestone("new ruby component");
56 cruby = new Y2RubyComponent();
58 y2milestone("returning existing ruby component");
62 // let someone else try creating the namespace