diff options
author | Mark Spruiell <mes@zeroc.com> | 2008-01-31 15:58:05 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2008-01-31 15:58:05 -0800 |
commit | fa41f0057235e0b7434d224f3f794166d24ccd23 (patch) | |
tree | a47724b73b79a821e37adaf36c87f0fdfca074a6 /rb/src/IceRuby/Util.cpp | |
parent | bug 2335 - updating docu for db.jar (diff) | |
download | ice-fa41f0057235e0b7434d224f3f794166d24ccd23.tar.bz2 ice-fa41f0057235e0b7434d224f3f794166d24ccd23.tar.xz ice-fa41f0057235e0b7434d224f3f794166d24ccd23.zip |
bug 2421 - add method to get Ice version in scripting languages
Diffstat (limited to 'rb/src/IceRuby/Util.cpp')
-rw-r--r-- | rb/src/IceRuby/Util.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rb/src/IceRuby/Util.cpp b/rb/src/IceRuby/Util.cpp index cdc22e09ed8..f2df9a2fa23 100644 --- a/rb/src/IceRuby/Util.cpp +++ b/rb/src/IceRuby/Util.cpp @@ -15,6 +15,25 @@ using namespace std; using namespace IceRuby; +extern "C" +VALUE +IceRuby_version(int /*argc*/, VALUE* /*argv*/, VALUE /*self*/) +{ + ICE_RUBY_TRY + { + string s = ICE_STRING_VERSION; + return createString(s); + } + ICE_RUBY_CATCH + return Qnil; +} + +void +IceRuby::initUtil(VALUE iceModule) +{ + rb_define_module_function(iceModule, "version", CAST_METHOD(IceRuby_version), -1); +} + IceRuby::RubyException::RubyException() { ex = rb_gv_get("$!"); |