[Ironruby-core] Up-to-date hosting sample ?

Tomas Matousek Tomas.Matousek at microsoft.com
Mon Jan 7 02:05:07 EST 2008

You're right. The Hosting API is currently under (re)construction. Therefore the example is currently not so nice:

            IScriptEnvironment runtime = ScriptEnvironment.GetEnvironment();
            IScriptEngine engine = IronRuby.GetEngine(runtime);
            IScriptScope scope = engine.CreateScope();

            List<string> strings = new List<string>();
            IronRuby.GetExecutionContext(runtime).GlobalVariables[SymbolTable.StringToId("strings")] = strings;

            SourceUnit script = engine.CreateScriptSourceFromString(
puts ""Hello World! There are #{$strings.count.to_s} strings:""
$strings.each_with_index { |s,i| puts ""#{i}: #{s}"" }
            engine.Execute(scope, script);

It will get better soon.


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barrère
Sent: Saturday, January 05, 2008 7:19 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Up-to-date hosting sample ?


I'm preparing an IronRuby article for a french newspaper, and would
like to demonstrate the hosting features (possibly to show how to
build a small dsl to script a C# application for instance).

I'm sitting on SVN at revision 68 but can't get the wiki sample [1] to
compile - I believe the hosting stuff is currently under heavy
modification, right ?

Does anyone have an up-to-date hosting sample, or should I go back a
few revisions ?


[1] http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp

Thibaut Barrère
http://evolvingworker.com - tools for a better day
http://blog.logeek.fr - about writing software
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list