C# Paste by Anonymous
Description: None
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ScriptRuntime runtime = Ruby.CreateRuntime(); ScriptEngine engine = Ruby.GetEngine(runtime); ScriptScope scope = Engine.CreateScope(); string script = @" x = 0 for i in 1...3 do puts x end "; engine.Execute("puts 'nothing important'", scope); //Console.WriteLine("No scope ..."); //engine.CreateScriptSourceFromString(script).Compile().Execute(); Console.WriteLine("Using scope ..."); engine.CreateScriptSourceFromString(script).Compile().Execute(scope); |