Hello,
I’m starting to integrate IronRuby files into a VisualStudio C# project,
mainly to write easy-to-maintain GUI builders.
As I don’t want to have .rb files lying around this deployment, I had
that
idea about embedding all the files inside an assembly, loading them at
run
time through resource manager and passing them to the IronRuby host I
would
start from C#.
While that would work, it would be even simplier to have these .rb files
compiled to some assembly.
Is there a trick to compile a bunch of .rb files to an assembly today ?
Embedding the files as resources would be your best bet, as we don’t
have compilation to an assembly working today.
Basically (compiled with outlook …):
var assembly = Assembly.GetExecutingAssembly();
var textStreamReader = new
StreamReader(assembly.GetManifestResourceStream(“foo.rb”));
var code = textStreamReader.ReadToEnd();
textStreamReader.Close();
var runtime = new ScriptRuntime();
var ruby = IronRuby.Ruby.GetEngine(runtime);
var source = ruby.CreateScriptSourceFromString(code);
var result = source.Execute();
Compilation is something we want to support though.
I’m beginning to start using an embedded IronRuby engine to create my
windows forms programmatically inside a C# application, rather than
from the designer.
thanks, I’ll keep you guys posted on my findings!
Thibaut
On Fri, Jan 9, 2009 at 10:30 PM, Tomas M.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.