00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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