Skip to content

Instantly share code, notes, and snippets.

@leandrosilva
Created November 19, 2010 00:22
Show Gist options
  • Save leandrosilva/705943 to your computer and use it in GitHub Desktop.
Save leandrosilva/705943 to your computer and use it in GitHub Desktop.
A stupid Ruby scripting from a C# program on Mono 2.8
#!/bin/bash
dmcs -r:/opt/ironruby/bin/IronRuby.dll \
-r:/opt/ironruby/bin/IronRuby.Libraries.dll \
-r:/opt/ironruby/bin/Microsoft.Scripting.dll \
-r:/opt/ironruby/bin/Microsoft.Scripting.Core.dll \
program.cs
using Microsoft.Scripting.Hosting;
class Program {
static void Main(string[] args)
{
ScriptEngine engine = IronRuby.Ruby.CreateEngine();
ScriptSource source = engine.CreateScriptSourceFromString("puts 'Hello from IronRuby'");
source.Execute();
}
}
#!/bin/bash
MONO_PATH=$MONO_PATH:/opt/ironruby/bin/
export MONO_PATH
mono program.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment