Inheritance: System.Attribute
示例#1
0
 public TestHost(OptionsAttribute /*!*/ options)
 {
     _options = options;
     _pal     = options.Pal != null ? (PlatformAdaptationLayer)Activator.CreateInstance(options.Pal) :
                Driver.IsWin8 ? new Win8PAL() :
                PlatformAdaptationLayer.Default;
 }
示例#2
0
        public ScriptEngine CreateRubyEngine(bool privateBinding = false, OptionsAttribute options = null)
        {
            var runtimeSetup  = ScriptRuntimeSetup.ReadConfiguration();
            var languageSetup = runtimeSetup.AddRubySetup();

            runtimeSetup.DebugMode      = IsDebug;
            runtimeSetup.PrivateBinding = privateBinding;
            runtimeSetup.HostType       = typeof(TestHost);
            runtimeSetup.HostArguments  = new object[] { options ?? new OptionsAttribute() };

            languageSetup.Options["ApplicationBase"]       = BaseDirectory;
            languageSetup.Options["NoAdaptiveCompilation"] = NoAdaptiveCompilation;
            languageSetup.Options["CompilationThreshold"]  = CompilationThreshold;
            languageSetup.Options["Verbosity"]             = 2;

            var runtime = Ruby.CreateRuntime(runtimeSetup);

            return(Ruby.GetEngine(runtime));
        }
示例#3
0
 public TestHost(OptionsAttribute/*!*/ options) {
     _options = options;
     _pal = options.Pal != null ?
         (PlatformAdaptationLayer)Activator.CreateInstance(options.Pal) :
         PlatformAdaptationLayer.Default;
 }
示例#4
0
文件: Driver.cs 项目: TerabyteX/main
        public ScriptEngine CreateRubyEngine(bool privateBinding = false, OptionsAttribute options = null)
        {
            var runtimeSetup = ScriptRuntimeSetup.ReadConfiguration();
            var languageSetup = runtimeSetup.AddRubySetup();

            runtimeSetup.DebugMode = IsDebug;
            runtimeSetup.PrivateBinding = privateBinding;
            runtimeSetup.HostType = typeof(TestHost);
            runtimeSetup.HostArguments = new object[] { options ?? new OptionsAttribute() };

            languageSetup.Options["ApplicationBase"] = BaseDirectory;
            languageSetup.Options["NoAdaptiveCompilation"] = NoAdaptiveCompilation;
            languageSetup.Options["CompilationThreshold"] = CompilationThreshold;
            languageSetup.Options["Verbosity"] = 2;

            var runtime = Ruby.CreateRuntime(runtimeSetup);
            return Ruby.GetEngine(runtime);
        }