Example #1
0
        protected override ScriptRuntime /*!*/ CreateRuntime()
        {
            string        root              = IronRubyToolsPackage.Instance.IronRubyBinPath;
            string        configPath        = IronRubyToolsPackage.Instance.IronRubyExecutable + ".config";
            LanguageSetup existingRubySetup = null;
            LanguageSetup rubySetup         = Ruby.CreateRubySetup();

            if (File.Exists(configPath))
            {
                try {
                    existingRubySetup = GetSetupByName(ScriptRuntimeSetup.ReadConfiguration(configPath), "IronRuby");
                } catch {
                    // TODO: report the error
                }
            }

            if (existingRubySetup != null)
            {
                var options = new RubyOptions(existingRubySetup.Options);
                rubySetup.Options["StandardLibraryPath"] = NormalizePaths(root, new[] { options.StandardLibraryPath })[0];
                rubySetup.Options["RequiredPaths"]       = NormalizePaths(root, options.RequirePaths);
                rubySetup.Options["SearchPaths"]         = NormalizePaths(root, options.SearchPaths);
            }

            var runtimeSetup = new ScriptRuntimeSetup();

            runtimeSetup.LanguageSetups.Add(rubySetup);
            return(RemoteScriptFactory.CreateRuntime(runtimeSetup));
        }
        public RubyScriptingRuntime()
        {
            _defaultLanguageSetup = Ruby.CreateRubySetup();

            var setup = new ScriptRuntimeSetup();

            setup.LanguageSetups.Add(_defaultLanguageSetup);
            _scriptingRuntime = new ScriptRuntime(setup);
        }
Example #3
0
        private static ScriptRuntime InitializeIronRuby()
        {
            var rubySetup = Ruby.CreateRubySetup();

            var runtimeSetup = new ScriptRuntimeSetup();

            runtimeSetup.LanguageSetups.Add(rubySetup);
            runtimeSetup.DebugMode = true;

            return(Ruby.CreateRuntime(runtimeSetup));
        }
Example #4
0
        private static RubyEngine InitializeIronRuby(IPathProvider vpp)
        {
            var rubySetup    = Ruby.CreateRubySetup();
            var runtimeSetup = new ScriptRuntimeSetup();

            runtimeSetup.LanguageSetups.Add(rubySetup);
            runtimeSetup.DebugMode = true;
//            runtimeSetup.HostType = typeof (MvcScriptHost);

            var runtime = Ruby.CreateRuntime(runtimeSetup);

            return(new RubyEngine(runtime, vpp));
        }
Example #5
0
        public ScriptRuntime CreateRuntime()
        {
            var rubySetup = Ruby.CreateRubySetup();

            rubySetup.Options["InterpretedMode"] = true;

            var runtimeSetup = new ScriptRuntimeSetup();

            runtimeSetup.LanguageSetups.Add(rubySetup);
            runtimeSetup.DebugMode = true;

            return(Ruby.CreateRuntime(runtimeSetup));
        }
Example #6
0
        protected override void EstablishContext()
        {
            if (_scriptRuntime == null)
            {
                var rubySetup = Ruby.CreateRubySetup();
                rubySetup.Options["InterpretedMode"] = true;

                var runtimeSetup = new ScriptRuntimeSetup();
                runtimeSetup.LanguageSetups.Add(rubySetup);
                runtimeSetup.DebugMode = true;

                _scriptRuntime = Ruby.CreateRuntime(runtimeSetup);
            }
            _engine  = _scriptRuntime.GetRubyEngine();
            _context = Ruby.GetExecutionContext(_engine);
        }
Example #7
0
 protected override LanguageSetup CreateLanguageSetup()
 {
     return(Ruby.CreateRubySetup());
 }
Example #8
0
 public static ScriptRuntime GetRuntime()
 {
     return(Nova.CreateRuntime(Nova.CreateNovaSetup(), Ruby.CreateRubySetup()));
 }