Created
December 15, 2009 10:54
-
-
Save seanho/256853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Reflection; | |
using IronRuby; | |
using Microsoft.Scripting.Hosting; | |
namespace IronRubyConsole | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var runtime = ScriptRuntime.CreateFromConfiguration(); | |
runtime.LoadAssembly(Assembly.LoadFrom("HtmlAgilityPack.dll")); | |
var engine = Ruby.GetEngine(runtime); | |
var context = Ruby.GetExecutionContext(engine); | |
var scope = engine.CreateScope(); | |
scope.SetVariable("output", Console.Out); | |
string filepath = Path.Combine(Environment.CurrentDirectory, "app.rb"); | |
engine.ExecuteFile(filepath, scope); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment