ironruby

Building IronRuby WPF GUIs

99封情书 提交于 2019-12-02 08:48:00
问题 This may be a silly question but I was under the impression that it was possible to use IronRuby and MS Visual Studio 2010 together to sort of build interfaces\edit XAML in one window and code ruby in the other? Is this only possible to do with C#, Basic and C++ ? I've browsed SO and seen some IronRuby snippets like this one: button1.click do |sender, args| MessageBox.show("Hello World!") end So it stands to reason you can create GUIs somehow, but is the visual gui creator not available for

How to use ErrorListener for IronRuby

北战南征 提交于 2019-12-02 02:21:51
I have a C# program to execute an IronRuby script. But before doing that, I'd like to compile the file first to see if there is any errors. But it seems the ErrorListener does not work well. Is there anything wrong with my code? class Program { static void Main(string[] args) { try { ScriptEngine engine = null; engine = Ruby.CreateEngine(); ScriptSource sc = engine.CreateScriptSourceFromFile("MainForm.rb"); ErrorListener errLis = new MyErrorListener(); sc.Compile(errLis); } } class MyErrorListener : ErrorListener { public override void ErrorReported(ScriptSource source, string message,

Can I run rubygems in ironruby?

女生的网名这么多〃 提交于 2019-12-01 00:04:06
Is it currently possible with pre release of ironruby to run rubygems? It seems as if I have to set an environment variable to find them? You've been able to run rubygems under IronRuby for quite a while now. Simply download and install the latest IronRuby from codeplex , and run igem on the command line Original Answer: I'm on that mailing list - to save you the digging, someone asked this a few weeks ago, and this was the answer The answer (at this point) is no, you can't, but it doesn't seem like it'll be too far away. PS: listen to curt. He's on the core team for ironruby. <3 if you set

Can I run rubygems in ironruby?

有些话、适合烂在心里 提交于 2019-11-30 18:23:37
问题 Is it currently possible with pre release of ironruby to run rubygems? It seems as if I have to set an environment variable to find them? 回答1: You've been able to run rubygems under IronRuby for quite a while now. Simply download and install the latest IronRuby from codeplex, and run igem on the command line Original Answer: I'm on that mailing list - to save you the digging, someone asked this a few weeks ago, and this was the answer The answer (at this point) is no, you can't, but it doesn

Calling IronRuby from C# with a delegate

不羁岁月 提交于 2019-11-30 15:55:17
问题 Is it possible to call an IronRuby method from C# with a delegate as parameter in such a way that yield would work? The following gives me a wrong number of arguments (1 for 0) exception. Action<string> action = Console.WriteLine; var runtime = Ruby.CreateRuntime(); var engine = runtime.GetEngine("rb"); engine.Execute(@" class YieldTest def test yield 'From IronRuby' end end "); object test = engine.Runtime.Globals.GetVariable("YieldTest"); dynamic t = engine.Operations.CreateInstance(test);

Calling IronRuby from C# with a delegate

我的梦境 提交于 2019-11-30 14:49:18
Is it possible to call an IronRuby method from C# with a delegate as parameter in such a way that yield would work? The following gives me a wrong number of arguments (1 for 0) exception. Action<string> action = Console.WriteLine; var runtime = Ruby.CreateRuntime(); var engine = runtime.GetEngine("rb"); engine.Execute(@" class YieldTest def test yield 'From IronRuby' end end "); object test = engine.Runtime.Globals.GetVariable("YieldTest"); dynamic t = engine.Operations.CreateInstance(test); t.test(action); I'm sure Ruby's block is not a c# delegate. If you pass delegate to Ruby you should

Extending C# .NET application - build a custom scripting language or not?

余生长醉 提交于 2019-11-30 08:43:28
I need to build a scripting interface for my C# program that does system level testing of embedded firmware. My application contains libraries to fully interact with the devices. There are separate libraries for initiating actions, getting output and tracking success/failure. My application also has a GUI for managing multiple devices and assigning many scripts to be run. For the testers (non-programmers, but technical), I need to provide a scripting interface that will allow them to come up with different scenarios for testing and run them. They are just going to call my APIs and then return

Getting Started with IronRuby on Rails [closed]

旧街凉风 提交于 2019-11-29 02:56:16
问题 Can somebody point me to a tutorial and/or Getting Started document to get IronRuby running Rails? I'm particularly interested in a detailed, step-by-step reference, not general guidelines. 回答1: Looks like there finally is one: http://www.ironruby.net/Documentation/Rails 回答2: IronRuby already 'runs' Rails today. We demo'd it running Rails back at RailsConf 08. That said, we have a lot of fit and finish work to do on IronRuby to get it to a state where it can run Rails well . Where we're

Storing ASP.Net MVC Views in the Database

徘徊边缘 提交于 2019-11-28 03:04:44
For an ASP.Net MVC application, I'm interested in storing some views and/or partial views in the database so that a few semi-technical users can do some basic view logic. Does anyone have any tips or lessons from experience on doing this? I know Phil Haack wrote a blog post on this about a year ago. He used IronRuby for scripting his views, (which would be fine for me). He created a quick proof-of-concept, but I can't find any other information on the topic. Any ideas, thoughts, tips, etc would be appreciated. Thanks! Here you go . All that you need is to write a custom VirtualPathProvider and

Optional parens in Ruby for method with uppercase start letter?

六眼飞鱼酱① 提交于 2019-11-28 02:07:07
问题 I just started out using IronRuby (but the behaviour seems consistent when I tested it in plain Ruby) for a DSL in my .NET application - and as part of this I'm defining methods to be called from the DSL via define_method. However, I've run into an issue regarding optional parens when calling methods starting with an uppercase letter. Given the following program: class DemoClass define_method :test do puts "output from test" end define_method :Test do puts "output from Test" end def run puts