This repository was archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRubyScriptManager.cs
More file actions
66 lines (58 loc) · 1.4 KB
/
Copy pathRubyScriptManager.cs
File metadata and controls
66 lines (58 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using InVision.Framework.Scripting;
using IronRuby;
using IronRuby.Builtins;
using Microsoft.Scripting.Hosting;
namespace InVision.Scripting.IronRuby
{
public class RubyScriptManager : ScriptManager
{
private readonly ScriptEngine _engine;
private readonly ScriptRuntime _runtime;
/// <summary>
/// Initializes a new instance of the <see cref="RubyScriptManager"/> class.
/// </summary>
public RubyScriptManager()
{
_runtime = Ruby.CreateRuntime();
_engine = Ruby.GetEngine(_runtime);
}
/// <summary>
/// Gets the engine.
/// </summary>
/// <value>The engine.</value>
public ScriptEngine Engine
{
get { return _engine; }
}
/// <summary>
/// Gets the target extension.
/// </summary>
/// <value>The target extension.</value>
public override string TargetExtension
{
get { return ".rb"; }
}
/// <summary>
/// Loads the script.
/// </summary>
/// <param name="filename">The filename.</param>
/// <returns></returns>
public override IScript CreateScriptFrom(string filename)
{
return new RubyInterpretedScript(this, filename, CompilerOutput);
}
#region Nested type: ForceLibraryDependency
private static class ForceLibraryDependency
{
/// <summary>
/// Initializes the <see cref="ForceLibraryDependency"/> class.
/// </summary>
static ForceLibraryDependency()
{
ClrString.ToStr("abc");
}
}
#endregion
}
}