예제 #1
0
        public RubyState()
        {
            #if MRUBY
            rb_state = RubyDLL.mrb_open();
            #else
            string[] argv = System.Environment.GetCommandLineArgs();
            int      argc = argv.Length;
            RubyDLL.ruby_sysinit(ref argc, argv);
            RubyDLL.ruby_init();
            RubyDLL.ruby_init_loadpath();
            #endif

            rb_object_class  = DoString("Object");
            rb_kernel_module = DoString("Kernel");

            InitBaseTypeBinding();

#if MRUBY
            // load file
            DefineMethod("dofile", _doFile, rb_args.REQ(1));
#endif
        }