Пример #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);
        }
Пример #2
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));
        }
Пример #3
0
 // copies relevant options from runtime options:
 public RubyCompilerOptions(RubyOptions /*!*/ runtimeOptions)
 {
     Compatibility = runtimeOptions.Compatibility;
 }