src/macosx/AARuby.mm

Go to the documentation of this file.
00001 /*
00002 
00003 *************************************************************************
00004 
00005 ArmageTron -- Just another Tron Lightcycle Game in 3D.
00006 Copyright (C) 2005  by 
00007 and the AA DevTeam (see the file AUTHORS(.txt) in the main source directory)
00008 
00009 **************************************************************************
00010 
00011 This program is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 This program is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020 
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024   
00025 ***************************************************************************
00026 
00027 */
00028 
00029 #include "AARuby.h"
00030 #include "aa_config.h"
00031 
00032 #ifdef HAVE_LIBRUBY
00033 #include <ruby.h>
00034 
00035 void AARuby_init_loadpath()
00036 {
00037         NSBundle *bundle = [NSBundle mainBundle];
00038     NSString *macosx = [[bundle pathForAuxiliaryExecutable:@"Armagetron Advanced"] stringByDeletingLastPathComponent];
00039         NSString *path = [NSString stringWithFormat:@"%@/../Resources/ruby", macosx];
00040     VALUE load_path = rb_gv_get("$:");
00041         rb_ary_push(load_path, rb_str_new2([[NSString stringWithFormat:@"%@/%s", path, "site_ruby/1.8"] UTF8String]));
00042         rb_ary_push(load_path, rb_str_new2([[NSString stringWithFormat:@"%@/%s", path, "site_ruby/1.8/powerpc-darwin8.7.0"] UTF8String]));
00043         rb_ary_push(load_path, rb_str_new2([[NSString stringWithFormat:@"%@/%s", path, "site_ruby"] UTF8String]));
00044         rb_ary_push(load_path, rb_str_new2([[NSString stringWithFormat:@"%@/%s", path, "1.8"] UTF8String]));
00045         rb_ary_push(load_path, rb_str_new2([[NSString stringWithFormat:@"%@/%s", path, "1.8/powerpc-darwin8.7.0"] UTF8String]));
00046 }
00047 #endif

Generated on Sat Mar 15 22:55:48 2008 for Armagetron Advanced by  doxygen 1.5.4