1 /***************************************************************************
3 * This file is part of the KDE project
4 * copyright (C)2005 by Cyrille Berger (cberger@cberger.net)
5 * copyright (C)2006 by Sebastian Sauer (mail@dipe.org)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this program; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 ***************************************************************************/
21 #ifndef KROSS_RUBYRUBYINTERPRETER_H
22 #define KROSS_RUBYRUBYINTERPRETER_H
24 #include "rubyconfig.h"
26 #include <kross/core/krossconfig.h>
27 #include <kross/core/interpreter.h>
34 class RubyInterpreterPrivate
;
37 * This class is the bridget between Kross and Ruby.
38 * @author Cyrille Berger
40 class RubyInterpreter
: public Kross::Interpreter
47 * @param info The \a Kross::InterpreterInfo instance
48 * that describes this \a RubyInterpreter .
50 explicit RubyInterpreter(Kross::InterpreterInfo
* info
);
55 virtual ~RubyInterpreter();
58 * Factory method to create and return a new \a RubyScript instance.
60 virtual Kross::Script
* createScript(Kross::Action
* action
);
63 * @return the hash of \a RubyModule instances we know about.
65 QHash
<QString
, QPointer
<RubyModule
> > modules() const;
68 * @return the ruby object with the module Kross, this module holds class
69 * definition used by kross, and scripts object. All kross specific objects
70 * should be member of that module.
72 static VALUE
krossModule();
75 /// Initialize the ruby interpreter.
77 /// Finalize the ruby interpreter.
79 /// Load an external plugin / module.
80 static VALUE
require (VALUE
, VALUE
);
82 /// Private d-pointer.
83 static RubyInterpreterPrivate
* d
;