/*!*/ 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); }
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)); }
// copies relevant options from runtime options: public RubyCompilerOptions(RubyOptions /*!*/ runtimeOptions) { Compatibility = runtimeOptions.Compatibility; }