Hi All, I''m getting an exception when I try and use the code snippet below in Silverlight. The snippet works ok with a normal .Net app. What I am trying to do is use a Ruby script running in my Silverlight app to call a method that updates the text on a text block. public delegate void LogMessageDelegate(string message); public partial class Page : UserControl { ... private void RunScript(object sender, System.Windows.RoutedEventArgs e) { ScriptHelper scriptHelper = new ScriptHelper(WriteDebugMessage); ScriptScope scriptScope IronRuby.CreateRuntime().CreateScope("IronRuby"); scriptScope.SetVariable("sys", scriptHelper); scriptScope.Execute("sys.Log(\"hello world\")"); } private void WriteDebugMessage(string message) { m_scriptDebugText.Text = message; // m_scriptDebugText is a text block. } } public class ScriptHelper { private event LogMessageDelegate m_logMessage; public ScriptHelper(LogMessageDelegate logMessage) { m_logMessage = logMessage; } public void Log(string message) { m_logMessage(message); } } The exception I get back is: "Ruby.Runtime.RubyTopLevelScope.TopMethodMissing(Microsoft.Scripting.Runtime.CodeContext, System.Object, Ruby.Runtime.BlockParam, Microsoft.Scripting.SymbolId, System.Object[])" Is there a better approach to interacting between Silverlight UI elements and the Ruby script? I''m not using any HTML as the whole interface is built of SilverLight controls. Regards, Aaron -- Posted via http://www.ruby-forum.com/.
What''s the exception type and message? Could you please file this as a bug? It seems it should just work. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson Sent: Monday, July 14, 2008 4:50 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Using Local Variable in Silverlight Hi All, I''m getting an exception when I try and use the code snippet below in Silverlight. The snippet works ok with a normal .Net app. What I am trying to do is use a Ruby script running in my Silverlight app to call a method that updates the text on a text block. public delegate void LogMessageDelegate(string message); public partial class Page : UserControl { ... private void RunScript(object sender, System.Windows.RoutedEventArgs e) { ScriptHelper scriptHelper = new ScriptHelper(WriteDebugMessage); ScriptScope scriptScope IronRuby.CreateRuntime().CreateScope("IronRuby"); scriptScope.SetVariable("sys", scriptHelper); scriptScope.Execute("sys.Log(\"hello world\")"); } private void WriteDebugMessage(string message) { m_scriptDebugText.Text = message; // m_scriptDebugText is a text block. } } public class ScriptHelper { private event LogMessageDelegate m_logMessage; public ScriptHelper(LogMessageDelegate logMessage) { m_logMessage = logMessage; } public void Log(string message) { m_logMessage(message); } } The exception I get back is: "Ruby.Runtime.RubyTopLevelScope.TopMethodMissing(Microsoft.Scripting.Runtime.CodeContext, System.Object, Ruby.Runtime.BlockParam, Microsoft.Scripting.SymbolId, System.Object[])" Is there a better approach to interacting between Silverlight UI elements and the Ruby script? I''m not using any HTML as the whole interface is built of SilverLight controls. Regards, Aaron -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Tomas Matousek wrote:> What''s the exception type and message?The exception type is MethodAccessException and the message is: "Ruby.Runtime.RubyTopLevelScope.TopMethodMissing(Microsoft.Scripting.Runtime.CodeContext, System.Object, Ruby.Runtime.BlockParam, Microsoft.Scripting.SymbolId, System.Object[])"> Could you please file this as a bug?I submitted a bug report on the RubyForge site but is hasn''t shown up. Hopefully that''s just to do with it ebing moderated. The original code snippet works if changed to: ScriptScope scriptScope = IronRuby.CreateRuntime().CreateScope("IronPython"); or ScriptScope scriptScope = IronRuby.CreateRuntime().CreateScope("jscript"); Regards, Aaron -- Posted via http://www.ruby-forum.com/.
Oh, I know what this is. Could you verify that the method is internal in the bits you''re using? The method should be public and it is in the current code. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson Sent: Tuesday, July 15, 2008 1:49 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Using Local Variable in Silverlight Tomas Matousek wrote:> What''s the exception type and message?The exception type is MethodAccessException and the message is: "Ruby.Runtime.RubyTopLevelScope.TopMethodMissing(Microsoft.Scripting.Runtime.CodeContext, System.Object, Ruby.Runtime.BlockParam, Microsoft.Scripting.SymbolId, System.Object[])"> Could you please file this as a bug?I submitted a bug report on the RubyForge site but is hasn''t shown up. Hopefully that''s just to do with it ebing moderated. The original code snippet works if changed to: ScriptScope scriptScope IronRuby.CreateRuntime().CreateScope("IronPython"); or ScriptScope scriptScope IronRuby.CreateRuntime().CreateScope("jscript"); Regards, Aaron -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Tomas Matousek wrote:> Oh, I know what this is. Could you verify that the method is internal in > the bits you''re using? > The method should be public and it is in the current code. > > TomasHi Tomas, Do you mean the CreateScope method, i.e. IronRuby.CreateRuntime().CreateScope("IronRuby")? I was using the IronRuby version from the Silverlight DLR SDK on http://www.codeplex.com/sdlsdk release id 14254. I don''t think the method CreateScope could have been internal as I wouldn''t have been able to call it? I did attempt to build the IronRuby code from svn with the SILVERLIGHT pre-compilation option sent but got a fair few errors so tried the SDK version instead. I''ll give building from SVN another attempt. Regards, Aaron -- Posted via http://www.ruby-forum.com/.
No, I mean: Ruby.Runtime.RubyTopLevelScope.TopMethodMissing. I''m not sure you can build successfully against Silverlight. There might have been some changes in Silverlight that required us to change DLR/IronRuby code since the last public release. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson Sent: Thursday, July 17, 2008 10:32 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Using Local Variable in Silverlight Tomas Matousek wrote:> Oh, I know what this is. Could you verify that the method is internal in > the bits you''re using? > The method should be public and it is in the current code. > > TomasHi Tomas, Do you mean the CreateScope method, i.e. IronRuby.CreateRuntime().CreateScope("IronRuby")? I was using the IronRuby version from the Silverlight DLR SDK on http://www.codeplex.com/sdlsdk release id 14254. I don''t think the method CreateScope could have been internal as I wouldn''t have been able to call it? I did attempt to build the IronRuby code from svn with the SILVERLIGHT pre-compilation option sent but got a fair few errors so tried the SDK version instead. I''ll give building from SVN another attempt. Regards, Aaron -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Tomas Matousek wrote:> No, I mean: Ruby.Runtime.RubyTopLevelScope.TopMethodMissing. > > I''m not sure you can build successfully against Silverlight. There might > have been some changes in Silverlight that required us to change > DLR/IronRuby code since the last public release. > > TomasHi Tomas, I''ve checked and you are correct Ruby.Runtime.RubyTopLevelScope.TopMethodMissing is static internal . Any idea when the next IronRuby DLR release is likely to be? I can get by with using JScript within Silverlight for the time being. Thanks, Aaron -- Posted via http://www.ruby-forum.com/.
DevHawk wrote in his blog (http://devhawk.net/2008/07/17/IronPython+Post+20+Roadmap.aspx): "Besides IPy 2.1 and 3.0, the other major thing we''re working on is Visual Studio integration for IronPython ... <snip> ... (it would be nice if IronRuby could leverage our efforts down the road). Like everything else we do in this group, we''ll be publishing the VS Integration source code up on CodePlex as early and often as we can." Are there any plans for a similar VS integration for IronRuby? /Johan
Yes.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Johan Danforth > Sent: Friday, July 18, 2008 5:31 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IronRyby VS integration? > > DevHawk wrote in his blog > (http://devhawk.net/2008/07/17/IronPython+Post+20+Roadmap.aspx): > > "Besides IPy 2.1 and 3.0, the other major thing we''re working on is > Visual Studio integration for IronPython ... <snip> ... (it would be > nice if IronRuby could leverage our efforts down the road). Like > everything else we do in this group, we''ll be publishing the VS > Integration source code up on CodePlex as early and often as we can." > > Are there any plans for a similar VS integration for IronRuby? > > /Johan > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Yes and as we are in a planning stage, we are extremely eager to hear what do you guys think about IronRuby VS integration. What features you need, how does it need to look and feel? Don''t hesitate to express your thoughts on this subject. We want to make it useful and so need to know what do you want and expect. VS integration is going to be open source like IronRuby itself and I also hope we will be able to accept contributions into it too. -- Oleg -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Johan Danforth Sent: Friday, July 18, 2008 2:31 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRyby VS integration? DevHawk wrote in his blog (http://devhawk.net/2008/07/17/IronPython+Post+20+Roadmap.aspx): "Besides IPy 2.1 and 3.0, the other major thing we''re working on is Visual Studio integration for IronPython ... <snip> ... (it would be nice if IronRuby could leverage our efforts down the road). Like everything else we do in this group, we''ll be publishing the VS Integration source code up on CodePlex as early and often as we can." Are there any plans for a similar VS integration for IronRuby? /Johan _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core