Skip to content

Instantly share code, notes, and snippets.

@seanho
Created December 15, 2009 10:54
Show Gist options
  • Save seanho/256853 to your computer and use it in GitHub Desktop.
Save seanho/256853 to your computer and use it in GitHub Desktop.
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