From Tomas.Matousek at microsoft.com Sun Feb 1 01:30:21 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sat, 31 Jan 2009 22:30:21 -0800 Subject: [Ironruby-core] Extending modules defined in a ruby library via C# In-Reply-To: References: <3bf20550901311035k6eab669ancec4f5aa89b0107d@mail.gmail.com> Message-ID: That's absolutely true for arbitrary CLR types. Library types (those marked by RubyClass attribute) are handled differently though. They can be seen like collections of extension methods. So it makes sense to extend a Ruby class using library methods. So far we were focused on extending CLR types using library types. Extending Ruby classes could be seen as a feature that is not implemented yet. Could you file a feature request (bug) on RubyForge? A possible workaround for you: define a C# method that takes a Ruby class and extends it in manually using methods on RubyModule/RubyClass (AddMethod etc.). You would call this helper after loading the assembly. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Curt Hagenlocher Sent: Saturday, January 31, 2009 3:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Extending modules defined in a ruby library via C# .NET types can never be 100% compatible with Ruby classes; the semantics are simply too different. What would you expect to happen, for instance, if you were to say the following: module System::IDisposable; end class System::Collections::ArrayList; include System::IDisposable; end; x = System::Collections::ArrayList.new require 'mscorlib' Clearly, the "real" System::Collections::ArrayList can't implement IDisposable because the type is immutable. And the type we created to represent the variable x can't be a "real" ArrayList because we didn't know about that class when x was allocated. So this leaves us with two possibilities: 1) Always overwrite the previously defined constants with the newly imported CLR types 2) Fail to load the redefined types ...and we're currently doing the first. While it seems reasonable to fail, it raises questions about what to do if 40 types can be loaded successfully but one can't be. Do we raise an exception even though there were 40 successes? Or do we fail to load any types at all? Monkey-patching CLR types is never going to be able to work identically to monkey-patching pure Ruby types. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Saturday, January 31, 2009 10:35 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Extending modules defined in a ruby library via C# Hi, I think I've stumbled on a bug of IronRuby, but I would like to hear your thoughts about this before filing a report on the bug tracker as I might be missing something or doing something wrong. I have a ruby library in which is defined a module and this module holds a few classes and constants. Then I wrote a library in C# where the same module is defined to add more classes other than the ones defined on the ruby side. Now if I load the assembly first and then i require my ruby library everything works fine, but if I require the ruby library first and then load the assembly, the module defined by the ruby lib gets totally wiped off leaving there only what was defined in the assembly. Given that in similar scenarios we obviously can't use Extends = typeof(...) in the RubyModuleAttribute, shouldn't modules previously defined in ruby code be automatically extended instead of being erased/redefined (which is definitely broken)? Right below here you can find the code to reproduce and verify the reported behaviour (for convenience I also made an attachment to this mail). # =========== foo.rb =========== def test(a) a.each{ |s| puts "#{s} is #{begin eval(s); rescue NameError; 'undefined' end}"} end module Foo class Bar; end VERSION = 1 end /* ======== Nrk.Foo.Test.cs ======== */ namespace Nrk.Foo.Test { [RubyModule] public static class Foo { [RubyClass] public static class Hoge { [RubyMethod("piyo?", RubyMethodAttributes.PublicSingleton)] public static bool Piyo(Object self) { return true; } } } } # =========== test_assembly_first.rb =========== load_assembly 'Nrk.Foo.Test', 'Nrk.Foo.Test' require 'foo.rb' test ['Foo', 'Foo::Bar', 'Foo::VERSION', 'Foo::Hoge', 'Foo::Hoge.piyo?'] # =========== test_ruby_first.rb =========== require 'foo.rb' load_assembly 'Nrk.Foo.Test', 'Nrk.Foo.Test' test ['Foo', 'Foo::Bar', 'Foo::VERSION', 'Foo::Hoge', 'Foo::Hoge.piyo?'] # =========== OUTPUT #1 =========== Foo is Foo Foo::Bar is Foo::Bar Foo::VERSION is 1 Foo::Hoge is Foo::Hoge Foo::Hoge.piyo? is true # =========== OUTPUT #2 =========== Foo is Foo Foo::Bar is undefined Foo::VERSION is undefined Foo::Hoge is Foo::Hoge Foo::Hoge.piyo? is true -- Daniele Alessandri http://www.clorophilla.net/blog/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From suppakilla at gmail.com Sun Feb 1 04:54:38 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Sun, 1 Feb 2009 10:54:38 +0100 Subject: [Ironruby-core] Extending modules defined in a ruby library via C# In-Reply-To: References: <3bf20550901311035k6eab669ancec4f5aa89b0107d@mail.gmail.com> Message-ID: <3bf20550902010154kc67522drb1f157f38500e3b5@mail.gmail.com> On Sun, Feb 1, 2009 at 07:30, Tomas Matousek wrote: > That's absolutely true for arbitrary CLR types. Library types > (those marked by RubyClass attribute) are handled differently > though. They can be seen like collections of extension methods. > So it makes sense to extend a Ruby class using library methods. In fact, I think the described behaviour is perfectly fine for CLR types and I was sort of expecting this, but not for those types marked by RubyClass. > So far we were focused on extending CLR types using library > types. Extending Ruby classes could be seen as a feature that > is not implemented yet. Could you file a feature request (bug) on > RubyForge? OK, I will file it later. Maybe I will assign a lower priority to this as I guess it is not really a common scenario and I don't know how many folks are trying to build extension libs for IronRuby. But still, IMHO it would be nice to get this fixed before going 1.0. > A possible workaround for you: define a C# method that takes > a Ruby class and extends it in manually using methods on > RubyModule/RubyClass (AddMethod etc.). You would call this > helper after loading the assembly. Yeah I was thinking about something along that way, I was just waiting for confirmations before going on. FYI I got into this particular case while porting Florian Frank's json library (see http://json.rubyforge.org/) which provides two variants for the core bits, namely "extension" (implemented in C) or "pure" (ruby). Both relies on a few methods, classes and constants previously defined in the same module in which they are loaded (JSON). When loading the JSON::Ext::Parser, I was getting everything in JSON and JSON::Ext erased. require 'json/common' module JSON module Ext # require 'json/ext/parser' # require 'json/ext/generator' load_assembly 'IronRuby.Libraries.Json', 'IronRuby.Libraries.Json' $DEBUG and warn "Using c extension for JSON." JSON.parser = Parser JSON.generator = Generator end end I could also define the Parser and Generator classes into a different global module and then assign them (e.g. JSON.parser = IronJson::Ext::Parser), but well there is no fun doing this :-) -- Daniele Alessandri http://www.clorophilla.net/blog/ From ivan at flanders.co.nz Sun Feb 1 14:03:03 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 1 Feb 2009 20:03:03 +0100 Subject: [Ironruby-core] Using the generated initializer Message-ID: Hi I thought I created a ruby module and ruby class but I must be doing something wrong. using RubyMethodAttributes=IronRuby.Runtime.RubyMethodAttributes; using RubyModuleDefinition = IronRuby.Runtime.RubyModuleAttribute; using RubyClassDefinition = IronRuby.Runtime.RubyClassAttribute; using RubyMethodDefinition = IronRuby.Runtime.RubyMethodAttribute; namespace IronRubyMvcLibrary.Controllers { [RubyModuleDefinition("IronRubyMvc")] public static class IronRubyMvcModule { [RubyClassDefinition("Controller", Extends = typeof(RubyController))] public class RubyControllerOps { [RubyMethodDefinition("info", RubyMethodAttributes.PublicInstance)] public static void Info(RubyController self) { self.ViewData().Add("Platform", "IronRuby Mvc 1.0"); } } } } I then used the classinitgenerator to create an initializer class. But when I require the assembly after compiling I can't get to IronRubyMvc or the class. Do I need to do something else? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 1 15:30:17 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 1 Feb 2009 12:30:17 -0800 Subject: [Ironruby-core] Using the generated initializer In-Reply-To: References: Message-ID: Any reason why you don?t prefer to work with RubyController class directly from Ruby code? ? class RubyController def info view_data.add(?Platform?, ?IronRuby Mvc 1.0?) end end Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Sunday, February 01, 2009 11:03 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Using the generated initializer Hi I thought I created a ruby module and ruby class but I must be doing something wrong. using RubyMethodAttributes=IronRuby.Runtime.RubyMethodAttributes; using RubyModuleDefinition = IronRuby.Runtime.RubyModuleAttribute; using RubyClassDefinition = IronRuby.Runtime.RubyClassAttribute; using RubyMethodDefinition = IronRuby.Runtime.RubyMethodAttribute; namespace IronRubyMvcLibrary.Controllers { [RubyModuleDefinition("IronRubyMvc")] public static class IronRubyMvcModule { [RubyClassDefinition("Controller", Extends = typeof(RubyController))] public class RubyControllerOps { [RubyMethodDefinition("info", RubyMethodAttributes.PublicInstance)] public static void Info(RubyController self) { self.ViewData().Add("Platform", "IronRuby Mvc 1.0"); } } } } I then used the classinitgenerator to create an initializer class. But when I require the assembly after compiling I can't get to IronRubyMvc or the class. Do I need to do something else? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sun Feb 1 16:04:54 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 1 Feb 2009 22:04:54 +0100 Subject: [Ironruby-core] Using the generated initializer In-Reply-To: References: Message-ID: That is what I'm doing now The other question was out of curiosity :) On Sun, Feb 1, 2009 at 9:30 PM, Tomas Matousek wrote: > Any reason why you don't prefer to work with RubyController class > directly from Ruby code? > > > > ? > > > > class RubyController > > def info > > view_data.add("Platform", "IronRuby Mvc 1.0") > > end > > end > > > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Sunday, February 01, 2009 11:03 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Using the generated initializer > > > > Hi > > I thought I created a ruby module and ruby class but I must be doing > something wrong. > > using RubyMethodAttributes=IronRuby.Runtime.RubyMethodAttributes; > using RubyModuleDefinition = IronRuby.Runtime.RubyModuleAttribute; > using RubyClassDefinition = IronRuby.Runtime.RubyClassAttribute; > using RubyMethodDefinition = IronRuby.Runtime.RubyMethodAttribute; > > namespace IronRubyMvcLibrary.Controllers > { > [RubyModuleDefinition("IronRubyMvc")] > public static class IronRubyMvcModule > { > [RubyClassDefinition("Controller", Extends = > typeof(RubyController))] > public class RubyControllerOps > { > [RubyMethodDefinition("info", > RubyMethodAttributes.PublicInstance)] > public static void Info(RubyController self) > { > self.ViewData().Add("Platform", "IronRuby Mvc 1.0"); > } > } > > } > } > > I then used the classinitgenerator to create an initializer class. > But when I require the assembly after compiling I can't get to IronRubyMvc > or the class. > > Do I need to do something else? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sun Feb 1 16:21:40 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 1 Feb 2009 22:21:40 +0100 Subject: [Ironruby-core] progress on ironrubymvc :) In-Reply-To: References: <1F955E12-E5ED-4F0F-8887-77BD2224ED17@microsoft.com> Message-ID: I just checked in a somewhat working implementation of asp.net mvc and IronRuby. It is also much faster than I expected. There is no support for filters and the likes yet but you should be able to define controllers. It should also be able to recognize controller actions and controller files by using underscored notation or pascal casing. On Fri, Jan 30, 2009 at 7:30 PM, Ivan Porto Carrero wrote: > Yep I forked your project. I don't have it running yet.. and i did get the > source code of the asp.net mvc RC1. > Indeed my first goal was to take it to the state it was before.. i think > that is the most basic implementation possible. When that works I did want > to flesh it out so that it knows how to handle urls with other characters > than just alphanumeric. > > I'm also thinking to replace the custom attributes with class methods like > I rails uses for filters etc. > > > > > > On Fri, Jan 30, 2009 at 6:37 PM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > >> Did you fork my ironrubymvc project? If so, i'd love to pull any changes >> you made into it. However, it sounds like you got it to the state it was in >> before, just updating the ironruby bits? That System.Func/Action clash is >> a known issue; my suggested work-around for now is to not have ironrubymvc >> depend on system.core. >> >> I'll get on phil to merge his changes as well, and then well have a >> up-to-date mvc integration :) >> >> ~JimmySent from my phone >> >> On Jan 30, 2009, at 3:55 AM, "Ivan Porto Carrero" >> wrote: >> >> Hi >> I think I can have a very basic version of ironruby mvc going over the >> weekend.. that will probably be without support for things like filters etc. >> yet.. but you should be able to define a controller and actions in >> ironruby. >> I haven't looked at the view engine yet and I'm unclear as to which >> strategy to use because if ERB works properly then that seem like a great >> fit to me or should I keep the view engine that is in the current repository >> and improve on that one iteratively >> >> If there are more people interested in using ironruby with asp.net mvc I >> do have a good idea of what work is involved and how hard it is. There is a >> fair amount of work involved that means I would need a couple of spikes to >> get it all going. To make the controllers work etc. I think I will have to >> define new descriptors that use the the ironruby infrastructure. >> Does anybody know if the descriptors in the asp.net mvc framework are >> currently set in stone or if they are still pretty volatile, that is the >> biggest risk for the controller implementation IMHO? >> >> Also there is a conflict between 2 types in the System namespace. >> System.Func is defined in 2 places. I aliased the System.Core assembly and >> am using the type from System.Core. This does give some weird results >> because apparently System.Func<>, System.Core,..,... and System.Func<>, >> System.Core aren't the same when the mvc framework checks for the types of >> the parameter. Any tips to get around this? Am I doing something wrong? >> >> I'll integrate Andrew Peters' inflector to take care of pascal casing, >> snake casing and pluralisations etc. unless there are objections. >> >> It would be good to get some kind of indication/document of what is >> important from the asp.net, asp.net mvc and the ironruby teams so that I >> can take that into account when I'm coding this thing up. >> >> Cheers >> Ivan >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 1 16:55:41 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 1 Feb 2009 13:55:41 -0800 Subject: [Ironruby-core] Using the generated initializer In-Reply-To: References: Message-ID: Good ?. BTW: Do you load the library using load_assembly , ? E.g. load_assembly 'IronRuby.Libraries', 'IronRuby.StandardLibrary.Sockets' Just requiring the assembly loads it as regular .NET assembly w/o invoking IronRuby library loader. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Sunday, February 01, 2009 1:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Using the generated initializer That is what I'm doing now The other question was out of curiosity :) On Sun, Feb 1, 2009 at 9:30 PM, Tomas Matousek > wrote: Any reason why you don't prefer to work with RubyController class directly from Ruby code? ? class RubyController def info view_data.add("Platform", "IronRuby Mvc 1.0") end end Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Sunday, February 01, 2009 11:03 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Using the generated initializer Hi I thought I created a ruby module and ruby class but I must be doing something wrong. using RubyMethodAttributes=IronRuby.Runtime.RubyMethodAttributes; using RubyModuleDefinition = IronRuby.Runtime.RubyModuleAttribute; using RubyClassDefinition = IronRuby.Runtime.RubyClassAttribute; using RubyMethodDefinition = IronRuby.Runtime.RubyMethodAttribute; namespace IronRubyMvcLibrary.Controllers { [RubyModuleDefinition("IronRubyMvc")] public static class IronRubyMvcModule { [RubyClassDefinition("Controller", Extends = typeof(RubyController))] public class RubyControllerOps { [RubyMethodDefinition("info", RubyMethodAttributes.PublicInstance)] public static void Info(RubyController self) { self.ViewData().Add("Platform", "IronRuby Mvc 1.0"); } } } } I then used the classinitgenerator to create an initializer class. But when I require the assembly after compiling I can't get to IronRubyMvc or the class. Do I need to do something else? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From jirapong.nanta at gmail.com Sun Feb 1 20:53:24 2009 From: jirapong.nanta at gmail.com (jirapong.nanta at gmail.com) Date: Mon, 2 Feb 2009 08:53:24 +0700 Subject: [Ironruby-core] igem.bat In-Reply-To: References: Message-ID: <21BA3540-99A3-4DDD-B036-0BC500A920EA@gmail.com> Hello Ivan, ok, now i put two errors after that. c:\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED \Builtins\KernelOps.cs:406:in `require': no such file to load -- thread.so (LoadError) #this one resolve by put C:\ruby\lib\ruby\1.8\i386-mswin32 on LibraryPaths I cannot get around this error c:\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED \Builtins\KernelOps.cs:406:in `require': The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) (LoadError) Any advice? Thank you, -Jirapong On Jan 31, 2009, at 3:16 PM, Ivan Porto Carrero wrote: > You have to edit ir.exe.config and change the paths to reflect your > installation. > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > GSM: +32.486.787.582 > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > > > > On Sat, Jan 31, 2009 at 8:30 AM, jirapong.nanta at gmail.com > wrote: > How can i get igem.bat work correctly? right now, I get following > error. > > C:\dotNET\ironruby\ironruby\Merlin\Main\Languages\Ruby\Scripts > \bin>SET GEM_PATH=C:\ruby\lib\ruby\gems\1.8 > > C:\dotNET\ironruby\ironruby\Merlin\Main\Languages\Ruby\Scripts > \bin>set path=%path%;C:\dotNET\ironruby\ironruby\Merlin\Ma > in\bin\debug;C:\ruby\lib\ruby\gems\1.8 > > C:\dotNET\ironruby\ironruby\Merlin\Main\Languages\Ruby\Scripts > \bin>igem.bat list > c:\dotNET\ironruby\ironruby\Merlin\Main\Languages\Ruby > \Libraries.LCA_RESTRICTED\Builtins\KernelOps.cs:406:in `require': > no such file to load -- rubygems (LoadError) > from :0 > > Use latest version from GitHub (1ee05cdd) > > Thank you, > -Jirapong > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Tue Feb 3 13:36:46 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 3 Feb 2009 19:36:46 +0100 Subject: [Ironruby-core] Silverlight + Silverline Message-ID: Hi With the latest version of ironruby and rails; silverline doesn't want to work. I haven't really spent much time on it but a few months ago I did commit to doing a presentation on Rails + Silverline + IronRuby this weekend. I have no intention of messing about in that code, it's my new resolution for the year... sometimes say no. That being said if there are some decks available for Silverlight + Rails I'd love to see them ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Feb 3 21:08:08 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 3 Feb 2009 18:08:08 -0800 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> I'm not sure how it does against the newest version of Rails. http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem install rails -v2.0.2" then silverline-demos will work. The last time I spoke about silverline was in this talk: http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html Look for the section titled "Rails integration". If there's other things you'd like to know for your talk, let me know. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, February 03, 2009 10:37 AM To: ironruby-core Subject: [Ironruby-core] Silverlight + Silverline Hi With the latest version of ironruby and rails; silverline doesn't want to work. I haven't really spent much time on it but a few months ago I did commit to doing a presentation on Rails + Silverline + IronRuby this weekend. I have no intention of messing about in that code, it's my new resolution for the year... sometimes say no. That being said if there are some decks available for Silverlight + Rails I'd love to see them ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 3 21:19:25 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 3 Feb 2009 21:19:25 -0500 Subject: [Ironruby-core] Git push In-Reply-To: References: Message-ID: Build is currently broken and it appears that MERLIN_ROOT is still required? On Fri, Jan 30, 2009 at 4:48 PM, Jim Deville wrote: > Sorry for missing the past couple of days, but I have finally pushed a > new revision to Github. As of this change (1ee05cdd), MERLIN_ROOT is no > longer required. You can now download it, get into a VS Command prompt, and > run rake compile from Merlin/Main/Languages/Ruby. Let me know if you have > problems. > > > > Enjoy! > > JD > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 3 22:25:06 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 3 Feb 2009 22:25:06 -0500 Subject: [Ironruby-core] Git push In-Reply-To: References: Message-ID: FWIW, the major issue seems to be Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.Build.csproj not including Runtime\BindingRestrictionsHelpers.cs On Tue, Feb 3, 2009 at 9:19 PM, Michael Letterle wrote: > Build is currently broken and it appears that MERLIN_ROOT is still > required? > > On Fri, Jan 30, 2009 at 4:48 PM, Jim Deville wrote: > >> Sorry for missing the past couple of days, but I have finally pushed a >> new revision to Github. As of this change (1ee05cdd), MERLIN_ROOT is no >> longer required. You can now download it, get into a VS Command prompt, and >> run rake compile from Merlin/Main/Languages/Ruby. Let me know if you have >> problems. >> >> >> >> Enjoy! >> >> JD >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Wed Feb 4 01:46:38 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 3 Feb 2009 22:46:38 -0800 Subject: [Ironruby-core] Git push In-Reply-To: References: Message-ID: I just pushed again, fixing this error. I tested before I did the merge to master, and apparently that merge got messed up. I have tested this version before pushing. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Tuesday, February 03, 2009 7:25 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Git push FWIW, the major issue seems to be Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.Build.csproj not including Runtime\BindingRestrictionsHelpers.cs On Tue, Feb 3, 2009 at 9:19 PM, Michael Letterle > wrote: Build is currently broken and it appears that MERLIN_ROOT is still required? On Fri, Jan 30, 2009 at 4:48 PM, Jim Deville > wrote: Sorry for missing the past couple of days, but I have finally pushed a new revision to Github. As of this change (1ee05cdd), MERLIN_ROOT is no longer required. You can now download it, get into a VS Command prompt, and run rake compile from Merlin/Main/Languages/Ruby. Let me know if you have problems. Enjoy! JD _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 4 02:01:57 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 3 Feb 2009 23:01:57 -0800 Subject: [Ironruby-core] Git push In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F034@NA-EXMSG-C116.redmond.corp.microsoft.com> Don't worry everyone, I'll make a I-Broke-The-Build hat and make Jim wear it all day tomorrow. =) That's if I remember ... which is unlikely. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, February 03, 2009 10:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Git push I just pushed again, fixing this error. I tested before I did the merge to master, and apparently that merge got messed up. I have tested this version before pushing. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Tuesday, February 03, 2009 7:25 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Git push FWIW, the major issue seems to be Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.Build.csproj not including Runtime\BindingRestrictionsHelpers.cs On Tue, Feb 3, 2009 at 9:19 PM, Michael Letterle > wrote: Build is currently broken and it appears that MERLIN_ROOT is still required? On Fri, Jan 30, 2009 at 4:48 PM, Jim Deville > wrote: Sorry for missing the past couple of days, but I have finally pushed a new revision to Github. As of this change (1ee05cdd), MERLIN_ROOT is no longer required. You can now download it, get into a VS Command prompt, and run rake compile from Merlin/Main/Languages/Ruby. Let me know if you have problems. Enjoy! JD _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Wed Feb 4 02:17:51 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 4 Feb 2009 08:17:51 +0100 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Thanks.. I already stole all your content ;) The demo project silverline-demos does work even with rails 2.2.2 I was trying to create my own demos and that doesn't work. Anyway there is plenty of impressive stuff in the silverline-demos project so I'll just demo those. On Wed, Feb 4, 2009 at 3:08 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > I'm not sure how it does against the newest version of Rails. > http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem > install rails -v2.0.2" then silverline-demos will work. > > > > The last time I spoke about silverline was in this talk: > > http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html > > > > Look for the section titled "Rails integration". If there's other things > you'd like to know for your talk, let me know. > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Tuesday, February 03, 2009 10:37 AM > *To:* ironruby-core > *Subject:* [Ironruby-core] Silverlight + Silverline > > > > Hi > > > > With the latest version of ironruby and rails; silverline doesn't want to > work. > > I haven't really spent much time on it but a few months ago I did commit to > doing a presentation on Rails + Silverline + IronRuby this weekend. > I have no intention of messing about in that code, it's my new resolution > for the year... sometimes say no. > > That being said if there are some decks available for Silverlight + Rails > I'd love to see them ;) > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 4 03:00:13 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 4 Feb 2009 00:00:13 -0800 Subject: [Ironruby-core] http://ironruby.info Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F046@NA-EXMSG-C116.redmond.corp.microsoft.com> Check out http://ironruby.info, a new site for tracking IronRuby perf, RubySpec results, and other random nuggets of info. Read more about it here: http://blog.jimmy.schementi.com/2009/02/ironrubyinfo.html ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.nutter at sun.com Wed Feb 4 05:08:00 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Wed, 04 Feb 2009 04:08:00 -0600 Subject: [Ironruby-core] http://ironruby.info In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F046@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F046@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <49896900.6060109@sun.com> Jimmy Schementi wrote: > Check out http://ironruby.info, a new site for tracking IronRuby perf, > RubySpec results, and other random nuggets of info. Read more about it > here: http://blog.jimmy.schementi.com/2009/02/ironrubyinfo.html Nice...I'll have to set something like that up for JRuby. Maybe the IR-specific bits could be pulled out into a separate file, so the same stats-doohicky could support multiple impls? - Charlie From ivan at flanders.co.nz Wed Feb 4 05:37:39 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 4 Feb 2009 11:37:39 +0100 Subject: [Ironruby-core] videos over IronRuby Message-ID: Hi, I did a couple presentations the last few months on IronRuby or Silverlight + Rails. One was at Devoxx 2008, which I gravely underestimated, where I actually use a lot of content from Jimmy's presentation and I fail horribly. I didn't watch that video because I just know it is really really bad. That presentation was joint with somebody from Microsoft but I couldn't yet find it on the parleys.com site where it is supposed to be published. Then I did one at an Italian Alt.NET gathering. I tried to watch it last night and had to stop because it is more scary than a horror movie. At least now I know I suck at presenting I can learn and do it better next time. I should have done that a long time ago :). I knew I had an accent when speaking english I just didn't know it was that bad either. http://vimeo.com/3059773 Cheers Ivan Disclaimer: don't watch right after eating food or right before going to bed. I am not responsible for any damage or harm inflicted by the video ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.nutter at sun.com Wed Feb 4 06:21:23 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Wed, 04 Feb 2009 05:21:23 -0600 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: Message-ID: <49897A33.4010707@sun.com> Ivan Porto Carrero wrote: > Hi, > > I did a couple presentations the last few months on IronRuby or > Silverlight + Rails. > > One was at Devoxx 2008, which I gravely underestimated, where I actually > use a lot of content from Jimmy's presentation and I fail horribly. I > didn't watch that video because I just know it is really really bad. > That presentation was joint with somebody from Microsoft but I couldn't > yet find it on the parleys.com site where it is > supposed to be published. I wish I'd have known you were going to be there...Devoxx is pretty Ruby-slim, and we could have hung out a bit. Perhaps next event! - Charlie From ivan at flanders.co.nz Wed Feb 4 07:20:07 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 4 Feb 2009 13:20:07 +0100 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: <49897A33.4010707@sun.com> References: <49897A33.4010707@sun.com> Message-ID: I hope so.. but after my performance I think I will have to do some serious ass kissing before MS will invite me again. On Wed, Feb 4, 2009 at 12:21 PM, Charles Oliver Nutter < charles.nutter at sun.com> wrote: > Ivan Porto Carrero wrote: > >> Hi, >> >> I did a couple presentations the last few months on IronRuby or >> Silverlight + Rails. >> >> One was at Devoxx 2008, which I gravely underestimated, where I actually >> use a lot of content from Jimmy's presentation and I fail horribly. I didn't >> watch that video because I just know it is really really bad. >> That presentation was joint with somebody from Microsoft but I couldn't >> yet find it on the parleys.com site where it is >> supposed to be published. >> > > I wish I'd have known you were going to be there...Devoxx is pretty > Ruby-slim, and we could have hung out a bit. Perhaps next event! > > - Charlie > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 4 16:00:13 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 4 Feb 2009 13:00:13 -0800 Subject: [Ironruby-core] http://ironruby.info In-Reply-To: <49896900.6060109@sun.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F046@NA-EXMSG-C116.redmond.corp.microsoft.com> <49896900.6060109@sun.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F2DA@NA-EXMSG-C116.redmond.corp.microsoft.com> Charles Oliver Nutter wrote: > Jimmy Schementi wrote: > > Check out http://ironruby.info, a new site for tracking IronRuby > perf, > > RubySpec results, and other random nuggets of info. Read more about > it > > here: http://blog.jimmy.schementi.com/2009/02/ironrubyinfo.html > > Nice...I'll have to set something like that up for JRuby. Maybe the > IR-specific bits could be pulled out into a separate file, so the same > stats-doohicky could support multiple impls? Thanks, and it would be awesome to have it compare to JRuby too. It'll be relatively easy to make it "Run impl X against MatzRuby". I also want to add JRuby up there as well as yet another point of comparison, but you can spin up your own site regardless. I'll let you know when it can run against multiple implementations. From charles.nutter at sun.com Wed Feb 4 16:34:28 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Wed, 04 Feb 2009 15:34:28 -0600 Subject: [Ironruby-core] http://ironruby.info In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F2DA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F046@NA-EXMSG-C116.redmond.corp.microsoft.com> <49896900.6060109@sun.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F2DA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <498A09E4.1030704@sun.com> Jimmy Schementi wrote: > Charles Oliver Nutter wrote: >> Jimmy Schementi wrote: >>> Check out http://ironruby.info, a new site for tracking IronRuby >> perf, >>> RubySpec results, and other random nuggets of info. Read more about >> it >>> here: http://blog.jimmy.schementi.com/2009/02/ironrubyinfo.html >> Nice...I'll have to set something like that up for JRuby. Maybe the >> IR-specific bits could be pulled out into a separate file, so the same >> stats-doohicky could support multiple impls? > > Thanks, and it would be awesome to have it compare to JRuby too. It'll be relatively easy to make it "Run impl X against MatzRuby". I also want to add JRuby up there as well as yet another point of comparison, but you can spin up your own site regardless. I'll let you know when it can run against multiple implementations. Cool, let me know how I can help. From charles.nutter at sun.com Wed Feb 4 16:35:03 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Wed, 04 Feb 2009 15:35:03 -0600 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: <49897A33.4010707@sun.com> Message-ID: <498A0A07.8030109@sun.com> It gets easier :) Dig up videos of my RubyConf 2005 talk or Tom and my JavaOne 2006 talks. Dismal. Ivan Porto Carrero wrote: > I hope so.. but after my performance I think I will have to do some > serious ass kissing before MS will invite me again. > > > > On Wed, Feb 4, 2009 at 12:21 PM, Charles Oliver Nutter > > wrote: > > Ivan Porto Carrero wrote: > > Hi, > > I did a couple presentations the last few months on IronRuby or > Silverlight + Rails. > > One was at Devoxx 2008, which I gravely underestimated, where I > actually use a lot of content from Jimmy's presentation and I > fail horribly. I didn't watch that video because I just know it > is really really bad. > That presentation was joint with somebody from Microsoft but I > couldn't yet find it on the parleys.com > site where it is supposed to be published. > > > I wish I'd have known you were going to be there...Devoxx is pretty > Ruby-slim, and we could have hung out a bit. Perhaps next event! > > - Charlie > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Jimmy.Schementi at microsoft.com Wed Feb 4 17:02:02 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 4 Feb 2009 14:02:02 -0800 Subject: [Ironruby-core] Code Review: netinterop1 In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F369@NA-EXMSG-C116.redmond.corp.microsoft.com> Sorry about the delay on this. Here are my comments: 1. Does MSpec have shared behaviors, like Rake or Bacon? If so, you should try to remove the duplication of managing engines and whatnot that you have in before/after blocks. For example: shared ".NET Test" do before { @engine = IronRuby.create_engine } after { @engine = nil } end describe "Midifying and reloading a .NET BCL Assembly" do behaves_like ".NET Test" end 2. There's a lot of duplication in the "Repeated loading of a .NET BCL assembly with Strong name", and examples like that, so can you do something like this: it "only loads once with require followed by require" do [true, false].each do |t| @engine.execute("require 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'").should == t end end or where the loading mechanism changes it "loads twice with load followed by load_assembly" do ['load', 'load_assembly'].each do |t| @engine.execute("#{t} 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'").should == true end end Otherwise, it's a great start! > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Friday, January 30, 2009 10:20 PM > To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers; > Srivatsn Narayanan > Subject: Re: [Ironruby-core] Code Review: netinterop1 > > Srivatsn, > > Can you take a look? > > JD > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Monday, January 26, 2009 1:03 PM > > To: IronRuby External Code Reviewers; Srivatsn Narayanan > > Cc: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Code Review: netinterop1 > > > > tfpt review "/shelveset:netinterop1;REDMOND\jdeville" > > Comment : > > More tests for .net interop. This is taking advantage of the > IronRuby > > selfhosting that Tomas blogged about in order to maintain isolation > as > > I run different styles of requiring files. If you add > > Merlin/External/Languages/IronRuby/mspec/mspec/bin to your path, you > > should be able to run these with "mspec -fs /path/to/Interop/Load" > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From blowmage at gmail.com Wed Feb 4 17:26:13 2009 From: blowmage at gmail.com (Mike Moore) Date: Wed, 4 Feb 2009 15:26:13 -0700 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: <498A0A07.8030109@sun.com> References: <49897A33.4010707@sun.com> <498A0A07.8030109@sun.com> Message-ID: On Wed, Feb 4, 2009 at 2:35 PM, Charles Oliver Nutter < charles.nutter at sun.com> wrote: > It gets easier :) Dig up videos of my RubyConf 2005 talk or Tom and my > JavaOne 2006 talks. Dismal. > Does a video of your RubyConf 2005 session exist?!? I can find audio and slides, but the only video I've found is from Sunday. I'd *love* to have video of your session. http://brainspl.at/articles/2005/12/01/rubyconf-files-resurrected RubyConf 2005 had a huge impact on me and I'd love to relive it. I had one of the few Windows laptops there and I remember installing Litestep during your talk. I used to run it back in the day and I had no idea you were the PM for it before you mentioned it in your session. Ahh memories... -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 4 17:28:28 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 4 Feb 2009 14:28:28 -0800 Subject: [Ironruby-core] Ruby 1.9.1 stable released In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> IronRuby is targeting 1.8.6 compatibility (modulo continuations) with Ruby on Windows first. There are some Ruby 1.9 features which we have designed IronRuby to support in future versions. This will eventually happen, but 1.8.6 compat will need to happen first. > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Friday, January 30, 2009 3:52 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Ruby 1.9.1 stable released > > The goalposts just got moved... > > http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/ > > Apologies if this is old news. > > This begs the question, is IronRuby eventually going to target 1.9? > Any ideas on when or if this might happen? > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From blowmage at gmail.com Wed Feb 4 17:39:40 2009 From: blowmage at gmail.com (Mike Moore) Date: Wed, 4 Feb 2009 15:39:40 -0700 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: Message-ID: On Wed, Feb 4, 2009 at 3:37 AM, Ivan Porto Carrero wrote: > > Then I did one at an Italian Alt.NET gathering. I tried to watch it last > night and had to stop because it is more scary than a horror movie. At least > now I know I suck at presenting I can learn and do it better next time. I > should have done that a long time ago :). I knew I had an accent when > speaking english I just didn't know it was that bad either. > http://vimeo.com/3059773 > Ivan, you are way too hard on yourself. I'm only half way through and so far its great. Awesome show, great job! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 4 17:42:28 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 4 Feb 2009 14:42:28 -0800 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F3BA@NA-EXMSG-C116.redmond.corp.microsoft.com> If you pull the latest bits from github.com/jschementi/agdlr, you can demo the new repl too. Go to samples/ruby/photoviewer =) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, February 03, 2009 11:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Silverlight + Silverline Thanks.. I already stole all your content ;) The demo project silverline-demos does work even with rails 2.2.2 I was trying to create my own demos and that doesn't work. Anyway there is plenty of impressive stuff in the silverline-demos project so I'll just demo those. On Wed, Feb 4, 2009 at 3:08 AM, Jimmy Schementi > wrote: I'm not sure how it does against the newest version of Rails. http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem install rails -v2.0.2" then silverline-demos will work. The last time I spoke about silverline was in this talk: http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html Look for the section titled "Rails integration". If there's other things you'd like to know for your talk, let me know. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, February 03, 2009 10:37 AM To: ironruby-core Subject: [Ironruby-core] Silverlight + Silverline Hi With the latest version of ironruby and rails; silverline doesn't want to work. I haven't really spent much time on it but a few months ago I did commit to doing a presentation on Rails + Silverline + IronRuby this weekend. I have no intention of messing about in that code, it's my new resolution for the year... sometimes say no. That being said if there are some decks available for Silverlight + Rails I'd love to see them ;) _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowmage at gmail.com Wed Feb 4 17:43:02 2009 From: blowmage at gmail.com (Mike Moore) Date: Wed, 4 Feb 2009 15:43:02 -0700 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: Message-ID: On Wed, Feb 4, 2009 at 3:39 PM, Mike Moore wrote: > On Wed, Feb 4, 2009 at 3:37 AM, Ivan Porto Carrero wrote: > >> >> Then I did one at an Italian Alt.NET gathering. I tried to watch it last >> night and had to stop because it is more scary than a horror movie. At least >> now I know I suck at presenting I can learn and do it better next time. I >> should have done that a long time ago :). I knew I had an accent when >> speaking english I just didn't know it was that bad either. >> http://vimeo.com/3059773 >> > > Ivan, you are way too hard on yourself. I'm only half way through and so > far its great. Awesome show, great job! > But I'd suggest springing for Confreaks next time so we can see the text in your slides! :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From nrstott at gmail.com Wed Feb 4 21:41:07 2009 From: nrstott at gmail.com (Nathan Stott) Date: Wed, 4 Feb 2009 20:41:07 -0600 Subject: [Ironruby-core] Ruby 1.9.1 stable released In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: What are "modulo continuations"? I've never heard that term. I've done very little ruby work but am interested in the topic. I did a quick google and only things related to iron ruby came back when I entered modulo continuations. On Wed, Feb 4, 2009 at 4:28 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > IronRuby is targeting 1.8.6 compatibility (modulo continuations) with Ruby > on Windows first. There are some Ruby 1.9 features which we have designed > IronRuby to support in future versions. This will eventually happen, but > 1.8.6 compat will need to happen first. > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Orion Edwards > > Sent: Friday, January 30, 2009 3:52 PM > > To: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Ruby 1.9.1 stable released > > > > The goalposts just got moved... > > > > http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/ > > > > Apologies if this is old news. > > > > This begs the question, is IronRuby eventually going to target 1.9? > > Any ideas on when or if this might happen? > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nrstott at gmail.com Wed Feb 4 21:47:03 2009 From: nrstott at gmail.com (Nathan Stott) Date: Wed, 4 Feb 2009 20:47:03 -0600 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: Message-ID: Your English accent is fine. If you work on your 'r' no one will even know what country you are from. No native English speaker would have any difficulty understanding you. On Wed, Feb 4, 2009 at 4:37 AM, Ivan Porto Carrero wrote: > Hi, > I did a couple presentations the last few months on IronRuby or Silverlight > + Rails. > > One was at Devoxx 2008, which I gravely underestimated, where I actually > use a lot of content from Jimmy's presentation and I fail horribly. I didn't > watch that video because I just know it is really really bad. > That presentation was joint with somebody from Microsoft but I couldn't yet > find it on the parleys.com site where it is supposed to be published. > > Then I did one at an Italian Alt.NET gathering. I tried to watch it last > night and had to stop because it is more scary than a horror movie. At least > now I know I suck at presenting I can learn and do it better next time. I > should have done that a long time ago :). I knew I had an accent when > speaking english I just didn't know it was that bad either. > http://vimeo.com/3059773 > > Cheers > Ivan > > Disclaimer: don't watch right after eating food or right before going to > bed. I am not responsible for any damage or harm inflicted by the video ;) > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Thu Feb 5 01:05:43 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Wed, 4 Feb 2009 22:05:43 -0800 Subject: [Ironruby-core] Ruby 1.9.1 stable released In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: "modulo" in this sense means "excluding" -- that we're not considering the item. Continuations are described at http://en.wikipedia.org/wiki/Continuation. Implementing continuations on top of the CLR would be pretty challenging, and (as I understand it) they're not widely used in the Ruby community. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Nathan Stott Sent: Wednesday, February 04, 2009 6:41 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Ruby 1.9.1 stable released What are "modulo continuations"? I've never heard that term. I've done very little ruby work but am interested in the topic. I did a quick google and only things related to iron ruby came back when I entered modulo continuations. On Wed, Feb 4, 2009 at 4:28 PM, Jimmy Schementi > wrote: IronRuby is targeting 1.8.6 compatibility (modulo continuations) with Ruby on Windows first. There are some Ruby 1.9 features which we have designed IronRuby to support in future versions. This will eventually happen, but 1.8.6 compat will need to happen first. > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Friday, January 30, 2009 3:52 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Ruby 1.9.1 stable released > > The goalposts just got moved... > > http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/ > > Apologies if this is old news. > > This begs the question, is IronRuby eventually going to target 1.9? > Any ideas on when or if this might happen? > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 5 01:34:51 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 4 Feb 2009 22:34:51 -0800 Subject: [Ironruby-core] Ruby 1.9.1 stable released In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: IronRuby targets 1.8.6, except for continuations. We also will have optional support for ObjectSpace. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Nathan Stott Sent: Wednesday, February 04, 2009 6:41 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Ruby 1.9.1 stable released What are "modulo continuations"? I've never heard that term. I've done very little ruby work but am interested in the topic. I did a quick google and only things related to iron ruby came back when I entered modulo continuations. On Wed, Feb 4, 2009 at 4:28 PM, Jimmy Schementi > wrote: IronRuby is targeting 1.8.6 compatibility (modulo continuations) with Ruby on Windows first. There are some Ruby 1.9 features which we have designed IronRuby to support in future versions. This will eventually happen, but 1.8.6 compat will need to happen first. > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Friday, January 30, 2009 3:52 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Ruby 1.9.1 stable released > > The goalposts just got moved... > > http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/ > > Apologies if this is old news. > > This begs the question, is IronRuby eventually going to target 1.9? > Any ideas on when or if this might happen? > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Feb 5 01:35:25 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 5 Feb 2009 07:35:25 +0100 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F3BA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F3BA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Sweet thanks a lot. :) 2009/2/4 Jimmy Schementi > If you pull the latest bits from github.com/jschementi/agdlr, you can > demo the new repl too. Go to samples/ruby/photoviewer =) > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Tuesday, February 03, 2009 11:18 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Silverlight + Silverline > > > > Thanks.. I already stole all your content ;) > The demo project silverline-demos does work even with rails 2.2.2 > I was trying to create my own demos and that doesn't work. > > Anyway there is plenty of impressive stuff in the silverline-demos project > so I'll just demo those. > > > On Wed, Feb 4, 2009 at 3:08 AM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > I'm not sure how it does against the newest version of Rails. > http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem > install rails -v2.0.2" then silverline-demos will work. > > > > The last time I spoke about silverline was in this talk: > > http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html > > > > Look for the section titled "Rails integration". If there's other things > you'd like to know for your talk, let me know. > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Tuesday, February 03, 2009 10:37 AM > *To:* ironruby-core > *Subject:* [Ironruby-core] Silverlight + Silverline > > > > Hi > > > > With the latest version of ironruby and rails; silverline doesn't want to > work. > > I haven't really spent much time on it but a few months ago I did commit to > doing a presentation on Rails + Silverline + IronRuby this weekend. > I have no intention of messing about in that code, it's my new resolution > for the year... sometimes say no. > > That being said if there are some decks available for Silverlight + Rails > I'd love to see them ;) > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Feb 5 05:25:42 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 5 Feb 2009 02:25:42 -0800 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F3BA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F5F8@NA-EXMSG-C116.redmond.corp.microsoft.com> No problem. The stuff hasn?t made it to master yet, so it?s all in the dev/window branch. So, just make sure to run: git branch --track -b dev/window origin/dev/window ... and then do a build. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Wednesday, February 04, 2009 10:35 PM To: ironruby-core Subject: Re: [Ironruby-core] Silverlight + Silverline Sweet thanks a lot. :) 2009/2/4 Jimmy Schementi > If you pull the latest bits from github.com/jschementi/agdlr, you can demo the new repl too. Go to samples/ruby/photoviewer =) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, February 03, 2009 11:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Silverlight + Silverline Thanks.. I already stole all your content ;) The demo project silverline-demos does work even with rails 2.2.2 I was trying to create my own demos and that doesn't work. Anyway there is plenty of impressive stuff in the silverline-demos project so I'll just demo those. On Wed, Feb 4, 2009 at 3:08 AM, Jimmy Schementi > wrote: I'm not sure how it does against the newest version of Rails. http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem install rails -v2.0.2" then silverline-demos will work. The last time I spoke about silverline was in this talk: http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html Look for the section titled "Rails integration". If there's other things you'd like to know for your talk, let me know. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, February 03, 2009 10:37 AM To: ironruby-core Subject: [Ironruby-core] Silverlight + Silverline Hi With the latest version of ironruby and rails; silverline doesn't want to work. I haven't really spent much time on it but a few months ago I did commit to doing a presentation on Rails + Silverline + IronRuby this weekend. I have no intention of messing about in that code, it's my new resolution for the year... sometimes say no. That being said if there are some decks available for Silverlight + Rails I'd love to see them ;) _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From nrstott at gmail.com Thu Feb 5 08:57:23 2009 From: nrstott at gmail.com (Nathan Stott) Date: Thu, 5 Feb 2009 07:57:23 -0600 Subject: [Ironruby-core] Ruby 1.9.1 stable released In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F39B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Hah, I've never heard modulo used in any sense except "1 % 6". Learn something new everyday. Thanks guys. On Thu, Feb 5, 2009 at 12:05 AM, Curt Hagenlocher wrote: > "modulo" in this sense means "excluding" -- that we're not considering > the item. Continuations are described at > http://en.wikipedia.org/wiki/Continuation. Implementing continuations on > top of the CLR would be pretty challenging, and (as I understand it) they're > not widely used in the Ruby community. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Nathan Stott > *Sent:* Wednesday, February 04, 2009 6:41 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Ruby 1.9.1 stable released > > > > What are "modulo continuations"? I've never heard that term. I've done > very little ruby work but am interested in the topic. I did a quick google > and only things related to iron ruby came back when I entered modulo > continuations. > > On Wed, Feb 4, 2009 at 4:28 PM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > IronRuby is targeting 1.8.6 compatibility (modulo continuations) with Ruby > on Windows first. There are some Ruby 1.9 features which we have designed > IronRuby to support in future versions. This will eventually happen, but > 1.8.6 compat will need to happen first. > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Orion Edwards > > Sent: Friday, January 30, 2009 3:52 PM > > To: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Ruby 1.9.1 stable released > > > > The goalposts just got moved... > > > > http://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-released/ > > > > Apologies if this is old news. > > > > This begs the question, is IronRuby eventually going to target 1.9? > > Any ideas on when or if this might happen? > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Feb 5 13:28:24 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 5 Feb 2009 19:28:24 +0100 Subject: [Ironruby-core] automating VS Message-ID: Hi A while ago I remeber seeing a screencast where John Lam shows how to use ironruby to automate visual studio. I can't find the screencast anymore but I would be interested to know which API was used. Was that just using EnvDTE ? I'm asking because at work we are using GAT to automate visual studio and to create a kind of software factory (without the visual designers) When it comes to developing with GAT I think most of us will agree that there are more pleasant ways to develop and debug your work. So I may get the chance to get them to use IronRuby for some of that stuff as long as we can hide from the use case/LOB developers. Using GAT for us is a hazard to make our sprints. Most of our story points for example go into GAT development and debugging, granted that we do make it do some crazy stuff too. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Feb 5 13:30:19 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 5 Feb 2009 19:30:19 +0100 Subject: [Ironruby-core] automating VS Message-ID: Hi A while ago I remeber seeing a screencast where John Lam shows how to use ironruby to automate visual studio. I can't find the screencast anymore but I would be interested to know which API was used. Was that just using EnvDTE ? I'm asking because at work we are using GAT to automate visual studio and to create a kind of software factory (without the visual designers) When it comes to developing with GAT I think most of us will agree that there are more pleasant ways to develop and debug your work. So I may get the chance to get them to use IronRuby for some of that stuff as long as we can hide from the use case/LOB developers. Using GAT for us is a hazard to make our sprints. Most of our story points for example go into GAT development and debugging, granted that we do make it do some crazy stuff too. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Feb 5 13:30:34 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 5 Feb 2009 19:30:34 +0100 Subject: [Ironruby-core] Silverlight + Silverline In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F5F8@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1EF65@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F3BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F5F8@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Sweet I will try that tonight. 2009/2/5 Jimmy Schementi > No problem. The stuff hasn't made it to master yet, so it's all in the > dev/window branch. So, just make sure to run: > > > > git branch --track -b dev/window origin/dev/window > > > > ... and then do a build. > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Wednesday, February 04, 2009 10:35 PM > *To:* ironruby-core > > *Subject:* Re: [Ironruby-core] Silverlight + Silverline > > > > Sweet thanks a lot. :) > > 2009/2/4 Jimmy Schementi > > If you pull the latest bits from github.com/jschementi/agdlr, you can demo > the new repl too. Go to samples/ruby/photoviewer =) > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Tuesday, February 03, 2009 11:18 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Silverlight + Silverline > > > > Thanks.. I already stole all your content ;) > The demo project silverline-demos does work even with rails 2.2.2 > I was trying to create my own demos and that doesn't work. > > Anyway there is plenty of impressive stuff in the silverline-demos project > so I'll just demo those. > > On Wed, Feb 4, 2009 at 3:08 AM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > I'm not sure how it does against the newest version of Rails. > http://silverline.schementi.com uses Rails 2.0.2, so if you do "gem > install rails -v2.0.2" then silverline-demos will work. > > > > The last time I spoke about silverline was in this talk: > > http://blog.jimmy.schementi.com/2008/12/jimmy-hacking-at-microsoft.html > > > > Look for the section titled "Rails integration". If there's other things > you'd like to know for your talk, let me know. > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Tuesday, February 03, 2009 10:37 AM > *To:* ironruby-core > *Subject:* [Ironruby-core] Silverlight + Silverline > > > > Hi > > > > With the latest version of ironruby and rails; silverline doesn't want to > work. > > I haven't really spent much time on it but a few months ago I did commit to > doing a presentation on Rails + Silverline + IronRuby this weekend. > I have no intention of messing about in that code, it's my new resolution > for the year... sometimes say no. > > That being said if there are some decks available for Silverlight + Rails > I'd love to see them ;) > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Thu Feb 5 14:11:56 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Thu, 5 Feb 2009 14:11:56 -0500 Subject: [Ironruby-core] automating VS In-Reply-To: References: Message-ID: Ivan, The RubyConf2008 talk? It's on confreaks: http://rubyconf2008.confreaks.com/ironruby.html I'm pretty sure it's using the new managed API for VS2010.. EnvDTE is painfull... On Thu, Feb 5, 2009 at 1:30 PM, Ivan Porto Carrero wrote: > Hi > > A while ago I remeber seeing a screencast where John Lam shows how to use > ironruby to automate visual studio. > I can't find the screencast anymore but I would be interested to know which > API was used. Was that just using EnvDTE ? > > I'm asking because at work we are using GAT to automate visual studio and > to create a kind of software factory (without the visual designers) > When it comes to developing with GAT I think most of us will agree that > there are more pleasant ways to develop and debug your work. > > So I may get the chance to get them to use IronRuby for some of that stuff > as long as we can hide from the use case/LOB developers. > Using GAT for us is a hazard to make our sprints. Most of our story points > for example go into GAT development and debugging, granted that we do make > it do some crazy stuff too. > > Thanks > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Thu Feb 5 14:25:04 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Thu, 5 Feb 2009 14:25:04 -0500 Subject: [Ironruby-core] automating VS In-Reply-To: References: Message-ID: D'oh, it's not RubyConf it's PDC: http://mschnlnine.vo.llnwd.net/d1/pdc08/WMV/TL44.wmv check around the 35minute mark. On Thu, Feb 5, 2009 at 2:11 PM, Michael Letterle wrote: > Ivan, > > The RubyConf2008 talk? It's on confreaks: > http://rubyconf2008.confreaks.com/ironruby.html > > I'm pretty sure it's using the new managed API for VS2010.. EnvDTE is > painfull... > > On Thu, Feb 5, 2009 at 1:30 PM, Ivan Porto Carrero wrote: > >> Hi >> >> A while ago I remeber seeing a screencast where John Lam shows how to use >> ironruby to automate visual studio. >> I can't find the screencast anymore but I would be interested to know >> which API was used. Was that just using EnvDTE ? >> >> I'm asking because at work we are using GAT to automate visual studio and >> to create a kind of software factory (without the visual designers) >> When it comes to developing with GAT I think most of us will agree that >> there are more pleasant ways to develop and debug your work. >> >> So I may get the chance to get them to use IronRuby for some of that stuff >> as long as we can hide from the use case/LOB developers. >> Using GAT for us is a hazard to make our sprints. Most of our story points >> for example go into GAT development and debugging, granted that we do make >> it do some crazy stuff too. >> >> Thanks >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Thu Feb 5 19:44:42 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 5 Feb 2009 16:44:42 -0800 Subject: [Ironruby-core] Code Review: IO7 Message-ID: tfpt review "/shelveset:IO7;REDMOND\tomat" Reviewed F2F by Curt. 1) Includes inherited overloads in CLR method groups (RubyMethodGroupInfo). Method groups can now comprise of methods that are declared in multiple derived types. This might be a bit strange concept for Ruby programmer since "overloads" can only be defined in a C library in Ruby and all of them in a single class. Some examples how basic Ruby operations work with CLR inherited overloads: CLR hierarchy: class A { void f(int); } class B : A { void f(int, int); } class C : B { void f(int, int, int); } Ruby view: class A: "f" => MethodGroup { A::f(int) } class B: "f" => MethodGroup { A::f(int), B::f(int, int) } class C: "f" => MethodGroup { A::f(int), B::f(int, int), C::f(int, int, int) } Following calls work: C.new.f(1) C.new.f(1,2) C.new.f(1,2,3) In each case, C#f is found and overload resolution based on passed argument types is performed on overloads contained in C#f group. If B is monkey-patched class B def f; end end the new Ruby method hides all overloads in B and above. The Ruby view is now: class A: "f" => MethodGroup { A::f(int) } class B: "f" => RubyMethod class C: "f" => MethodGroup { C::f(int, int, int) } It is no longer possible to call A::f, B::f overloads from an instance of C: C.new.f(1) # error C.new.f(1,2) # calls Ruby method C.new.f(1,2,3) # calls C::f(int,int,int) overload If we remove B#f, we get to the previous state: class B remove_method :f end C.new.f(1) # works C.new.f(1,2) # works C.new.f(1,2,3) # works Strangely enough, we can remove "f" again from B - now it would be the CLR method group "f" (see #2). 2) Enables removing CLR methods. If CLR method group "f" is removed from a class (say X) then all CLR methods "f" that are declared below the first member "f" (in the inheritance hierarchy) that is not a CLR method group are not accessible from an instance of X or any of its subclasses. This also means that it is not possible to remove a method override and call the overridden method, since the overridden method is removed as well along with the override. This behavior is consistent with CLR restrictions on virtual method calls - it is not verifiable to call an overridden virtual method directly. Although the restriction is unnecessary for non-virtual new-slot methods, which could be called directly, it makes the semantics and implementation simpler. Removing a CLR method group just hides all CLR methods of the same name below the first non-CLR or non-method member. 3) Removes some exceptions thrown from Ruby meta-object binders. Eventually Ruby binders will use "fallback" mechanism instead of throwing exceptions, this is the first step. Implements a new caching mechanism for calls to methods that are handled by method_missing. 5) Moves version tracking from RubyModule to RubyClasses. We don't need to track versions of mixins. 6) Replaces strong references to dependent modules with weak ones. The number of weak references allocated for tracking class hierarchy dependencies is exactly equal to the number of classes in the hierarchy. Each class defines a weak reference pointing to itself and this weak reference is reused in all lists that track dependency on this class. 7) Reimplements dynamic site cache invalidation for mixin inclusions. Previously we invalidated far too many sites that don't need to be invalidated. Reduces site cache invalidation rate during RoR startup phase to 33% of the current value (from 9161 invalidated rules to 3017). In the table below, the two numbers for each module update operation are the number of modules whose version is incremented due to the update and the number of rules that are bound to the old version. Such rules' tests are going to be evaluated to false next time they are invoked. Before: module operation modules rules Object IncludeModules 201 5644 Kernel SetMethod: require 34 1138 Object IncludeModules 58 495 Object IncludeModules 70 382 Object SetMethod: require 81 317 Kernel IncludeModules 50 308 Module SetMethod: append_features 18 254 Enumerable IncludeModules 9 242 Array CreateInstanceSingleton 1 59 Module IncludeModules 46 47 Module IncludeModules 47 44 Array IncludeModules 1 32 Object IncludeModules 81 27 SetMethod: method_added 12 24 Class SetMethod: inherited 15 19 Set CreateInstanceSingleton 1 13 Hash IncludeModules 1 11 Class IncludeModules 23 11 Array CreateInstanceSingleton 1 10 String IncludeModules 1 8 IncludeModules 1 8 IncludeModules 1 7 IncludeModules 1 7 Hash IncludeModules 1 6 Symbol IncludeModules 1 6 String IncludeModules 1 5 IncludeModules 1 5 Integer IncludeModules 2 4 Inflector SetMethod: inflections 2 4 IncludeModules 1 4 IncludeModules 1 4 REXML::XMLDecl CreateInstanceSingleton 1 3 Integer IncludeModules 2 2 IncludeModules 1 2 IncludeModules 1 2 RemoveMethodNoEvent 1 1 String IncludeModules 1 1 IncludeModules 1 1 IncludeModules 1 1 SetMethod: included 1 1 IncludeModules 1 1 SetMethod: new 1 1 After: UPDATED: Object SetMethod: require 425 1592 UPDATED: Object SetMethod: require 200 966 UPDATED: Module SetMethod: append_features 135 259 UPDATED: Array CreateInstanceSingleton 4 82 UPDATED: Class SetMethod: inherited 126 58 UPDATED: SetMethod: method_added 110 24 UPDATED: Set CreateInstanceSingleton 2 13 UPDATED: Array CreateInstanceSingleton 5 10 UPDATED: SetMethod: inherited 1 4 UPDATED: REXML::XMLDecl CreateInstanceSingleton 1 3 UPDATED: SetMethod: inherited 1 2 UPDATED: RemoveMethodNoEvent 1 1 UPDATED: SetMethod: inherited 1 1 UPDATED: SetMethod: included 1 1 UPDATED: SetMethod: new 1 1 Further optimizations might include special caching policy for require, append_features, inherited, method_added and other Ruby "notifications". 8) Fixes various bugs related to the features implemented/improved and adds bunch of unit tests. Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 5 19:49:47 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 5 Feb 2009 16:49:47 -0800 Subject: [Ironruby-core] Code Review: netinterop1 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F369@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6A1F369@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Updated shelveset, and diff. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 04, 2009 2:02 PM To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers; Srivatsn Narayanan Subject: Re: [Ironruby-core] Code Review: netinterop1 Sorry about the delay on this. Here are my comments: 1. Does MSpec have shared behaviors, like Rake or Bacon? If so, you should try to remove the duplication of managing engines and whatnot that you have in before/after blocks. For example: shared ".NET Test" do before { @engine = IronRuby.create_engine } after { @engine = nil } end describe "Midifying and reloading a .NET BCL Assembly" do behaves_like ".NET Test" end 2. There's a lot of duplication in the "Repeated loading of a .NET BCL assembly with Strong name", and examples like that, so can you do something like this: it "only loads once with require followed by require" do [true, false].each do |t| @engine.execute("require 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'").should == t end end or where the loading mechanism changes it "loads twice with load followed by load_assembly" do ['load', 'load_assembly'].each do |t| @engine.execute("#{t} 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'").should == true end end Otherwise, it's a great start! > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Friday, January 30, 2009 10:20 PM > To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers; > Srivatsn Narayanan > Subject: Re: [Ironruby-core] Code Review: netinterop1 > > Srivatsn, > > Can you take a look? > > JD > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Monday, January 26, 2009 1:03 PM > > To: IronRuby External Code Reviewers; Srivatsn Narayanan > > Cc: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Code Review: netinterop1 > > > > tfpt review "/shelveset:netinterop1;REDMOND\jdeville" > > Comment : > > More tests for .net interop. This is taking advantage of the > IronRuby > > selfhosting that Tomas blogged about in order to maintain isolation > as > > I run different styles of requiring files. If you add > > Merlin/External/Languages/IronRuby/mspec/mspec/bin to your path, you > > should be able to run these with "mspec -fs /path/to/Interop/Load" > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- A non-text attachment was scrubbed... Name: netinterop1.diff Type: application/octet-stream Size: 17906 bytes Desc: netinterop1.diff URL: From Tomas.Matousek at microsoft.com Thu Feb 5 19:57:22 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 5 Feb 2009 16:57:22 -0800 Subject: [Ironruby-core] Code Review: OI7 Message-ID: Sending again with the right shelveset name this time. tfpt review "/shelveset:OI7;REDMOND\tomat" Reviewed F2F by Curt. 1) Includes inherited overloads in CLR method groups (RubyMethodGroupInfo). Method groups can now comprise of methods that are declared in multiple derived types. This might be a bit strange concept for Ruby programmer since "overloads" can only be defined in a C library in Ruby and all of them in a single class. Some examples how basic Ruby operations work with CLR inherited overloads: CLR hierarchy: class A { void f(int); } class B : A { void f(int, int); } class C : B { void f(int, int, int); } Ruby view: class A: "f" => MethodGroup { A::f(int) } class B: "f" => MethodGroup { A::f(int), B::f(int, int) } class C: "f" => MethodGroup { A::f(int), B::f(int, int), C::f(int, int, int) } Following calls work: C.new.f(1) C.new.f(1,2) C.new.f(1,2,3) In each case, C#f is found and overload resolution based on passed argument types is performed on overloads contained in C#f group. If B is monkey-patched class B def f; end end the new Ruby method hides all overloads in B and above. The Ruby view is now: class A: "f" => MethodGroup { A::f(int) } class B: "f" => RubyMethod class C: "f" => MethodGroup { C::f(int, int, int) } It is no longer possible to call A::f, B::f overloads from an instance of C: C.new.f(1) # error C.new.f(1,2) # calls Ruby method C.new.f(1,2,3) # calls C::f(int,int,int) overload If we remove B#f, we get to the previous state: class B remove_method :f end C.new.f(1) # works C.new.f(1,2) # works C.new.f(1,2,3) # works Strangely enough, we can remove "f" again from B - now it would be the CLR method group "f" (see #2). 2) Enables removing CLR methods. If CLR method group "f" is removed from a class (say X) then all CLR methods "f" that are declared below the first member "f" (in the inheritance hierarchy) that is not a CLR method group are not accessible from an instance of X or any of its subclasses. This also means that it is not possible to remove a method override and call the overridden method, since the overridden method is removed as well along with the override. This behavior is consistent with CLR restrictions on virtual method calls - it is not verifiable to call an overridden virtual method directly. Although the restriction is unnecessary for non-virtual new-slot methods, which could be called directly, it makes the semantics and implementation simpler. Removing a CLR method group just hides all CLR methods of the same name below the first non-CLR or non-method member. 3) Removes some exceptions thrown from Ruby meta-object binders. Eventually Ruby binders will use "fallback" mechanism instead of throwing exceptions, this is the first step. Implements a new caching mechanism for calls to methods that are handled by method_missing. 5) Moves version tracking from RubyModule to RubyClasses. We don't need to track versions of mixins. 6) Replaces strong references to dependent modules with weak ones. The number of weak references allocated for tracking class hierarchy dependencies is exactly equal to the number of classes in the hierarchy. Each class defines a weak reference pointing to itself and this weak reference is reused in all lists that track dependency on this class. 7) Reimplements dynamic site cache invalidation for mixin inclusions. Previously we invalidated far too many sites that don't need to be invalidated. Reduces site cache invalidation rate during RoR startup phase to 33% of the current value (from 9161 invalidated rules to 3017). In the table below, the two numbers for each module update operation are the number of modules whose version is incremented due to the update and the number of rules that are bound to the old version. Such rules' tests are going to be evaluated to false next time they are invoked. Before: module operation modules rules Object IncludeModules 201 5644 Kernel SetMethod: require 34 1138 Object IncludeModules 58 495 Object IncludeModules 70 382 Object SetMethod: require 81 317 Kernel IncludeModules 50 308 Module SetMethod: append_features 18 254 Enumerable IncludeModules 9 242 Array CreateInstanceSingleton 1 59 Module IncludeModules 46 47 Module IncludeModules 47 44 Array IncludeModules 1 32 Object IncludeModules 81 27 SetMethod: method_added 12 24 Class SetMethod: inherited 15 19 Set CreateInstanceSingleton 1 13 Hash IncludeModules 1 11 Class IncludeModules 23 11 Array CreateInstanceSingleton 1 10 String IncludeModules 1 8 IncludeModules 1 8 IncludeModules 1 7 IncludeModules 1 7 Hash IncludeModules 1 6 Symbol IncludeModules 1 6 String IncludeModules 1 5 IncludeModules 1 5 Integer IncludeModules 2 4 Inflector SetMethod: inflections 2 4 IncludeModules 1 4 IncludeModules 1 4 REXML::XMLDecl CreateInstanceSingleton 1 3 Integer IncludeModules 2 2 IncludeModules 1 2 IncludeModules 1 2 RemoveMethodNoEvent 1 1 String IncludeModules 1 1 IncludeModules 1 1 IncludeModules 1 1 SetMethod: included 1 1 IncludeModules 1 1 SetMethod: new 1 1 After: UPDATED: Object SetMethod: require 425 1592 UPDATED: Object SetMethod: require 200 966 UPDATED: Module SetMethod: append_features 135 259 UPDATED: Array CreateInstanceSingleton 4 82 UPDATED: Class SetMethod: inherited 126 58 UPDATED: SetMethod: method_added 110 24 UPDATED: Set CreateInstanceSingleton 2 13 UPDATED: Array CreateInstanceSingleton 5 10 UPDATED: SetMethod: inherited 1 4 UPDATED: REXML::XMLDecl CreateInstanceSingleton 1 3 UPDATED: SetMethod: inherited 1 2 UPDATED: RemoveMethodNoEvent 1 1 UPDATED: SetMethod: inherited 1 1 UPDATED: SetMethod: included 1 1 UPDATED: SetMethod: new 1 1 Further optimizations might include special caching policy for require, append_features, inherited, method_added and other Ruby "notifications". 8) Fixes various bugs related to the features implemented/improved and adds bunch of unit tests. Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OI7.diff Type: application/octet-stream Size: 170462 bytes Desc: OI7.diff URL: From jdeville at microsoft.com Thu Feb 5 20:36:39 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 5 Feb 2009 17:36:39 -0800 Subject: [Ironruby-core] Git Pushed Message-ID: Enjoy! JD -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Fri Feb 6 02:40:54 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 5 Feb 2009 23:40:54 -0800 Subject: [Ironruby-core] Code Review: re Message-ID: <710DF26F214D2B4BB94287123FFE980A2DD9EE5E94@NA-EXMSG-C104.redmond.corp.microsoft.com> tfpt review "/shelveset:re;REDMOND\sborde" Comment : Adds tests in library\regexp\match_specs.rb and language\regexp_specs.rb Fixes the issues found by it. \c support had a typo had checked for \C instead. Added support for predefined character classes like [:alpha:]. I created a new class called RegexpTransformer for this to convert from Ruby regexp to CLR regexp pattern. Its state-driven and so can be extended if we need to do more complex analysis if needed. There are a few cases where we might need to do this in the future, and also if we want to give better error messages for bad regexps. Added Debug-only command line option called -compileRegexps to check perf impact of compiling Regexps to IL. It gives a 50%-300% improvement in throughput. Have not measured startup impact. The command line option will let us play with it easily. Added -ruby19 command line option to RunRSpec There are few more known issues with regexps that I will get to next. -------------- next part -------------- A non-text attachment was scrubbed... Name: re.diff Type: application/octet-stream Size: 27662 bytes Desc: re.diff URL: From charles.nutter at sun.com Fri Feb 6 03:31:39 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 06 Feb 2009 02:31:39 -0600 Subject: [Ironruby-core] videos over IronRuby In-Reply-To: References: <49897A33.4010707@sun.com> <498A0A07.8030109@sun.com> Message-ID: <498BF56B.6020400@sun.com> Mike Moore wrote: > Does a video of your RubyConf 2005 session exist?!? I can find audio and > slides, but the only video I've found is from Sunday. I'd *love* to have > video of your session. > > http://brainspl.at/articles/2005/12/01/rubyconf-files-resurrected Ahh, I guess I've never looked either. I'd like to have a video of that talk, since it was technically my first ever. I was super nervous; practiced it twice the night before. Too bad that there might not be any videos of it...lost to the ages I guess. > RubyConf 2005 had a huge impact on me and I'd love to relive it. I had > one of the few Windows laptops there and I remember installing Litestep > during your talk. I used to run it back in the day and I had no idea you > were the PM for it before you mentioned it in your session. Ahh memories... Small world :) Litestep was probably the last C/C++ work I did in earnest, and although we were able to *really* clean the codebase up, the whole desktop-skinning thing faded away shortly after that. Maybe in another ten years I'll be doing some other big OSS project. I'd like to think I'll be done with JRuby at some point... - Charlie From jdeville at microsoft.com Fri Feb 6 15:56:50 2009 From: jdeville at microsoft.com (Jim Deville) Date: Fri, 6 Feb 2009 12:56:50 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2DD9EE5E94@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2DD9EE5E94@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: RegexpSpecs.syntax_error, and the similar test in language/regexp_specs.rb is testing the parser, not regexps. For the others, you are obscuring the code too much. Methods in the fixture files shouldn't hide the behavior, methods in the fixture files should be a convenient way to get at data. it "returns nil if the object is nil" do /\w+/.send(@method, nil).should == nil end it 'supports escape characters' do RegexpSpecs.match(@method, /\t/, "\t", ["\t"]) # horizontal tab #... End I know what the first one is doing, and if I want to see how Regexp#match, or the other shared methods, behave I can see that easily. RegexpSpecs.match is obscuring a lot of the behavior in the fixture files. In addition, since :=~ and :match have slightly different behaviors, they shouldn't be using a shared spec. One way to reduce the code in a case like this is to use fixtures to define character classes (like RegexpSpecs.blanks), then you could do loops in each spec file to spec the behaviors in one line. So the it 'supports escape characters' do line becomes: In classes.rb: #.... def self.escape_characters %w{\t \v \n \r \f \a \e} end In match_spec.rb under describe "Regexp#match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| char.send(@method, /#{char}/).to_a.should == [char] end end In match_spec.rb under describe "Regexp#=~ on a successful match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| (/#{char}/ =~ char).should == 0 end end Similar simplifications can be done for the others. The idea is that each spec tests a facet of behavior of a method. If you are trying to combine two facets (via case statements in this case), then you really have two specs. You can see my discussion with Brian Ford and Evan Phoenix about this here: http://logs.jruby.org/rubyspec/2009-02-06.html. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday, February 05, 2009 11:41 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Adds tests in library\regexp\match_specs.rb and language\regexp_specs.rb Fixes the issues found by it. \c support had a typo had checked for \C instead. Added support for predefined character classes like [:alpha:]. I created a new class called RegexpTransformer for this to convert from Ruby regexp to CLR regexp pattern. Its state-driven and so can be extended if we need to do more complex analysis if needed. There are a few cases where we might need to do this in the future, and also if we want to give better error messages for bad regexps. Added Debug-only command line option called -compileRegexps to check perf impact of compiling Regexps to IL. It gives a 50%-300% improvement in throughput. Have not measured startup impact. The command line option will let us play with it easily. Added -ruby19 command line option to RunRSpec There are few more known issues with regexps that I will get to next. From Tomas.Matousek at microsoft.com Fri Feb 6 16:06:33 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 6 Feb 2009 13:06:33 -0800 Subject: [Ironruby-core] Code Review: ThreadSafetyFix Message-ID: tfpt review "/shelveset:ThreadSafetyFix;REDMOND\tomat" Removes thread-unsafe assertion. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: ThreadSafetyFix.diff Type: application/octet-stream Size: 2860 bytes Desc: ThreadSafetyFix.diff URL: From Tomas.Matousek at microsoft.com Fri Feb 6 21:12:44 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 6 Feb 2009 18:12:44 -0800 Subject: [Ironruby-core] Code Review: StackTraces1 Message-ID: tfpt review "/shelveset:StackTraces1;REDMOND\tomat" Removes dependency on _stub_ special method name in Ruby stack traces. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: StackTraces1.diff Type: application/octet-stream Size: 16534 bytes Desc: StackTraces1.diff URL: From Jimmy.Schementi at microsoft.com Fri Feb 6 21:23:12 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 6 Feb 2009 18:23:12 -0800 Subject: [Ironruby-core] automating VS In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6B0D3BC@NA-EXMSG-C116.redmond.corp.microsoft.com> Na, that was definitely VS 2008. We just had our VS ninja Oleg write a VS extension that hosts the DLR, so Ruby code could control VS. But beats me if I know where that VS extension is. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Thursday, February 05, 2009 11:12 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] automating VS Ivan, The RubyConf2008 talk? It's on confreaks:http://rubyconf2008.confreaks.com/ironruby.html I'm pretty sure it's using the new managed API for VS2010.. EnvDTE is painfull... On Thu, Feb 5, 2009 at 1:30 PM, Ivan Porto Carrero > wrote: Hi A while ago I remeber seeing a screencast where John Lam shows how to use ironruby to automate visual studio. I can't find the screencast anymore but I would be interested to know which API was used. Was that just using EnvDTE ? I'm asking because at work we are using GAT to automate visual studio and to create a kind of software factory (without the visual designers) When it comes to developing with GAT I think most of us will agree that there are more pleasant ways to develop and debug your work. So I may get the chance to get them to use IronRuby for some of that stuff as long as we can hide from the use case/LOB developers. Using GAT for us is a hazard to make our sprints. Most of our story points for example go into GAT development and debugging, granted that we do make it do some crazy stuff too. Thanks _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From olegtk at microsoft.com Sat Feb 7 01:28:15 2009 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Fri, 6 Feb 2009 22:28:15 -0800 Subject: [Ironruby-core] automating VS In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6B0D3BC@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6B0D3BC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Yes, that was VS 2008. Unfortunately the demo contained some unreleased features so I couldn't publish the code. But the idea was simple - an addin-manager (C#) that hosts DLR and allows ruby scripts to create and handle menu commands: require 'rubyaddin' class TestRunnerAddin < RubyAddin set_command_label "Run Test" set_command_tooltip "Run selected test" set_command_menu "Code Window" def self.execute() ctx = get_vs_context() file = ctx.ActiveDocument ... end end But then to make something useful you still need to cope with EnvDTE (which was provided as part of context). -- Oleg From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Friday, February 06, 2009 6:23 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] automating VS Na, that was definitely VS 2008. We just had our VS ninja Oleg write a VS extension that hosts the DLR, so Ruby code could control VS. But beats me if I know where that VS extension is. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Thursday, February 05, 2009 11:12 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] automating VS Ivan, The RubyConf2008 talk? It's on confreaks:http://rubyconf2008.confreaks.com/ironruby.html I'm pretty sure it's using the new managed API for VS2010.. EnvDTE is painfull... On Thu, Feb 5, 2009 at 1:30 PM, Ivan Porto Carrero > wrote: Hi A while ago I remeber seeing a screencast where John Lam shows how to use ironruby to automate visual studio. I can't find the screencast anymore but I would be interested to know which API was used. Was that just using EnvDTE ? I'm asking because at work we are using GAT to automate visual studio and to create a kind of software factory (without the visual designers) When it comes to developing with GAT I think most of us will agree that there are more pleasant ways to develop and debug your work. So I may get the chance to get them to use IronRuby for some of that stuff as long as we can hide from the use case/LOB developers. Using GAT for us is a hazard to make our sprints. Most of our story points for example go into GAT development and debugging, granted that we do make it do some crazy stuff too. Thanks _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Sat Feb 7 08:06:52 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Sat, 7 Feb 2009 08:06:52 -0500 Subject: [Ironruby-core] automating VS In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE6B0D3BC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: I'm pretty sure there's a demo out there somewhere with John using 2010 and interacting with the new xaml code editor... On Sat, Feb 7, 2009 at 1:28 AM, Oleg Tkachenko wrote: > Yes, that was VS 2008. Unfortunately the demo contained some unreleased > features so I couldn't publish the code. But the idea was simple ? an > addin-manager (C#) that hosts DLR and allows ruby scripts to create and > handle menu commands: > > > > require 'rubyaddin' > > > > class TestRunnerAddin < RubyAddin > > set_command_label "Run Test" > > set_command_tooltip "Run selected test" > > set_command_menu "Code Window" > > > > def self.execute() > > ctx = get_vs_context() > > file = ctx.ActiveDocument > > ? > > end > > end > > > > But then to make something useful you still need to cope with EnvDTE (which > was provided as part of context). > > > > -- > > Oleg > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* Friday, February 06, 2009 6:23 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] automating VS > > > > Na, that was definitely VS 2008. We just had our VS ninja Oleg write a VS > extension that hosts the DLR, so Ruby code could control VS. But beats me if > I know where that VS extension is. > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Michael Letterle > *Sent:* Thursday, February 05, 2009 11:12 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] automating VS > > > > Ivan, > > The RubyConf2008 talk? It's on confreaks: > http://rubyconf2008.confreaks.com/ironruby.html > > I'm pretty sure it's using the new managed API for VS2010.. EnvDTE is > painfull... > > On Thu, Feb 5, 2009 at 1:30 PM, Ivan Porto Carrero > wrote: > > Hi > > A while ago I remeber seeing a screencast where John Lam shows how to use > ironruby to automate visual studio. > I can't find the screencast anymore but I would be interested to know which > API was used. Was that just using EnvDTE ? > > I'm asking because at work we are using GAT to automate visual studio and > to create a kind of software factory (without the visual designers) > When it comes to developing with GAT I think most of us will agree that > there are more pleasant ways to develop and debug your work. > > So I may get the chance to get them to use IronRuby for some of that stuff > as long as we can hide from the use case/LOB developers. > Using GAT for us is a hazard to make our sprints. Most of our story points > for example go into GAT development and debugging, granted that we do make > it do some crazy stuff too. > > Thanks > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sat Feb 7 12:02:35 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sat, 7 Feb 2009 18:02:35 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries Message-ID: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> Good morning, I would try to test my .net code using a BDD approach. I believe Ruby has a clean syntax and great libraries to do BDD so I would use one them on IronRuby. Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sat Feb 7 12:14:52 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sat, 7 Feb 2009 18:14:52 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> Message-ID: http://msdn.microsoft.com/en-us/magazine/dd434651.aspx --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Sat, Feb 7, 2009 at 6:02 PM, Claudio Maccari wrote: > Good morning, > > > > I would try to test my .net code using a BDD approach. > > I believe Ruby has a clean syntax and great libraries to do BDD so I would > use one them on IronRuby. > > Has someone already try to test .net code with ruby DBB library? > > If the answer is yes, is there somewhere a sample/post/article of this > work? > > > > Many thanks in advance > > Claudio > > > > > > Claudio Maccari > > http://testdrivendevelopment.wordpress.com/ > > > > "I have the simplest taste. I am always satisfied with the best"- Oscar > Wilde > > > > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Sat Feb 7 13:10:54 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 7 Feb 2009 19:10:54 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> Message-ID: <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> Hi, > Has someone already try to test .net code with ruby DBB library? > > If the answer is yes, is there somewhere a sample/post/article of this > work? > > Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut > > > Many thanks in advance > > Claudio > > > > > > Claudio Maccari > > http://testdrivendevelopment.wordpress.com/ > > > > "I have the simplest taste. I am always satisfied with the best"- Oscar > Wilde > > > > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sat Feb 7 14:35:15 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sat, 7 Feb 2009 20:35:15 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> Message-ID: <498de273.23145e0a.58dc.ffffb06b@mx.google.com> It?s exactly what I?m looking for Thanks Claudio ps. Thanks again for coming at ALT.NET conf! From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: sabato 7 febbraio 2009 18.15 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries http://msdn.microsoft.com/en-us/magazine/dd434651.aspx --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Sat, Feb 7, 2009 at 6:02 PM, Claudio Maccari wrote: Good morning, I would try to test my .net code using a BDD approach. I believe Ruby has a clean syntax and great libraries to do BDD so I would use one them on IronRuby. Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From curtismitchell at gmail.com Sat Feb 7 15:07:53 2009 From: curtismitchell at gmail.com (Curtis Mitchell) Date: Sat, 7 Feb 2009 20:07:53 +0000 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> Message-ID: <1028292792-1234037202-cardhu_decombobulator_blackberry.rim.net-1814838310-@bxe323.bisx.prod.on.blackberry> I posted a way of testing .net code with ruby a few months back. It incorporates autotest also. http://www.curtismitchell.com/2b/?p=15 Sent from my mobile -----Original Message----- From: Ivan Porto Carrero Date: Sat, 7 Feb 2009 18:14:52 To: Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Jimmy.Schementi at microsoft.com Sat Feb 7 15:14:09 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 7 Feb 2009 12:14:09 -0800 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com>, <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js ________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sat Feb 7 18:33:54 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 00:33:54 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# Message-ID: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Any help would be much appreciated. Thanks, -- Henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Sat Feb 7 19:20:48 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sun, 8 Feb 2009 01:20:48 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Message-ID: <4a68b8cf0902071620s6ab94899y167f0d8006c781d9@mail.gmail.com> > > Hi there, > > I am trying to initialize an iron ruby engine for execution of code > snipptes from a c# application. extensive googling has not helped me with > the task because there seem to have been much changes in iron ruby lately. > Here is my code: > > var runtime = Ruby.CreateRuntime(); > var engine = m_runtime.GetEngine("IronRuby"); // <--- > InvalidImplementationException is thrown here > not sure if it will solve your issue, but here's what I'm using (worked a few days ago - code snippet sent by Tomas Matousek): var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); hth, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sat Feb 7 20:38:41 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sat, 7 Feb 2009 17:38:41 -0800 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Message-ID: The release on DLR CodePlex is broken. We are working on a fix. The problem is in signed assemblies. Removing ir.exe.config (located next to ir.exe) might help. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Saturday, February 07, 2009 3:34 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] how to initialize iron ruby from c# Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Any help would be much appreciated. Thanks, -- Henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Sat Feb 7 21:10:30 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Sat, 7 Feb 2009 18:10:30 -0800 Subject: [Ironruby-core] Code Review: StackTraces1 In-Reply-To: References: Message-ID: Looks good. -----Original Message----- From: Tomas Matousek Sent: Friday, February 06, 2009 6:13 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: StackTraces1 tfpt review "/shelveset:StackTraces1;REDMOND\tomat" Removes dependency on _stub_ special method name in Ruby stack traces. Tomas From jdeville at microsoft.com Sun Feb 8 02:36:41 2009 From: jdeville at microsoft.com (Jim Deville) Date: Sat, 7 Feb 2009 23:36:41 -0800 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Message-ID: You actually don't need to remove it if you want to use it for $LOAD_PATH support. Just change the private keys to null, instead of the 31...... number. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Saturday, February 07, 2009 5:39 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# The release on DLR CodePlex is broken. We are working on a fix. The problem is in signed assemblies. Removing ir.exe.config (located next to ir.exe) might help. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Saturday, February 07, 2009 3:34 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] how to initialize iron ruby from c# Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Any help would be much appreciated. Thanks, -- Henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 05:29:02 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 11:29:02 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# Message-ID: <43d756720902080229r338d7224k202640e9aebe4f67@mail.gmail.com> > Date: Sun, 8 Feb 2009 01:20:48 +0100 > From: Thibaut Barr?re > Subject: Re: [Ironruby-core] how to initialize iron ruby from c# > To: ironruby-core at rubyforge.org > Message-ID: > <4a68b8cf0902071620s6ab94899y167f0d8006c781d9 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > > > > Hi there, > > > > I am trying to initialize an iron ruby engine for execution of code > > snipptes from a c# application. extensive googling has not helped me with > > the task because there seem to have been much changes in iron ruby lately. > > Here is my code: > > > > var runtime = Ruby.CreateRuntime(); > > var engine = m_runtime.GetEngine("IronRuby"); // <--- > > InvalidImplementationException is thrown here > > > > not sure if it will solve your issue, but here's what I'm using (worked a > few days ago - code snippet sent by Tomas Matousek): > > var engine = IronRuby.Ruby.CreateEngine(); > engine.Execute(code); > > hth, > > -- Thibaut Thanks Thibaut, I tried that, and get the same error. Maybe I should try out older binaries. Apart from that, I want to make sure, that my approach to embedding IronRuby in a .NET app is right (didn't find any tutorials on embedding): 1) Add references to IronRuby.dll, IronRuby.Libraries.dll, Microsoft.Scripting.dll and Microsoft.Scripting.Core.dll 2) Create a engine like this var engine = IronRuby.Ruby.CreateEngine(); and then executie ruby code on the engine itself with Execute, or compile code into a ScriptSource and execute that. Are there any steps missing? ir.exe has a config file. I don't need one to get iron ruby basically running, do I? The standard library is embedded in IronRuby.Libraries.dll, so I don't need to set a load path, right? I would be willing to write a tutorial on embedding once I got everything together and working. Thanks for clarification, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sun Feb 8 05:56:27 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sun, 8 Feb 2009 11:56:27 +0100 Subject: [Ironruby-core] Suggestion for ir.exe.config Message-ID: <498eba5a.0c11660a.69ac.41b5@mx.google.com> Don't you think ir.exe.config would be much readable with this syntax ..\..\Languages\Ruby\libs\ ..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\

..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\ ..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\
instead of this ? Create a Custom Configuration Sections Using ConfigurationSection is quite easy http://msdn.microsoft.com/en-us/library/2tw134k3.aspx cheers claudio -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sun Feb 8 06:18:49 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sun, 8 Feb 2009 12:18:49 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Message-ID: <498ebf9a.0ab6660a.4841.335b@mx.google.com> I have just downloaded DLR.10476.release.zip from http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr I edit my ir.exe.config as follow. Now ir.exe doesn't crash.
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: domenica 8 febbraio 2009 8.37 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# You actually don't need to remove it if you want to use it for $LOAD_PATH support. Just change the private keys to null, instead of the 31.. number. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Saturday, February 07, 2009 5:39 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# The release on DLR CodePlex is broken. We are working on a fix. The problem is in signed assemblies. Removing ir.exe.config (located next to ir.exe) might help. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Saturday, February 07, 2009 3:34 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] how to initialize iron ruby from c# Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Any help would be much appreciated. Thanks, -- Henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 06:38:09 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 12:38:09 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> Message-ID: <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis wrote: > Hi there, > > I am trying to initialize an iron ruby engine for execution of code > snipptes from a c# application. extensive googling has not helped me with > the task because there seem to have been much changes in iron ruby lately. > Here is my code: > > var runtime = Ruby.CreateRuntime(); > var engine = m_runtime.GetEngine("IronRuby"); // <--- > InvalidImplementationException is thrown here > > This is the inner exception. > > {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system > cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, > Culture=neutral, PublicKeyToken=null"} > > This happens with the latest nightly build of DLR binaries. I did make sure > that IronRuby.Libraries.dll is added in the References of the project but it > still can't be loaded. Did I miss something obvious? > Hi, I found the cause of the error: IronRuby.Libraries.dll does not get copied to the bin/debug location on build like the other dependencies (i.e. IronRuby.dll, etc. ) despite the fact that they are all correctly listed as references of the project. When I copy it manually everything works fine. Any idea, why it is not copied automatically? Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Sun Feb 8 07:28:40 2009 From: thibaut.barrere at gmail.com (thibaut.barrere at gmail.com) Date: Sun, 8 Feb 2009 13:28:40 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> Message-ID: "Copy local" may be set to false ? -- Thibaut Le 8 f?vr. 09 ? 12:38, Meinrad Recheis a ?crit : > On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis > wrote: > Hi there, > > I am trying to initialize an iron ruby engine for execution of code > snipptes from a c# application. extensive googling has not helped me > with the task because there seem to have been much changes in iron > ruby lately. > > Here is my code: > > var runtime = Ruby.CreateRuntime(); > var engine = m_runtime.GetEngine("IronRuby"); // <--- > InvalidImplementationException is thrown here > > This is the inner exception. > > {"Could not load file or assembly 'IronRuby.Libraries, > Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its > dependencies. The system cannot find the file > specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, > PublicKeyToken=null"} > > This happens with the latest nightly build of DLR binaries. I did > make sure that IronRuby.Libraries.dll is added in the References of > the project but it still can't be loaded. Did I miss something > obvious? > > Hi, I found the cause of the error: IronRuby.Libraries.dll does not > get copied to the bin/debug location on build like the other > dependencies (i.e. IronRuby.dll, etc. ) despite the fact that they > are all correctly listed as references of the project. When I copy > it manually everything works fine. Any idea, why it is not copied > automatically? > Cheers, > -- henon > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 10:05:17 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 16:05:17 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> Message-ID: <43d756720902080705vc48c3bdp2ff576f96a3b8b57@mail.gmail.com> Copy Local is true. That is what confuses me. On Sun, Feb 8, 2009 at 1:28 PM, wrote: > "Copy local" may be set to false ? > > -- Thibaut > > Le 8 f?vr. 09 ? 12:38, Meinrad Recheis a > ?crit : > > On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis < > meinrad.recheis at gmail.com> wrote: > >> Hi there, >> >> I am trying to initialize an iron ruby engine for execution of code >> snipptes from a c# application. extensive googling has not helped me with >> the task because there seem to have been much changes in iron ruby lately. >> Here is my code: >> >> var runtime = Ruby.CreateRuntime(); >> var engine = m_runtime.GetEngine("IronRuby"); // <--- >> InvalidImplementationException is thrown here >> >> This is the inner exception. >> >> {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, >> Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system >> cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, >> Culture=neutral, PublicKeyToken=null"} >> >> This happens with the latest nightly build of DLR binaries. I did make >> sure that IronRuby.Libraries.dll is added in the References of the project >> but it still can't be loaded. Did I miss something obvious? >> > > Hi, I found the cause of the error: IronRuby.Libraries.dll does not get > copied to the bin/debug location on build like the other dependencies (i.e. > IronRuby.dll, etc. ) despite the fact that they are all correctly listed as > references of the project. When I copy it manually everything works fine. > Any idea, why it is not copied automatically? > Cheers, > -- henon > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Sun Feb 8 10:30:52 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Sun, 8 Feb 2009 07:30:52 -0800 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> Message-ID: Did you add a reference to IronRuby.Libraries.dll to your C# application? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:38 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis > wrote: Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Hi, I found the cause of the error: IronRuby.Libraries.dll does not get copied to the bin/debug location on build like the other dependencies (i.e. IronRuby.dll, etc. ) despite the fact that they are all correctly listed as references of the project. When I copy it manually everything works fine. Any idea, why it is not copied automatically? Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sun Feb 8 12:13:10 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sun, 8 Feb 2009 18:13:10 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: <43d756720902080705vc48c3bdp2ff576f96a3b8b57@mail.gmail.com> References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> <43d756720902080705vc48c3bdp2ff576f96a3b8b57@mail.gmail.com> Message-ID: <498f12a8.08b6660a.6d0d.ffff83a0@mx.google.com> Uhmmm. I think you made so mistakes in your project. I created this very simple Console Application from scratch class Program { static void Main(string[] args) { var engine = IronRuby.Ruby.CreateEngine(); engine.Execute("puts 'hello world'"); Console.Read(); } } In order to compile it I need to add this libraries (just taken form http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr) IronRuby IronRuby.Libraries Microsoft.Scripting if I press F5 it works like a charm. In my bin\debug folder I have 08/02/2009 18.07 4.608 ACSharpHostingConsole.exe 08/02/2009 18.07 11.776 ACSharpHostingConsole.pdb 08/02/2009 18.08 14.328 ACSharpHostingConsole.vshost.exe 02/02/2009 14.53 688.128 IronRuby.dll 02/02/2009 14.53 548.864 IronRuby.Libraries.dll 02/02/2009 14.52 368.640 Microsoft.Scripting.Core.dll 02/02/2009 14.53 958.464 Microsoft.Scripting.dll 02/02/2009 14.52 5.120 Microsoft.Scripting.ExtensionAttribute.dll HTH claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: domenica 8 febbraio 2009 16.05 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# Copy Local is true. That is what confuses me. On Sun, Feb 8, 2009 at 1:28 PM, wrote: "Copy local" may be set to false ? -- Thibaut Le 8 f?vr. 09 ? 12:38, Meinrad Recheis a ?crit : On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis wrote: Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Hi, I found the cause of the error: IronRuby.Libraries.dll does not get copied to the bin/debug location on build like the other dependencies (i.e. IronRuby.dll, etc. ) despite the fact that they are all correctly listed as references of the project. When I copy it manually everything works fine. Any idea, why it is not copied automatically? Cheers, -- henon _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Sun Feb 8 12:22:47 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Sun, 8 Feb 2009 18:22:47 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com>, <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <498f14e7.02a1660a.7927.6867@mx.google.com> Hi Jimmy, I would try bacon cause it looks simple but I can?t get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow But I get this error C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) from :0 >>> What's wrong ? Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverli ght.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js _____ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sun Feb 8 12:49:57 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 8 Feb 2009 18:49:57 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <498f14e7.02a1660a.7927.6867@mx.google.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> Message-ID: Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari wrote: > Hi Jimmy, > > > > I would try bacon cause it looks simple but I can't get it working. > > I installed bacon using gem and now is located in > C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 > > I edited my ir.exe.config file as follow > > > > > > value="c:\ruby\lib\ruby\site_ruby\1.8\;c:\ruby\lib\ruby\site_ruby\;c:\ruby\lib\ruby\1.8\;c:\ruby\lib\ruby\gems\1.8\gems\" > /> > > > > > > But I get this error > > > > C:\Projects\IronRuby>ir.exe > > IronRuby 1.0.0.0 on .NET 2.0.50727.3053 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'bacon' > > IronRuby.Libraries:0:in `require': no such file to load -- bacon > (LoadError) > > from :0 > > > > >>> > > > > What's wrong ? > > Thanks > > Claudio > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* sabato 7 febbraio 2009 21.14 > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > I've using bacon (http://github.com/chneukirchen/bacon) to test C# > Silverlight code, and it works great on the desktop as well. It's definitely > the smallest of the bdd libraries, and feels fastest, but I've got no data > to support that (yet). > > > > > http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html > > > > However, don't expect any mocking libraries to work. You can't mock C# > types, and have those changes be visible to other C# code. We need to write > a ruby wrapper around existing C# mocking libraries, so let me know if > anyone is interested in doing so. > > > > ~js > > > ------------------------------ > > *From:* ironruby-core-bounces at rubyforge.org [ > ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [ > thibaut.barrere at gmail.com] > *Sent:* Saturday, February 07, 2009 10:10 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > Hi, > > Has someone already try to test .net code with ruby DBB library? > > If the answer is yes, is there somewhere a sample/post/article of this > work? > > Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) > and Test::Unit (can be BDD too) did the trick. > > > > Check out this for a few hints and thoughts: > http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing > > > > cheers, > > > > -- Thibaut > > > > Many thanks in advance > > Claudio > > > > > > Claudio Maccari > > http://testdrivendevelopment.wordpress.com/ > > > > "I have the simplest taste. I am always satisfied with the best"- Oscar > Wilde > > > > > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 8 13:01:32 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 10:01:32 -0800 Subject: [Ironruby-core] Suggestion for ir.exe.config In-Reply-To: <498eba5a.0c11660a.69ac.41b5@mx.google.com> References: <498eba5a.0c11660a.69ac.41b5@mx.google.com> Message-ID: Thanks for suggestion, this should be doable even w/o Ruby specific config section. BTW, you application can actually use any configuration format you want. You don't need to rely on the default configuration reader when a hosting DLR language (IronRuby). Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Claudio Maccari Sent: Sunday, February 08, 2009 2:56 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Suggestion for ir.exe.config Don't you think ir.exe.config would be much readable with this syntax ..\..\Languages\Ruby\libs\ ..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\ ..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\ ..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\ instead of this ? Create a Custom Configuration Sections Using ConfigurationSection is quite easy http://msdn.microsoft.com/en-us/library/2tw134k3.aspx cheers claudio -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 13:54:47 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 19:54:47 +0100 Subject: [Ironruby-core] cannot initialize Form with IronRuby Message-ID: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> IronRuby 1.0.0.0 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyTo ken=b77a5c561934e089" => true >>> Form = System::Windows::Forms::Form => System::Windows::Forms::Form >>> f=Form.new => # >>> f.Show() :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.method( :Show).arity => 0 >>> This is the latest daily DLR build on codeplex from 2009 Feb 1 at 9:36 PM. I read, that with older versions winforms interop has already been working. -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 14:19:55 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Sun, 8 Feb 2009 20:19:55 +0100 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> Message-ID: <43d756720902081119o26e79686vdb309bef4ce81e69@mail.gmail.com> On Sun, Feb 8, 2009 at 4:30 PM, Curt Hagenlocher wrote: > Did you add a reference to IronRuby.Libraries.dll to your C# application? > Now I think I know what was the problem: I had added a reference to IronRuby.Libraries.dll do a dll project of my own and from there it did not get copied while at the same time IronRuby.dll which was referenced by my dll only too did get copied. Still don't know why VS did copy only some of the references. Anyway, after adding it to the startup application too it worked fine. Thanks, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Sun Feb 8 14:23:59 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Sun, 8 Feb 2009 11:23:59 -0800 Subject: [Ironruby-core] how to initialize iron ruby from c# In-Reply-To: References: <43d756720902071533w4bf809a9hd2194b4eaea79038@mail.gmail.com> <43d756720902080338v674ab339mdec8d9a7b08c9574@mail.gmail.com> Message-ID: Wow, this list is laggy -- I posted this almost 4 hours ago! Sorry, I obviously didn't read your last paragraph. :( From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Curt Hagenlocher Sent: Sunday, February 08, 2009 7:31 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# Did you add a reference to IronRuby.Libraries.dll to your C# application? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:38 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] how to initialize iron ruby from c# On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis > wrote: Hi there, I am trying to initialize an iron ruby engine for execution of code snipptes from a c# application. extensive googling has not helped me with the task because there seem to have been much changes in iron ruby lately. Here is my code: var runtime = Ruby.CreateRuntime(); var engine = m_runtime.GetEngine("IronRuby"); // <--- InvalidImplementationException is thrown here This is the inner exception. {"Could not load file or assembly 'IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} This happens with the latest nightly build of DLR binaries. I did make sure that IronRuby.Libraries.dll is added in the References of the project but it still can't be loaded. Did I miss something obvious? Hi, I found the cause of the error: IronRuby.Libraries.dll does not get copied to the bin/debug location on build like the other dependencies (i.e. IronRuby.dll, etc. ) despite the fact that they are all correctly listed as references of the project. When I copy it manually everything works fine. Any idea, why it is not copied automatically? Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From will at hotgazpacho.org Sun Feb 8 15:22:59 2009 From: will at hotgazpacho.org (Will Green) Date: Sun, 8 Feb 2009 15:22:59 -0500 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby Message-ID: First, I want to say that I'm very excited by the progress of IronRuby. So, my interrest lies in getting Ruby web applications running through IIS 7. Specifically Rails, but also others like Sinatra and Merb, all of which are now built on Rack. Rack implements a new web-to- application protocol, based partly on Python's WSGI, which supplants FastCGI. I've looked, and someone has already created nWSGI on CodePlex. This project implements WSGI, and hosts IronPython to run the Python app. I'm thinking of taking a similar approach, but one of the key requirements of the Rack protocol is that the Rack application's call method takes exactly one param: a Ruby Hash; it cannot be a subclass. Reading the status at IronRuby.net, it looks like Hash is not yet implemented. Is this the case? I guess I'm looking to see if my project is something that can be done at this time, or if IronRuby needs some more help before I can attempt it. I'd be happy to contribute time & code to get this working. Thanks! Will Green From Tomas.Matousek at microsoft.com Sun Feb 8 15:58:01 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 12:58:01 -0800 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> Message-ID: Works on the bits I have. Could you try following? f.method(:Show).clr_members.each { |m| puts m.to_string } It should print Void Show() Void Show(System.Windows.Forms.IWin32Window) Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 10:55 AM To: ironruby-core Subject: [Ironruby-core] cannot initialize Form with IronRuby IronRuby 1.0.0.0 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" => true >>> Form = System::Windows::Forms::Form => System::Windows::Forms::Form >>> f=Form.new => # >>> f.Show() :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.method( :Show).arity => 0 >>> This is the latest daily DLR build on codeplex from 2009 Feb 1 at 9:36 PM. I read, that with older versions winforms interop has already been working. -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 8 16:05:46 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 13:05:46 -0800 Subject: [Ironruby-core] Code Review: ErrorMessageFix Message-ID: tfpt review "/shelveset:ErrorMessageFix;REDMOND\tomat" Fixes binder error message given when an interface name is displayed. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: ErrorMessageFix.diff Type: application/octet-stream Size: 1890 bytes Desc: ErrorMessageFix.diff URL: From michael.letterle at gmail.com Sun Feb 8 16:17:02 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Sun, 8 Feb 2009 16:17:02 -0500 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> Message-ID: try f.show_dialog On Sun, Feb 8, 2009 at 1:54 PM, Meinrad Recheis wrote: > IronRuby 1.0.0.0 on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, > PublicKeyTo > ken=b77a5c561934e089" > => true > >>> Form = System::Windows::Forms::Form > => System::Windows::Forms::Form > >>> f=Form.new > => # > >>> f.Show() > :0: wrong number of arguments (2 for 3) (ArgumentError) > > >>> f.method( :Show).arity > => 0 > >>> > > This is the latest daily DLR build on codeplex from 2009 Feb 1 at > 9:36 PM. I read, that with older versions winforms interop has already been > working. > > > -- henon > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sun Feb 8 16:29:20 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 8 Feb 2009 22:29:20 +0100 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> Message-ID: I just compiled the ironruby version from github with rake and for me the following code works. require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Form = System::Windows::Forms::Form f = Form.new f.show On Sun, Feb 8, 2009 at 7:54 PM, Meinrad Recheis wrote: > IronRuby 1.0.0.0 on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, > PublicKeyTo > ken=b77a5c561934e089" > => true > >>> Form = System::Windows::Forms::Form > => System::Windows::Forms::Form > >>> f=Form.new > => # > >>> f.Show() > :0: wrong number of arguments (2 for 3) (ArgumentError) > > >>> f.method( :Show).arity > => 0 > >>> > > This is the latest daily DLR build on codeplex from 2009 Feb 1 at > 9:36 PM. I read, that with older versions winforms interop has already been > working. > > > -- henon > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Sun Feb 8 17:22:48 2009 From: jdeville at microsoft.com (Jim Deville) Date: Sun, 8 Feb 2009 14:22:48 -0800 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: References: Message-ID: Hash is mostly implemented. Can you post a link to the page where it shows it as not done? I'll fix it. I don't know if any of the methods needed by Rack are missing. Jimmy, have you tried this scenario? In the mean time, if you started down this road, we'd be happy to have your contributions. If you haven't already, you'll need to get setup to contribute. The instructions are on the Github wiki at: http://wiki.github.com/ironruby/ironruby/contributing. Thanks, JD > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Will Green > Sent: Sunday, February 08, 2009 12:23 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby > > First, I want to say that I'm very excited by the progress of IronRuby. > > So, my interrest lies in getting Ruby web applications running through > IIS 7. Specifically Rails, but also others like Sinatra and Merb, all > of which are now built on Rack. Rack implements a new web-to- > application protocol, based partly on Python's WSGI, which supplants > FastCGI. > > I've looked, and someone has already created nWSGI on CodePlex. This > project implements WSGI, and hosts IronPython to run the Python app. > > I'm thinking of taking a similar approach, but one of the key > requirements of the Rack protocol is that the Rack application's call > method takes exactly one param: a Ruby Hash; it cannot be a subclass. > Reading the status at IronRuby.net, it looks like Hash is not yet > implemented. Is this the case? > > I guess I'm looking to see if my project is something that can be done > at this time, or if IronRuby needs some more help before I can attempt > it. I'd be happy to contribute time & code to get this working. > > Thanks! > > Will Green > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Shri.Borde at microsoft.com Sun Feb 8 17:24:54 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Sun, 8 Feb 2009 14:24:54 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: References: <710DF26F214D2B4BB94287123FFE980A2DD9EE5E94@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2DD9EE640A@NA-EXMSG-C104.redmond.corp.microsoft.com> Test review feedback has been incorporated. tfpt review "/shelveset:re2;REDMOND\sborde" I still need a code review... -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Friday, February 06, 2009 12:57 PM To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers Subject: Re: [Ironruby-core] Code Review: re RegexpSpecs.syntax_error, and the similar test in language/regexp_specs.rb is testing the parser, not regexps. For the others, you are obscuring the code too much. Methods in the fixture files shouldn't hide the behavior, methods in the fixture files should be a convenient way to get at data. it "returns nil if the object is nil" do /\w+/.send(@method, nil).should == nil end it 'supports escape characters' do RegexpSpecs.match(@method, /\t/, "\t", ["\t"]) # horizontal tab #... End I know what the first one is doing, and if I want to see how Regexp#match, or the other shared methods, behave I can see that easily. RegexpSpecs.match is obscuring a lot of the behavior in the fixture files. In addition, since :=~ and :match have slightly different behaviors, they shouldn't be using a shared spec. One way to reduce the code in a case like this is to use fixtures to define character classes (like RegexpSpecs.blanks), then you could do loops in each spec file to spec the behaviors in one line. So the it 'supports escape characters' do line becomes: In classes.rb: #.... def self.escape_characters %w{\t \v \n \r \f \a \e} end In match_spec.rb under describe "Regexp#match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| char.send(@method, /#{char}/).to_a.should == [char] end end In match_spec.rb under describe "Regexp#=~ on a successful match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| (/#{char}/ =~ char).should == 0 end end Similar simplifications can be done for the others. The idea is that each spec tests a facet of behavior of a method. If you are trying to combine two facets (via case statements in this case), then you really have two specs. You can see my discussion with Brian Ford and Evan Phoenix about this here: http://logs.jruby.org/rubyspec/2009-02-06.html. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday, February 05, 2009 11:41 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Adds tests in library\regexp\match_specs.rb and language\regexp_specs.rb Fixes the issues found by it. \c support had a typo had checked for \C instead. Added support for predefined character classes like [:alpha:]. I created a new class called RegexpTransformer for this to convert from Ruby regexp to CLR regexp pattern. Its state-driven and so can be extended if we need to do more complex analysis if needed. There are a few cases where we might need to do this in the future, and also if we want to give better error messages for bad regexps. Added Debug-only command line option called -compileRegexps to check perf impact of compiling Regexps to IL. It gives a 50%-300% improvement in throughput. Have not measured startup impact. The command line option will let us play with it easily. Added -ruby19 command line option to RunRSpec There are few more known issues with regexps that I will get to next. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- A non-text attachment was scrubbed... Name: re2.diff Type: application/octet-stream Size: 27381 bytes Desc: re2.diff URL: From meinrad.recheis at gmail.com Sun Feb 8 18:25:57 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 00:25:57 +0100 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> Message-ID: <43d756720902081525s47628c1bycb83fff042b6a160@mail.gmail.com> On yesterdays checkout from git message "syncing to head of tfs" I get: IronRuby 1.0.0.0 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyTo ken=b77a5c561934e089" => true >>> System::Windows::Forms::Form.new => # >>> f=System::Windows::Forms::Form.new => # >>> f.Show :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.show :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.show_dialog => # >>> f.method(:Show).clr_members.each { |m| puts m.to_string } Void Show(System.Windows.Forms.IWin32Window) => [#] >>> On recent git head it works like expected. I will continue testing with the most recent sources. Keep up the great work! Cheers, --henon On Sun, Feb 8, 2009 at 9:58 PM, Tomas Matousek wrote: > Works on the bits I have. Could you try following? > > > > f.method(:Show).clr_members.each { |m| puts m.to_string } > > > > It should print > > > > Void Show() > > Void Show(System.Windows.Forms.IWin32Window) > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Meinrad Recheis > *Sent:* Sunday, February 08, 2009 10:55 AM > *To:* ironruby-core > *Subject:* [Ironruby-core] cannot initialize Form with IronRuby > > > > IronRuby 1.0.0.0 on .NET 2.0.50727.1433 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089" > > => true > > >>> Form = System::Windows::Forms::Form > > => System::Windows::Forms::Form > > >>> f=Form.new > > => # > > >>> f.Show() > > :0: wrong number of arguments (2 for 3) (ArgumentError) > > > > >>> f.method( :Show).arity > > => 0 > > >>> > > > > This is the latest daily DLR build on codeplex from 2009 Feb 1 at > 9:36 PM. I read, that with older versions winforms interop has already been > working. > > > > > > -- henon > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From will at hotgazpacho.org Sun Feb 8 18:40:20 2009 From: will at hotgazpacho.org (Will Green) Date: Sun, 8 Feb 2009 18:40:20 -0500 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: References: Message-ID: <000001c98a46$9ae62e50$d0b28af0$@org> Woops, looks like it was on the GitHub wiki, and I may have ascribed more meaning to what is there: http://wiki.github.com/ironruby/ironruby/libraries I just had this idea this morning after attending a regional Ruby conference (acts_as_conference). I'll get right on getting set up. Thanks! == Will -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Sunday, February 08, 2009 5:23 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby Hash is mostly implemented. Can you post a link to the page where it shows it as not done? I'll fix it. I don't know if any of the methods needed by Rack are missing. Jimmy, have you tried this scenario? In the mean time, if you started down this road, we'd be happy to have your contributions. If you haven't already, you'll need to get setup to contribute. The instructions are on the Github wiki at: http://wiki.github.com/ironruby/ironruby/contributing. Thanks, JD > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Will Green > Sent: Sunday, February 08, 2009 12:23 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby > > First, I want to say that I'm very excited by the progress of IronRuby. > > So, my interrest lies in getting Ruby web applications running through > IIS 7. Specifically Rails, but also others like Sinatra and Merb, all > of which are now built on Rack. Rack implements a new web-to- > application protocol, based partly on Python's WSGI, which supplants > FastCGI. > > I've looked, and someone has already created nWSGI on CodePlex. This > project implements WSGI, and hosts IronPython to run the Python app. > > I'm thinking of taking a similar approach, but one of the key > requirements of the Rack protocol is that the Rack application's call > method takes exactly one param: a Ruby Hash; it cannot be a subclass. > Reading the status at IronRuby.net, it looks like Hash is not yet > implemented. Is this the case? > > I guess I'm looking to see if my project is something that can be done > at this time, or if IronRuby needs some more help before I can attempt > it. I'd be happy to contribute time & code to get this working. > > Thanks! > > Will Green > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From meinrad.recheis at gmail.com Sun Feb 8 18:45:38 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 00:45:38 +0100 Subject: [Ironruby-core] WPF: registering a routed event Message-ID: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> Hi all, I seem to step in every hole there is on my IronRuby test drive. Using the latest git head I am failing to register a button click event in WPF: >>> require "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' => true >>> b = System::Windows::Controls::Button.new => # >>> def on_click o, args ... puts "clicked!!" ... end => nil >>> b.add_Click( method(:on_click)) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) >>> h=System::Windows::RoutedEventHandler.new{|o, args| puts "clicked!!" } => # >>> h.Invoke(nil, nil) clicked!! => nil >>> b.add_Click(h) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) Actually I would have expected b.add_Click( method(:on_click)) or b.add_Click( lambda {|o, args| ... } ) to work, just like it does in IronPython: >>> clr.AddReference( 'WindowsBase') >>> clr.AddReference( 'PresentationCore') >>> clr.AddReference( 'PresentationFramework') >>> import System >>> from System import Windows >>> from System.Windows import Controls >>> from System.Windows.Controls import * >>> b= Button() >>> def on_click(o, args): ... print "clicked!!" ... >>> b.add_Click(on_click) >>> I hope, I am not starting to annoy you guys ;) -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 8 18:58:05 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 15:58:05 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2DD9EE640A@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2DD9EE5E94@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2DD9EE640A@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Looks good. Tomas -----Original Message----- From: Shri Borde Sent: Sunday, February 08, 2009 2:25 PM To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers Subject: RE: Code Review: re Test review feedback has been incorporated. tfpt review "/shelveset:re2;REDMOND\sborde" I still need a code review... -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Friday, February 06, 2009 12:57 PM To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers Subject: Re: [Ironruby-core] Code Review: re RegexpSpecs.syntax_error, and the similar test in language/regexp_specs.rb is testing the parser, not regexps. For the others, you are obscuring the code too much. Methods in the fixture files shouldn't hide the behavior, methods in the fixture files should be a convenient way to get at data. it "returns nil if the object is nil" do /\w+/.send(@method, nil).should == nil end it 'supports escape characters' do RegexpSpecs.match(@method, /\t/, "\t", ["\t"]) # horizontal tab #... End I know what the first one is doing, and if I want to see how Regexp#match, or the other shared methods, behave I can see that easily. RegexpSpecs.match is obscuring a lot of the behavior in the fixture files. In addition, since :=~ and :match have slightly different behaviors, they shouldn't be using a shared spec. One way to reduce the code in a case like this is to use fixtures to define character classes (like RegexpSpecs.blanks), then you could do loops in each spec file to spec the behaviors in one line. So the it 'supports escape characters' do line becomes: In classes.rb: #.... def self.escape_characters %w{\t \v \n \r \f \a \e} end In match_spec.rb under describe "Regexp#match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| char.send(@method, /#{char}/).to_a.should == [char] end end In match_spec.rb under describe "Regexp#=~ on a successful match": it "supports escape characters" do RegexpSpecs.escape_characters.each do |char| (/#{char}/ =~ char).should == 0 end end Similar simplifications can be done for the others. The idea is that each spec tests a facet of behavior of a method. If you are trying to combine two facets (via case statements in this case), then you really have two specs. You can see my discussion with Brian Ford and Evan Phoenix about this here: http://logs.jruby.org/rubyspec/2009-02-06.html. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday, February 05, 2009 11:41 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Adds tests in library\regexp\match_specs.rb and language\regexp_specs.rb Fixes the issues found by it. \c support had a typo had checked for \C instead. Added support for predefined character classes like [:alpha:]. I created a new class called RegexpTransformer for this to convert from Ruby regexp to CLR regexp pattern. Its state-driven and so can be extended if we need to do more complex analysis if needed. There are a few cases where we might need to do this in the future, and also if we want to give better error messages for bad regexps. Added Debug-only command line option called -compileRegexps to check perf impact of compiling Regexps to IL. It gives a 50%-300% improvement in throughput. Have not measured startup impact. The command line option will let us play with it easily. Added -ruby19 command line option to RunRSpec There are few more known issues with regexps that I will get to next. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Sun Feb 8 19:14:38 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 16:14:38 -0800 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: <43d756720902081525s47628c1bycb83fff042b6a160@mail.gmail.com> References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> <43d756720902081525s47628c1bycb83fff042b6a160@mail.gmail.com> Message-ID: I fixed this on Friday :) The problem was that Show() declared on Control was hidden by Show(IWin32Window) on Form. It took me a while to make it work :). See http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:26 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] cannot initialize Form with IronRuby On yesterdays checkout from git message "syncing to head of tfs" I get: IronRuby 1.0.0.0 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyTo ken=b77a5c561934e089" => true >>> System::Windows::Forms::Form.new => # >>> f=System::Windows::Forms::Form.new => # >>> f.Show :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.show :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.show_dialog => # >>> f.method(:Show).clr_members.each { |m| puts m.to_string } Void Show(System.Windows.Forms.IWin32Window) => [#] >>> On recent git head it works like expected. I will continue testing with the most recent sources. Keep up the great work! Cheers, --henon On Sun, Feb 8, 2009 at 9:58 PM, Tomas Matousek > wrote: Works on the bits I have. Could you try following? f.method(:Show).clr_members.each { |m| puts m.to_string } It should print Void Show() Void Show(System.Windows.Forms.IWin32Window) Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 10:55 AM To: ironruby-core Subject: [Ironruby-core] cannot initialize Form with IronRuby IronRuby 1.0.0.0 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" => true >>> Form = System::Windows::Forms::Form => System::Windows::Forms::Form >>> f=Form.new => # >>> f.Show() :0: wrong number of arguments (2 for 3) (ArgumentError) >>> f.method( :Show).arity => 0 >>> This is the latest daily DLR build on codeplex from 2009 Feb 1 at 9:36 PM. I read, that with older versions winforms interop has already been working. -- henon _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 8 19:17:29 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 16:17:29 -0800 Subject: [Ironruby-core] WPF: registering a routed event In-Reply-To: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> References: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> Message-ID: b.click { puts "clicked!!" } should do. We are going to enable more ways how to hook event handlers. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:46 PM To: ironruby-core Subject: [Ironruby-core] WPF: registering a routed event Hi all, I seem to step in every hole there is on my IronRuby test drive. Using the latest git head I am failing to register a button click event in WPF: >>> require "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' => true >>> b = System::Windows::Controls::Button.new => # >>> def on_click o, args ... puts "clicked!!" ... end => nil >>> b.add_Click( method(:on_click)) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) >>> h=System::Windows::RoutedEventHandler.new{|o, args| puts "clicked!!" } => # >>> h.Invoke(nil, nil) clicked!! => nil >>> b.add_Click(h) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) Actually I would have expected b.add_Click( method(:on_click)) or b.add_Click( lambda {|o, args| ... } ) to work, just like it does in IronPython: >>> clr.AddReference( 'WindowsBase') >>> clr.AddReference( 'PresentationCore') >>> clr.AddReference( 'PresentationFramework') >>> import System >>> from System import Windows >>> from System.Windows import Controls >>> from System.Windows.Controls import * >>> b= Button() >>> def on_click(o, args): ... print "clicked!!" ... >>> b.add_Click(on_click) >>> I hope, I am not starting to annoy you guys ;) -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Sun Feb 8 19:42:14 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 01:42:14 +0100 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> <43d756720902081525s47628c1bycb83fff042b6a160@mail.gmail.com> Message-ID: <43d756720902081642y3d2e75cckf7820f0b56369fef@mail.gmail.com> On Mon, Feb 9, 2009 at 1:14 AM, Tomas Matousek wrote: > I fixed this on Friday J > > > > The problem was that Show() declared on Control was hidden by > Show(IWin32Window) on Form. It took me a while to make it work J. See > http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html > > I see. I notice, that there is still heavy development going on. Sadly, in the latest head there are System.Actionand System.Func definitions in Microsoft.Scripting.Core.dll that clash with the same definitions in System.Core.dll which I need because of Hashset. How can that problem be resolved? Error 23 The type 'System.Func' exists in both 'd:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and '..\Microsoft.Scripting.Core.dll' -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Sun Feb 8 20:08:22 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 8 Feb 2009 17:08:22 -0800 Subject: [Ironruby-core] cannot initialize Form with IronRuby In-Reply-To: <43d756720902081642y3d2e75cckf7820f0b56369fef@mail.gmail.com> References: <43d756720902081054n472e16eau97b826a49c772bff@mail.gmail.com> <43d756720902081525s47628c1bycb83fff042b6a160@mail.gmail.com> <43d756720902081642y3d2e75cckf7820f0b56369fef@mail.gmail.com> Message-ID: You can define a global alias for System.Core.dll: right-click on the reference in project, select properties, write "SysCore" to "Aliases" field, add "extern alias SysCore;" on top of your C# source file and use "SysCore::" prefix for System.Core namespaces. See also http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 4:42 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] cannot initialize Form with IronRuby On Mon, Feb 9, 2009 at 1:14 AM, Tomas Matousek > wrote: I fixed this on Friday :) The problem was that Show() declared on Control was hidden by Show(IWin32Window) on Form. It took me a while to make it work :). See http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html I see. I notice, that there is still heavy development going on. Sadly, in the latest head there are System.Actionand System.Func definitions in Microsoft.Scripting.Core.dll that clash with the same definitions in System.Core.dll which I need because of Hashset. How can that problem be resolved? Error 23 The type 'System.Func' exists in both 'd:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and '..\Microsoft.Scripting.Core.dll' -------------- next part -------------- An HTML attachment was scrubbed... URL: From claudio.maccari at gmail.com Mon Feb 9 04:05:55 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Mon, 9 Feb 2009 10:05:55 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> Message-ID: <498ff1f1.190c660a.118f.2bf1@mx.google.com> Hi Ivan, now I get this error L C:\Projects\IronRuby>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' IronRuby.Libraries:0:in `require': no such file to load -- rbconfig (LoadError) from :0 from IronRuby.Libraries:0:in `require' from :0 >>> Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: domenica 8 febbraio 2009 18.50 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari wrote: Hi Jimmy, I would try bacon cause it looks simple but I can't get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow But I get this error C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) from :0 >>> What's wrong ? Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js _____ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Mon Feb 9 06:12:57 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 12:12:57 +0100 Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter Message-ID: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> Hello, I am very pleased that I got everything working and found iron ruby in a quite usable state for me. Congratulations. Question: How do you set a global variable from C#? I found a workaround via setting a local variable scope.SetVariable("a", obj) in the scope and assigning it to a global via engine.Execute("$a=a", scope). The Runtime.Globals.GetVariable and SetVariable don't seem to get / set the ruby globals. Please clarify. BTW: as for local variables: scope.GetVariableNames() does return an empty list. Again a workaround is Execute("local_variables", scope). -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Mon Feb 9 07:05:58 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 13:05:58 +0100 Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter In-Reply-To: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> References: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> Message-ID: <43d756720902090405r6eb92dedq9ffdec744189f6b2@mail.gmail.com> On Mon, Feb 9, 2009 at 12:12 PM, Meinrad Recheis wrote: > Hello, > > I am very pleased that I got everything working and found iron ruby in a > quite usable state for me. Congratulations. > > Question: How do you set a global variable from C#? I found a workaround > via setting a local variable scope.SetVariable("a", obj) in the scope and > assigning it to a global via engine.Execute("$a=a", scope). > The Runtime.Globals.GetVariable and SetVariable don't seem to get / set the > ruby globals. > Oh, i just found out that ScriptScope.GetVariable is throwing an exception ... ******************************************************************************** ArgumentNullException: "Value cannot be null. Parameter name: field" -------------------------------------------------------------------------------- Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName) Microsoft.Scripting.SymbolTable.StringToId(String field) Microsoft.Scripting.Hosting.ScriptScope.GetVariable(String name) -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Mon Feb 9 07:11:34 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 13:11:34 +0100 Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter In-Reply-To: <43d756720902090405r6eb92dedq9ffdec744189f6b2@mail.gmail.com> References: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> <43d756720902090405r6eb92dedq9ffdec744189f6b2@mail.gmail.com> Message-ID: <43d756720902090411r22294ad1y78303eb51ac7e29b@mail.gmail.com> On Mon, Feb 9, 2009 at 1:05 PM, Meinrad Recheis wrote: > On Mon, Feb 9, 2009 at 12:12 PM, Meinrad Recheis < > meinrad.recheis at gmail.com> wrote: > >> Hello, >> >> I am very pleased that I got everything working and found iron ruby in a >> quite usable state for me. Congratulations. >> >> Question: How do you set a global variable from C#? I found a workaround >> via setting a local variable scope.SetVariable("a", obj) in the scope and >> assigning it to a global via engine.Execute("$a=a", scope). >> The Runtime.Globals.GetVariable and SetVariable don't seem to get / set >> the ruby globals. >> > > Oh, i just found out that ScriptScope.GetVariable is throwing an exception > ... > > > ******************************************************************************** > ArgumentNullException: "Value cannot be null. > Parameter name: field" > > -------------------------------------------------------------------------------- > Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, > String paramName) > Microsoft.Scripting.SymbolTable.StringToId(String field) > Microsoft.Scripting.Hosting.ScriptScope.GetVariable(String name) > sorry forgot to say, that I made sure, that the "name" parameter is *not* null. I am not yet deep enough into the sources to fix things like these myself. -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Mon Feb 9 07:32:38 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 9 Feb 2009 13:32:38 +0100 Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter In-Reply-To: <43d756720902090411r22294ad1y78303eb51ac7e29b@mail.gmail.com> References: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> <43d756720902090405r6eb92dedq9ffdec744189f6b2@mail.gmail.com> <43d756720902090411r22294ad1y78303eb51ac7e29b@mail.gmail.com> Message-ID: <43d756720902090432rc73443cn3a8207d04418226@mail.gmail.com> On Mon, Feb 9, 2009 at 1:11 PM, Meinrad Recheis wrote: > On Mon, Feb 9, 2009 at 1:05 PM, Meinrad Recheis > wrote: > >> On Mon, Feb 9, 2009 at 12:12 PM, Meinrad Recheis < >> meinrad.recheis at gmail.com> wrote: >> >>> Hello, >>> >>> I am very pleased that I got everything working and found iron ruby in a >>> quite usable state for me. Congratulations. >>> >>> Question: How do you set a global variable from C#? I found a workaround >>> via setting a local variable scope.SetVariable("a", obj) in the scope and >>> assigning it to a global via engine.Execute("$a=a", scope). >>> The Runtime.Globals.GetVariable and SetVariable don't seem to get / set >>> the ruby globals. >>> >> >> Oh, i just found out that ScriptScope.GetVariable is throwing an exception >> ... >> >> >> ******************************************************************************** >> ArgumentNullException: "Value cannot be null. >> Parameter name: field" >> >> -------------------------------------------------------------------------------- >> Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, >> String paramName) >> Microsoft.Scripting.SymbolTable.StringToId(String field) >> Microsoft.Scripting.Hosting.ScriptScope.GetVariable(String name) >> > > sorry forgot to say, that I made sure, that the "name" parameter is *not* > null. > I am not yet deep enough into the sources to fix things like these myself. > > -- henon ok, I was too fast on this one. actually it was null because a ruby_string casted to c# string is null. It is pretty dangerous to assume a value presented as "a" by the debugger to be a System.String when that value comes out from ruby ;) so the problem is not the exception but rather that GetVariable("a") does not find existing local variables which can be evaluated by Execute("a"). This time I made sure I made no mistake. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Mon Feb 9 12:28:19 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 9 Feb 2009 09:28:19 -0800 Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter In-Reply-To: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> References: <43d756720902090312t33fe4949g73a42d8f7eb7009c@mail.gmail.com> Message-ID: You can find many hosting examples in HostingTests.cs. As for global and top-level local variables: - Variables in ScriptRuntimeRuntime.Globals are mapped to global constants (ie. constants on Object). - Variables in local ScriptScope are not mapped to Ruby top-level local variables. They are looked up via method_missing on a top-level singleton object. Ruby top-level program executes in a context where "self" is a singleton of Object. IronRuby defines method_missing on this singleton. If a method name ends with "=" it writes to the scope, otherwise it reads from the scope. ScriptScope scope = Engine.CreateScope(); scope.SetVariable("x", 1); scope.SetVariable("y", 2); Engine.Execute("self.z = x + y", scope); int result = scope.GetVariable("result"); Assert(result == 3); Ruby global variables don't have any mapping to DLR scopes. We don't have any well designed API for them yet, you can do this for now: Ruby.GetExecutionContext(Engine).DefineGlobalVariable("foo", 123); Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Monday, February 09, 2009 3:13 AM To: ironruby-core Subject: [Ironruby-core] setting global variables in embedded ironruby interpreter Hello, I am very pleased that I got everything working and found iron ruby in a quite usable state for me. Congratulations. Question: How do you set a global variable from C#? I found a workaround via setting a local variable scope.SetVariable("a", obj) in the scope and assigning it to a global via engine.Execute("$a=a", scope). The Runtime.Globals.GetVariable and SetVariable don't seem to get / set the ruby globals. Please clarify. BTW: as for local variables: scope.GetVariableNames() does return an empty list. Again a workaround is Execute("local_variables", scope). -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Mon Feb 9 12:47:21 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Mon, 9 Feb 2009 09:47:21 -0800 Subject: [Ironruby-core] Code Review: ErrorMessageFix In-Reply-To: References: Message-ID: Change looks good. -----Original Message----- From: Tomas Matousek Sent: Sunday, February 08, 2009 1:06 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: ErrorMessageFix tfpt review "/shelveset:ErrorMessageFix;REDMOND\tomat" Fixes binder error message given when an interface name is displayed. Tomas From stefan.dobrev at gmail.com Mon Feb 9 14:32:29 2009 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Mon, 9 Feb 2009 21:32:29 +0200 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <498ff1f1.190c660a.118f.2bf1@mx.google.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> <498ff1f1.190c660a.118f.2bf1@mx.google.com> Message-ID: <928de89c0902091132h2c4ca91ag7244a2900420cbca@mail.gmail.com> You can just require the file with its full path. In your case: >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' 2009/2/9 Claudio Maccari > Hi Ivan, > > now I get this error L > > > > C:\Projects\IronRuby>ir > > IronRuby 1.0.0.0 on .NET 2.0.50727.3053 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'rubygems' > > IronRuby.Libraries:0:in `require': no such file to load -- rbconfig > (LoadError) > > from :0 > > from IronRuby.Libraries:0:in `require' > > from :0 > > > > >>> > > > > Thanks > > Claudio > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* domenica 8 febbraio 2009 18.50 > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > Hi Claudio > > try this: > > require 'rubygems' > require 'bacon' > > > > On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari < > claudio.maccari at gmail.com> wrote: > > Hi Jimmy, > > > > I would try bacon cause it looks simple but I can't get it working. > > I installed bacon using gem and now is located in > C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 > > I edited my ir.exe.config file as follow > > > > > > value="c:\ruby\lib\ruby\site_ruby\1.8\;c:\ruby\lib\ruby\site_ruby\;c:\ruby\lib\ruby\1.8\;c:\ruby\lib\ruby\gems\1.8\gems\" > /> > > > > > > But I get this error > > > > C:\Projects\IronRuby>ir.exe > > IronRuby 1.0.0.0 on .NET 2.0.50727.3053 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'bacon' > > IronRuby.Libraries:0:in `require': no such file to load -- bacon > (LoadError) > > from :0 > > > > >>> > > > > What's wrong ? > > Thanks > > Claudio > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* sabato 7 febbraio 2009 21.14 > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > I've using bacon (http://github.com/chneukirchen/bacon) to test C# > Silverlight code, and it works great on the desktop as well. It's definitely > the smallest of the bdd libraries, and feels fastest, but I've got no data > to support that (yet). > > > > > http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html > > > > However, don't expect any mocking libraries to work. You can't mock C# > types, and have those changes be visible to other C# code. We need to write > a ruby wrapper around existing C# mocking libraries, so let me know if > anyone is interested in doing so. > > > > ~js > > > ------------------------------ > > *From:* ironruby-core-bounces at rubyforge.org [ > ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [ > thibaut.barrere at gmail.com] > *Sent:* Saturday, February 07, 2009 10:10 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > Hi, > > Has someone already try to test .net code with ruby DBB library? > > If the answer is yes, is there somewhere a sample/post/article of this > work? > > Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) > and Test::Unit (can be BDD too) did the trick. > > > > Check out this for a few hints and thoughts: > http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing > > > > cheers, > > > > -- Thibaut > > > > Many thanks in advance > > Claudio > > > > > > Claudio Maccari > > http://testdrivendevelopment.wordpress.com/ > > > > "I have the simplest taste. I am always satisfied with the best"- Oscar > Wilde > > > > > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Feb 9 14:33:18 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 9 Feb 2009 12:33:18 -0700 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: <000001c98a46$9ae62e50$d0b28af0$@org> References: <000001c98a46$9ae62e50$d0b28af0$@org> Message-ID: Hi Will, If you want any help (I'm the author of NWSGI) drop me a line. The specifications certainly are very similar; NWSGI is only a couple hundred lines, so I doubt a Rack implementation would be any larger. The really hard part is building the management interface - WinForms is a huge PITA. - Jeff On Sun, Feb 8, 2009 at 4:40 PM, Will Green wrote: > Woops, looks like it was on the GitHub wiki, and I may have ascribed more > meaning to what is there: http://wiki.github.com/ironruby/ironruby/libraries > > I just had this idea this morning after attending a regional Ruby conference > (acts_as_conference). I'll get right on getting set up. > > Thanks! > > == > Will From claudio.maccari at gmail.com Mon Feb 9 16:19:00 2009 From: claudio.maccari at gmail.com (Claudio Maccari) Date: Mon, 9 Feb 2009 22:19:00 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <928de89c0902091132h2c4ca91ag7244a2900420cbca@mail.gmail.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> <498ff1f1.190c660a.118f.2bf1@mx.google.com> <928de89c0902091132h2c4ca91ag7244a2900420cbca@mail.gmail.com> Message-ID: <49909dc6.0c135e0a.4b73.ffffd448@mx.google.com> This works but I would understand why require ?bacon? does not. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Stefan Dobrev Sent: luned? 9 febbraio 2009 20.32 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries You can just require the file with its full path. In your case: >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' 2009/2/9 Claudio Maccari Hi Ivan, now I get this error L C:\Projects\IronRuby>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' IronRuby.Libraries:0:in `require': no such file to load -- rbconfig (LoadError) from :0 from IronRuby.Libraries:0:in `require' from :0 >>> Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: domenica 8 febbraio 2009 18.50 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari wrote: Hi Jimmy, I would try bacon cause it looks simple but I can't get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow But I get this error C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) from :0 >>> What's wrong ? Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverli ght.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js _____ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 16:56:43 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 13:56:43 -0800 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <49909dc6.0c135e0a.4b73.ffffd448@mx.google.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> <498ff1f1.190c660a.118f.2bf1@mx.google.com> <928de89c0902091132h2c4ca91ag7244a2900420cbca@mail.gmail.com> <49909dc6.0c135e0a.4b73.ffffd448@mx.google.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87A68@NA-EXMSG-C116.redmond.corp.microsoft.com> Sounds like rubygems isn't working correctly on your setup of IronRuby. It's complaining about not finding rbconfig, which gems needs to load. It doesn't have anything to do with bacon, so for now avoid loading it as a gem. We don't have good documentation about how to get gems working in custom build of IronRuby, but that's something I'll be adding shortly. Ivan has gone down the path of getting this set up already, so maybe he can give you some pointers. Ivan? ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Claudio Maccari Sent: Monday, February 09, 2009 1:19 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries This works but I would understand why require 'bacon' does not. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Stefan Dobrev Sent: luned? 9 febbraio 2009 20.32 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries You can just require the file with its full path. In your case: >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' 2009/2/9 Claudio Maccari > Hi Ivan, now I get this error :( C:\Projects\IronRuby>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' IronRuby.Libraries:0:in `require': no such file to load -- rbconfig (LoadError) from :0 from IronRuby.Libraries:0:in `require' from :0 >>> Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: domenica 8 febbraio 2009 18.50 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari > wrote: Hi Jimmy, I would try bacon cause it looks simple but I can't get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow But I get this error C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) from :0 >>> What's wrong ? Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js ________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Mon Feb 9 17:08:25 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 9 Feb 2009 14:08:25 -0800 Subject: [Ironruby-core] BEGIN used in HTree Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0B92C1D8@NA-EXMSG-C104.redmond.corp.microsoft.com> IronRuby does not currently support BEGIN/END. HTree uses BEGIN like this to syntax check if code_to_syntax_check contains valid Ruby code. eval("BEGIN { return true }\n#{code_to_syntax_check}") Is there any difference to just using this? eval("return true\n#{code_to_syntax_check}") I thought we had added BEGIN/END to http://www.ironruby.net/About/Roadmap. I don't see it though. Will add it. Thanks, Shri -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 18:13:47 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 15:13:47 -0800 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: <000001c98a46$9ae62e50$d0b28af0$@org> References: <000001c98a46$9ae62e50$d0b28af0$@org> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87DBA@NA-EXMSG-C116.redmond.corp.microsoft.com> Will, That page on github is wildly out of date (and I've updated it to say so). http://ironruby.info will have daily information on where IronRuby is at with supporting RubySpec, as well as other popular Ruby frameworks. Right now it's just RubySpec pass/fail information, but stack traces and more data are coming soon. > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Will Green > Sent: Sunday, February 08, 2009 3:40 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with > IronRuby > > Woops, looks like it was on the GitHub wiki, and I may have ascribed > more > meaning to what is there: > http://wiki.github.com/ironruby/ironruby/libraries > > I just had this idea this morning after attending a regional Ruby > conference > (acts_as_conference). I'll get right on getting set up. > > Thanks! > > == > Will > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Sunday, February 08, 2009 5:23 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with > IronRuby > > Hash is mostly implemented. Can you post a link to the page where it > shows > it as not done? I'll fix it. I don't know if any of the methods needed > by > Rack are missing. Jimmy, have you tried this scenario? > > In the mean time, if you started down this road, we'd be happy to have > your > contributions. If you haven't already, you'll need to get setup to > contribute. The instructions are on the Github wiki at: > http://wiki.github.com/ironruby/ironruby/contributing. > > > Thanks, > > JD > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Will Green > > Sent: Sunday, February 08, 2009 12:23 PM > > To: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with > IronRuby > > > > First, I want to say that I'm very excited by the progress of > IronRuby. > > > > So, my interrest lies in getting Ruby web applications running > through > > IIS 7. Specifically Rails, but also others like Sinatra and Merb, all > > of which are now built on Rack. Rack implements a new web-to- > > application protocol, based partly on Python's WSGI, which supplants > > FastCGI. > > > > I've looked, and someone has already created nWSGI on CodePlex. This > > project implements WSGI, and hosts IronPython to run the Python app. > > > > I'm thinking of taking a similar approach, but one of the key > > requirements of the Rack protocol is that the Rack application's call > > method takes exactly one param: a Ruby Hash; it cannot be a subclass. > > Reading the status at IronRuby.net, it looks like Hash is not yet > > implemented. Is this the case? > > > > I guess I'm looking to see if my project is something that can be > done > > at this time, or if IronRuby needs some more help before I can > attempt > > it. I'd be happy to contribute time & code to get this working. > > > > Thanks! > > > > Will Green > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From thibaut.barrere at gmail.com Mon Feb 9 19:48:32 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 10 Feb 2009 01:48:32 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono Message-ID: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> Hi, two things: - I'm sharing in case it's useful to someone else: I pushed some rake tasks here http://github.com/thbar/ironruby-labs/tree/master . I'm using it to download the DLR nightly to my Mac, patch ir.exe.config and launch mono ir.exe. I'll add more things there as I go (including UI, experimentations etc). - is "mono Release/ir.exe -D somefile.rb" supposed to work with Mono 2.2 and the latest DLR build (10584) ? It seems that I'm facing the issue Ivan reported a while back: Macintosh:ironruby-labs thbar$ mono Release/ir.exe -D ui/ui.rb mscorlib:0:in `set_Fallback': Argument cannot be null. (System::ArgumentNullException) from mscorlib:0:in `.ctor' from mscorlib:0:in `GetDecoder' from mscorlib:0:in `Initialize' from mscorlib:0:in `.ctor' from mscorlib:0:in `.ctor' cheers, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Mon Feb 9 20:22:49 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 10 Feb 2009 02:22:49 +0100 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Message-ID: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Mon Feb 9 20:41:51 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 9 Feb 2009 17:41:51 -0800 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> Message-ID: Have you tried "def HelloWorld; end" (ie. match the interface method casing)? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 09, 2009 5:23 PM To: ironruby-core Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 20:43:03 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 17:43:03 -0800 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> How does it fail? Nothing fails for me, but how are you trying to use this Ruby class? (test.cs has your c# code in it): C:\dev>csc.exe /t:library test.cs Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. C:\dev>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3521 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'test.dll' => true >>> class Doer ... include IDoSomething ... def hello_world ... puts "hello" ... end ... end => nil >>> Doer => Doer >>> Doer.new => # >>> Doer.new.hello_world hello => nil ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 09, 2009 5:23 PM To: ironruby-core Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Mon Feb 9 20:45:38 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 9 Feb 2009 17:45:38 -0800 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: You need to call the method from C# to check whether it is actually bound to the CLR interface implementation. The method will always be callable from Ruby. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Monday, February 09, 2009 5:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] How to implement a C# interface from Ruby ? How does it fail? Nothing fails for me, but how are you trying to use this Ruby class? (test.cs has your c# code in it): C:\dev>csc.exe /t:library test.cs Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. C:\dev>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3521 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'test.dll' => true >>> class Doer ... include IDoSomething ... def hello_world ... puts "hello" ... end ... end => nil >>> Doer => Doer >>> Doer.new => # >>> Doer.new.hello_world hello => nil ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 09, 2009 5:23 PM To: ironruby-core Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 21:00:29 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 18:00:29 -0800 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F1B@NA-EXMSG-C116.redmond.corp.microsoft.com> Ah, me = dummy. You have that interface in C#, and the IronRuby code you're hosting can't see the interface. This should expose all the types in the current assembly: engine.Runtime.LoadAssembly(GetType().Assembly); ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Monday, February 09, 2009 5:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] How to implement a C# interface from Ruby ? How does it fail? Nothing fails for me, but how are you trying to use this Ruby class? (test.cs has your c# code in it): C:\dev>csc.exe /t:library test.cs Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. C:\dev>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3521 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'test.dll' => true >>> class Doer ... include IDoSomething ... def hello_world ... puts "hello" ... end ... end => nil >>> Doer => Doer >>> Doer.new => # >>> Doer.new.hello_world hello => nil ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 09, 2009 5:23 PM To: ironruby-core Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 21:28:05 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 18:28:05 -0800 Subject: [Ironruby-core] WPF: registering a routed event In-Reply-To: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> References: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F3D@NA-EXMSG-C116.redmond.corp.microsoft.com> We only have blocks/lambda->event handlers working. Passing a method handle is on the list, but not done yet. Feel free to post a bug on RubyForge to make sure we get around to it. http://rubyforge.org/tracker/?func=add&group_id=4359&atid=16798 ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:46 PM To: ironruby-core Subject: [Ironruby-core] WPF: registering a routed event Hi all, I seem to step in every hole there is on my IronRuby test drive. Using the latest git head I am failing to register a button click event in WPF: >>> require "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' => true >>> b = System::Windows::Controls::Button.new => # >>> def on_click o, args ... puts "clicked!!" ... end => nil >>> b.add_Click( method(:on_click)) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) >>> h=System::Windows::RoutedEventHandler.new{|o, args| puts "clicked!!" } => # >>> h.Invoke(nil, nil) clicked!! => nil >>> b.add_Click(h) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) Actually I would have expected b.add_Click( method(:on_click)) or b.add_Click( lambda {|o, args| ... } ) to work, just like it does in IronPython: >>> clr.AddReference( 'WindowsBase') >>> clr.AddReference( 'PresentationCore') >>> clr.AddReference( 'PresentationFramework') >>> import System >>> from System import Windows >>> from System.Windows import Controls >>> from System.Windows.Controls import * >>> b= Button() >>> def on_click(o, args): ... print "clicked!!" ... >>> b.add_Click(on_click) >>> I hope, I am not starting to annoy you guys ;) -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 9 22:15:24 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 9 Feb 2009 19:15:24 -0800 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F65@NA-EXMSG-C116.redmond.corp.microsoft.com> // test.dll public interface IDoSomething { void HelloWorld(); } public class Foo { public void Bar(IDoSomething i) { i.HelloWorld(); } } C:\dev>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3521 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'test.dll' => true >>> class Doer ... include IDoSomething ... def hello_world ... puts "hi" ... end ... end => nil >>> f = Foo.new => # >>> d = Doer.new => # >>> f.Bar(d) hi => nil From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Monday, February 09, 2009 5:46 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] How to implement a C# interface from Ruby ? You need to call the method from C# to check whether it is actually bound to the CLR interface implementation. The method will always be callable from Ruby. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Monday, February 09, 2009 5:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] How to implement a C# interface from Ruby ? How does it fail? Nothing fails for me, but how are you trying to use this Ruby class? (test.cs has your c# code in it): C:\dev>csc.exe /t:library test.cs Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. C:\dev>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3521 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'test.dll' => true >>> class Doer ... include IDoSomething ... def hello_world ... puts "hello" ... end ... end => nil >>> Doer => Doer >>> Doer.new => # >>> Doer.new.hello_world hello => nil ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 09, 2009 5:23 PM To: ironruby-core Subject: [Ironruby-core] How to implement a C# interface from Ruby ? Hello again, I'm playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I'm having some difficulties trying to figure out what the correct syntax for that would be. I'm currently using this to bootstrap the engine: var reader = new StreamReader("plugin.rb"); var code = reader.ReadToEnd(); reader.Close(); var engine = IronRuby.Ruby.CreateEngine(); engine.Execute(code); The code inside plugin.rb is trying to implement an existing C# interface: public interface IDoSomething { void HelloWorld(); } I tried: class Doer include IDoSomething def hello_world puts "hello" end end but it fails. What would be the correct syntax for a Ruby class to implement this ? thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Tue Feb 10 02:41:27 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 10 Feb 2009 08:41:27 +0100 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87A68@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <498dbeab.0710660a.3cd2.4ecb@mx.google.com> <4a68b8cf0902071010j6fe56a79q7b79d5343e2ed868@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BE67ECF89@NA-EXMSG-C116.redmond.corp.microsoft.com> <498f14e7.02a1660a.7927.6867@mx.google.com> <498ff1f1.190c660a.118f.2bf1@mx.google.com> <928de89c0902091132h2c4ca91ag7244a2900420cbca@mail.gmail.com> <49909dc6.0c135e0a.4b73.ffffd448@mx.google.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87A68@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Hi Claudio What I did was the following: I cloned ironruby from git then i build it using rake I use this .cmd file in the git root folder which is C:\tools\ironruby in my case @ECHO OFF cd merlin/main/Languages/Ruby ECHO "compiling debug version" rake compile cd ../../../.. ECHO "All done" I then change the line in ir.exe.config that sets the paths to read like this: I also added the path C:\tools\ironruby\Merlin\Main\Languages\Ruby\Scripts to the PATH variable (that gives you access to igem, irake etc.) That should get ironruby gems to work you can test it by doing igem --version or igem env At this point rubygems seems to be broken in ironruby I get an error + C:\Users\Ivan Porto Carrero ? igem install bacon -V --backtrace --debug HEAD 200 OK: http://gems.rubyforge.org/latest_specs.4.8 GET 200 OK: http://gems.rubyforge.org/quick/Marshal.4.8/bacon-1.1.0.gemspec.rz ERROR: While executing gem ... (TypeError) allocator undefined for Zlib::Inflate c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Zlib\zlib.cs:517:in `inflate' rubygems.rb:395:in `inflate' spec_fetcher.rb:77:in `fetch_spec' spec_fetcher.rb:64:in `fetch' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\Enumerable.cs:88:in `map' spec_fetcher.rb:61:in `fetch' dependency_installer.rb:75:in `find_gems_with_sources' dependency_installer.rb:162:in `find_spec_by_name_and_version' dependency_installer.rb:206:in `install' install_command.rb:70:in `execute' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' install_command.rb:45:in `execute' command.rb:129:in `invoke' command_manager.rb:86:in `process_args' command_manager.rb:74:in `run' gem_runner.rb:25:in `run' :0 so to make bacon work you install it with MRI. Then you can copy the folder bacon-1.1.0 from the folders gems, doc, specification in C:\ruby\lib\ruby\gems\1.8 to the folders gems, doc, specification in C:\tools\ironruby\merlin\external\languages\ruby\ruby-1.8.6\lib\ironruby\gems\1.8 When I did that I could do: + C:\Users\Ivan Porto Carrero ? ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' => true >>> require 'bacon' => true On Mon, Feb 9, 2009 at 10:56 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > Sounds like rubygems isn't working correctly on your setup of IronRuby. > It's complaining about not finding rbconfig, which gems needs to load. It > doesn't have anything to do with bacon, so for now avoid loading it as a > gem. > > > > We don't have good documentation about how to get gems working in custom > build of IronRuby, but that's something I'll be adding shortly. Ivan has > gone down the path of getting this set up already, so maybe he can give you > some pointers. Ivan? > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Claudio Maccari > *Sent:* Monday, February 09, 2009 1:19 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > This works but I would understand why require 'bacon' does not. > > > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Stefan Dobrev > *Sent:* luned? 9 febbraio 2009 20.32 > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > You can just require the file with its full path. > > In your case: > > > > >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' > > > > 2009/2/9 Claudio Maccari > > Hi Ivan, > > now I get this error L > > > > C:\Projects\IronRuby>ir > > IronRuby 1.0.0.0 on .NET 2.0.50727.3053 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'rubygems' > > IronRuby.Libraries:0:in `require': no such file to load -- rbconfig > (LoadError) > > from :0 > > from IronRuby.Libraries:0:in `require' > > from :0 > > > > >>> > > > > Thanks > > Claudio > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* domenica 8 febbraio 2009 18.50 > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > Hi Claudio > > try this: > > require 'rubygems' > require 'bacon' > > On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari < > claudio.maccari at gmail.com> wrote: > > Hi Jimmy, > > > > I would try bacon cause it looks simple but I can't get it working. > > I installed bacon using gem and now is located in > C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 > > I edited my ir.exe.config file as follow > > > > > > value="c:\ruby\lib\ruby\site_ruby\1.8\;c:\ruby\lib\ruby\site_ruby\;c:\ruby\lib\ruby\1.8\;c:\ruby\lib\ruby\gems\1.8\gems\" > /> > > > > > > But I get this error > > > > C:\Projects\IronRuby>ir.exe > > IronRuby 1.0.0.0 on .NET 2.0.50727.3053 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'bacon' > > IronRuby.Libraries:0:in `require': no such file to load -- bacon > (LoadError) > > from :0 > > > > >>> > > > > What's wrong ? > > Thanks > > Claudio > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* sabato 7 febbraio 2009 21.14 > > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > > > I've using bacon (http://github.com/chneukirchen/bacon) to test C# > Silverlight code, and it works great on the desktop as well. It's definitely > the smallest of the bdd libraries, and feels fastest, but I've got no data > to support that (yet). > > > > > http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html > > > > However, don't expect any mocking libraries to work. You can't mock C# > types, and have those changes be visible to other C# code. We need to write > a ruby wrapper around existing C# mocking libraries, so let me know if > anyone is interested in doing so. > > > > ~js > > > ------------------------------ > > *From:* ironruby-core-bounces at rubyforge.org [ > ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [ > thibaut.barrere at gmail.com] > *Sent:* Saturday, February 07, 2009 10:10 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] test .net code with ruby BDD libraries > > Hi, > > Has someone already try to test .net code with ruby DBB library? > > If the answer is yes, is there somewhere a sample/post/article of this > work? > > Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) > and Test::Unit (can be BDD too) did the trick. > > > > Check out this for a few hints and thoughts: > http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing > > > > cheers, > > > > -- Thibaut > > > > Many thanks in advance > > Claudio > > > > > > Claudio Maccari > > http://testdrivendevelopment.wordpress.com/ > > > > "I have the simplest taste. I am always satisfied with the best"- Oscar > Wilde > > > > > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Tue Feb 10 03:38:51 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 10 Feb 2009 09:38:51 +0100 Subject: [Ironruby-core] How to implement a C# interface from Ruby ? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F1B@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0902091722r2da02b7ag3453dddf8b4f8d71@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87EFC@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F1B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0902100038t3a3d4255l77df7c01f2188415@mail.gmail.com> Hi guys, thanks for all the suggestions. > Ah, me = dummy. You have that interface in C#, and the IronRuby code you're > hosting can't see the interface. This should expose all the types in the > current assembly: > > engine.Runtime.LoadAssembly(GetType().Assembly); > That's what was missing! Thank you... I'll have a closer look at the hosting tests, I guess this was probably in there already. thanks! -- Thibaut > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* Monday, February 09, 2009 5:43 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] How to implement a C# interface from Ruby ? > > > > How does it fail? Nothing fails for me, but how are you trying to use this > Ruby class? > > > > (test.cs has your c# code in it): > > > > C:\dev>csc.exe /t:library test.cs > > Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715 > > for Microsoft (R) .NET Framework version 3.5 > > Copyright (C) Microsoft Corporation. All rights reserved. > > > > C:\dev>ir > > IronRuby 1.0.0.0 on .NET 2.0.50727.3521 > > Copyright (c) Microsoft Corporation. All rights reserved. > > > > >>> require 'test.dll' > > => true > > >>> class Doer > > ... include IDoSomething > > ... def hello_world > > ... puts "hello" > > ... end > > ... end > > => nil > > >>> Doer > > => Doer > > >>> Doer.new > > => # > > >>> Doer.new.hello_world > > hello > > => nil > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Monday, February 09, 2009 5:23 PM > *To:* ironruby-core > *Subject:* [Ironruby-core] How to implement a C# interface from Ruby ? > > > > Hello again, > > > > I'm playing around with the idea of using IronRuby to implement plugins for > a C#-based system (namely, CruiseControl.Net). > > > > I'm having some difficulties trying to figure out what the correct syntax > for that would be. I'm currently using this to bootstrap the engine: > > > > var reader = new > StreamReader("plugin.rb"); > > var code = reader.ReadToEnd(); > > reader.Close(); > > > > var engine = > IronRuby.Ruby.CreateEngine(); > > engine.Execute(code); > > > > The code inside plugin.rb is trying to implement an existing C# interface: > > > > public interface IDoSomething { > > void HelloWorld(); > > } > > > > I tried: > > > > class Doer > > include IDoSomething > > > > def hello_world > > puts "hello" > > end > > end > > > > but it fails. What would be the correct syntax for a Ruby class to > implement this ? > > > > thanks! > > > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ksunair at yahoo.com Tue Feb 10 08:49:43 2009 From: ksunair at yahoo.com (Unnikrishnan Nair) Date: Tue, 10 Feb 2009 05:49:43 -0800 (PST) Subject: [Ironruby-core] test .net code with ruby BDD libraries Message-ID: <415565.81887.qm@web50611.mail.re2.yahoo.com> Hi Ivan, It is a very good documentation of what we have now. I have been playing with Ironruby and becon couldn't make it work. I am going to give it a try with your suggestion. Thanks for the help. --- On Tue, 2/10/09, Ivan Porto Carrero wrote: From: Ivan Porto Carrero Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries To: ironruby-core at rubyforge.org Date: Tuesday, February 10, 2009, 1:41 AM Hi Claudio What I did was the following: I cloned ironruby from git then i build it using rake I use this .cmd file in the git root folder which is C:\tools\ironruby in my case @ECHO OFF cd merlin/main/Languages/Ruby ECHO "compiling debug version" rake compile cd ../../../.. ECHO "All done" I then change the line in ir.exe.config that sets the paths to read like this: I also added the path C:\tools\ironruby\Merlin\Main\Languages\Ruby\Scripts to the PATH variable (that gives you access to igem, irake etc.) That should get ironruby gems to work you can test it by doing igem --version or igem env At this point rubygems seems to be broken in ironruby I get an error + C:\Users\Ivan Porto Carrero ? igem install bacon -V --backtrace --debug HEAD 200 OK: http://gems.rubyforge.org/latest_specs.4.8 GET 200 OK: http://gems.rubyforge.org/quick/Marshal.4.8/bacon-1.1.0.gemspec.rz ERROR:? While executing gem ... (TypeError) ??? allocator undefined for Zlib::Inflate ??????? c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Zlib\zlib.cs:517:in `inflate' ??????? rubygems.rb:395:in `inflate' ??????? spec_fetcher.rb:77:in `fetch_spec' ??????? spec_fetcher.rb:64:in `fetch' ??????? c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' ??????? c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\Enumerable.cs:88:in `map' ??????? spec_fetcher.rb:61:in `fetch' ??????? dependency_installer.rb:75:in `find_gems_with_sources' ??????? dependency_installer.rb:162:in `find_spec_by_name_and_version' ??????? dependency_installer.rb:206:in `install' ??????? install_command.rb:70:in `execute' ??????? c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' ??????? install_command.rb:45:in `execute' ??????? command.rb:129:in `invoke' ??????? command_manager.rb:86:in `process_args' ??????? command_manager.rb:74:in `run' ??????? gem_runner.rb:25:in `run' ??????? :0 so to make bacon work you install it with MRI. Then you can copy the folder bacon-1.1.0 from the folders gems, doc, specification in C:\ruby\lib\ruby\gems\1.8 to the folders gems, doc, specification in C:\tools\ironruby\merlin\external\languages\ruby\ruby-1.8.6\lib\ironruby\gems\1.8 When I did that I could do: + C:\Users\Ivan Porto Carrero ? ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' => true >>> require 'bacon' => true On Mon, Feb 9, 2009 at 10:56 PM, Jimmy Schementi wrote: Sounds like rubygems isn't working correctly on your setup of IronRuby. It's complaining about not finding rbconfig, which gems needs to load. It doesn't have anything to do with bacon, so for now avoid loading it as a gem. ? We don't have good documentation about how to get gems working in custom build of IronRuby, but that's something I'll be adding shortly. Ivan has gone down the path of getting this set up already, so maybe he can give you some pointers. Ivan? ? ~js ? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Claudio Maccari Sent: Monday, February 09, 2009 1:19 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries ? This works but I would understand why require 'bacon' does not. ? ? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Stefan Dobrev Sent: luned? 9 febbraio 2009 20.32 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries ? You can just require the file with its full path.? In your case: ? >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' ? 2009/2/9 Claudio Maccari Hi Ivan, now I get this error L ? C:\Projects\IronRuby>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. ? >>> require 'rubygems' IronRuby.Libraries:0:in `require': no such file to load -- rbconfig (LoadError) ??????? from :0 ??????? from IronRuby.Libraries:0:in `require' ??????? from :0 ? >>>? ? Thanks Claudio ? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: domenica 8 febbraio 2009 18.50 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries ? Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari wrote: Hi Jimmy, ? I would try bacon cause it looks simple but I can't get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow ? ????? ??? ? But I get this error ? C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. ? >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) ??????? from :0 ? >>>? ? What's? wrong ? Thanks Claudio ? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries ? I've using bacon (http://github.com/chneukirchen/bacon)?to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). ? http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html ? However, don't expect any mocking libraries to work. You can't mock?C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ? ~js ? From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi,? Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. ? Check out this for a few hints and thoughts:?http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing ? cheers, ? -- Thibaut ? Many thanks in advance Claudio ? ? Claudio Maccari http://testdrivendevelopment.wordpress.com/ ? "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde ? ? ? ? ? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core ? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core ? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core ? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -----Inline Attachment Follows----- _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 10 09:27:56 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 10 Feb 2009 09:27:56 -0500 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> Message-ID: I have this bug fixed in my linux/mono branch. File a bug (if there isn't one already) and I'll submit my patch to it. On Mon, Feb 9, 2009 at 7:48 PM, Thibaut Barr?re wrote: > Hi, > two things: > > - I'm sharing in case it's useful to someone else: I pushed some rake tasks > here http://github.com/thbar/ironruby-labs/tree/master . I'm using it to > download the DLR nightly to my Mac, patch ir.exe.config and launch mono > ir.exe. I'll add more things there as I go (including UI, experimentations > etc). > > - is "mono Release/ir.exe -D somefile.rb" supposed to work with Mono 2.2 > and the latest DLR build (10584) ? It seems that I'm facing the issue Ivan > reported a while back: > > Macintosh:ironruby-labs thbar$ mono Release/ir.exe -D ui/ui.rb > mscorlib:0:in `set_Fallback': Argument cannot be null. > (System::ArgumentNullException) > from mscorlib:0:in `.ctor' > from mscorlib:0:in `GetDecoder' > from mscorlib:0:in `Initialize' > from mscorlib:0:in `.ctor' > from mscorlib:0:in `.ctor' > > cheers, > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 10 09:33:04 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 10 Feb 2009 09:33:04 -0500 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> Message-ID: I just sent out a pull request, here's the diff to fix the error: Merlin/Main/Languages/Ruby/Ruby/Runtime/BinaryEncoding.cs @@ -30,7 +30,8 @@ namespace IronRuby.Runtime { // TODO: remove public static readonly Encoding/*!*/ Obsolete = Instance; - private BinaryEncoding() { + private BinaryEncoding():base(0) { + } public override int GetByteCount(char[]/*!*/ chars, int index, int count) { On Tue, Feb 10, 2009 at 9:27 AM, Michael Letterle < michael.letterle at gmail.com> wrote: > I have this bug fixed in my linux/mono branch. File a bug (if there isn't > one already) and I'll submit my patch to it. > > On Mon, Feb 9, 2009 at 7:48 PM, Thibaut Barr?re > wrote: > >> Hi, >> two things: >> >> - I'm sharing in case it's useful to someone else: I pushed some rake >> tasks here http://github.com/thbar/ironruby-labs/tree/master . I'm using >> it to download the DLR nightly to my Mac, patch ir.exe.config and launch >> mono ir.exe. I'll add more things there as I go (including UI, >> experimentations etc). >> >> - is "mono Release/ir.exe -D somefile.rb" supposed to work with Mono 2.2 >> and the latest DLR build (10584) ? It seems that I'm facing the issue Ivan >> reported a while back: >> >> Macintosh:ironruby-labs thbar$ mono Release/ir.exe -D ui/ui.rb >> mscorlib:0:in `set_Fallback': Argument cannot be null. >> (System::ArgumentNullException) >> from mscorlib:0:in `.ctor' >> from mscorlib:0:in `GetDecoder' >> from mscorlib:0:in `Initialize' >> from mscorlib:0:in `.ctor' >> from mscorlib:0:in `.ctor' >> >> cheers, >> >> -- Thibaut >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Feb 10 17:06:12 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Feb 2009 14:06:12 -0800 Subject: [Ironruby-core] test .net code with ruby BDD libraries In-Reply-To: <415565.81887.qm@web50611.mail.re2.yahoo.com> References: <415565.81887.qm@web50611.mail.re2.yahoo.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD88327@NA-EXMSG-C116.redmond.corp.microsoft.com> Yep, igem install doesn't work currently, Tomas said he'd look at it. In the meantime: ? Add c:\path\to\ironruby\Merlin\Main\Languages\Ruby\Scripts\Bin to your PATH ? Point rubygems at c:\path\to\ruby-1.8.6\lib\ruby\gems (rather than ironruby\gems) by changing c:\path\to\ruby1.8.6\lib\ruby\site_ruby\1.8\rubygems\defaults.rb#15 to: File.join ConfigMap[:libdir], 'ruby', 'gems', Then "igem list --local" will show the same gems that "gem list --local" sees. So for now, install gems with "gem", but you can then use them from IronRuby. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Unnikrishnan Nair Sent: Tuesday, February 10, 2009 5:50 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi Ivan, It is a very good documentation of what we have now. I have been playing with Ironruby and becon couldn't make it work. I am going to give it a try with your suggestion. Thanks for the help. --- On Tue, 2/10/09, Ivan Porto Carrero wrote: From: Ivan Porto Carrero Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries To: ironruby-core at rubyforge.org Date: Tuesday, February 10, 2009, 1:41 AM Hi Claudio What I did was the following: I cloned ironruby from git then i build it using rake I use this .cmd file in the git root folder which is C:\tools\ironruby in my case @ECHO OFF cd merlin/main/Languages/Ruby ECHO "compiling debug version" rake compile cd ../../../.. ECHO "All done" I then change the line in ir.exe.config that sets the paths to read like this: I also added the path C:\tools\ironruby\Merlin\Main\Languages\Ruby\Scripts to the PATH variable (that gives you access to igem, irake etc.) That should get ironruby gems to work you can test it by doing igem --version or igem env At this point rubygems seems to be broken in ironruby I get an error + C:\Users\Ivan Porto Carrero ? igem install bacon -V --backtrace --debug HEAD 200 OK: http://gems.rubyforge.org/latest_specs.4.8 GET 200 OK: http://gems.rubyforge.org/quick/Marshal.4.8/bacon-1.1.0.gemspec.rz ERROR: While executing gem ... (TypeError) allocator undefined for Zlib::Inflate c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Zlib\zlib.cs:517:in `inflate' rubygems.rb:395:in `inflate' spec_fetcher.rb:77:in `fetch_spec' spec_fetcher.rb:64:in `fetch' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\Enumerable.cs:88:in `map' spec_fetcher.rb:61:in `fetch' dependency_installer.rb:75:in `find_gems_with_sources' dependency_installer.rb:162:in `find_spec_by_name_and_version' dependency_installer.rb:206:in `install' install_command.rb:70:in `execute' c:\tools\ironruby\merlin\main\Languages\Ruby\Libraries.LCA_RESTRICTED\Extensions\IListOps.cs:700:in `each' install_command.rb:45:in `execute' command.rb:129:in `invoke' command_manager.rb:86:in `process_args' command_manager.rb:74:in `run' gem_runner.rb:25:in `run' :0 so to make bacon work you install it with MRI. Then you can copy the folder bacon-1.1.0 from the folders gems, doc, specification in C:\ruby\lib\ruby\gems\1.8 to the folders gems, doc, specification in C:\tools\ironruby\merlin\external\languages\ruby\ruby-1.8.6\lib\ironruby\gems\1.8 When I did that I could do: + C:\Users\Ivan Porto Carrero ? ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' => true >>> require 'bacon' => true On Mon, Feb 9, 2009 at 10:56 PM, Jimmy Schementi > wrote: Sounds like rubygems isn't working correctly on your setup of IronRuby. It's complaining about not finding rbconfig, which gems needs to load. It doesn't have anything to do with bacon, so for now avoid loading it as a gem. We don't have good documentation about how to get gems working in custom build of IronRuby, but that's something I'll be adding shortly. Ivan has gone down the path of getting this set up already, so maybe he can give you some pointers. Ivan? ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Claudio Maccari Sent: Monday, February 09, 2009 1:19 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries This works but I would understand why require 'bacon' does not. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Stefan Dobrev Sent: luned? 9 febbraio 2009 20.32 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries You can just require the file with its full path. In your case: >>> require 'C:\Ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0\lib\bacon.rb' 2009/2/9 Claudio Maccari > Hi Ivan, now I get this error :( C:\Projects\IronRuby>ir IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' IronRuby.Libraries:0:in `require': no such file to load -- rbconfig (LoadError) from :0 from IronRuby.Libraries:0:in `require' from :0 >>> Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: domenica 8 febbraio 2009 18.50 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi Claudio try this: require 'rubygems' require 'bacon' On Sun, Feb 8, 2009 at 6:22 PM, Claudio Maccari > wrote: Hi Jimmy, I would try bacon cause it looks simple but I can't get it working. I installed bacon using gem and now is located in C:\ruby\lib\ruby\gems\1.8\gems\bacon-1.1.0 I edited my ir.exe.config file as follow But I get this error C:\Projects\IronRuby>ir.exe IronRuby 1.0.0.0 on .NET 2.0.50727.3053 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'bacon' IronRuby.Libraries:0:in `require': no such file to load -- bacon (LoadError) from :0 >>> What's wrong ? Thanks Claudio From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: sabato 7 febbraio 2009 21.14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries I've using bacon (http://github.com/chneukirchen/bacon) to test C# Silverlight code, and it works great on the desktop as well. It's definitely the smallest of the bdd libraries, and feels fastest, but I've got no data to support that (yet). http://blog.jimmy.schementi.com/2009/01/dynamic-language-testing-in-silverlight.html However, don't expect any mocking libraries to work. You can't mock C# types, and have those changes be visible to other C# code. We need to write a ruby wrapper around existing C# mocking libraries, so let me know if anyone is interested in doing so. ~js ________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, February 07, 2009 10:10 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] test .net code with ruby BDD libraries Hi, Has someone already try to test .net code with ruby DBB library? If the answer is yes, is there somewhere a sample/post/article of this work? Did not use RSpec yet (as it was reported to be slow), but MSpec (BDD) and Test::Unit (can be BDD too) did the trick. Check out this for a few hints and thoughts: http://blog.logeek.fr/2008/12/1/thoughts-on-ironruby-and-dotnet-testing cheers, -- Thibaut Many thanks in advance Claudio Claudio Maccari http://testdrivendevelopment.wordpress.com/ "I have the simplest taste. I am always satisfied with the best"- Oscar Wilde _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -----Inline Attachment Follows----- _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Tue Feb 10 19:47:18 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 10 Feb 2009 16:47:18 -0800 Subject: [Ironruby-core] Code Review: bugfixes1 Message-ID: tfpt review "/shelveset:bugfixes1;REDMOND\jdeville" Comment : BinaryEncoding changes to help mono compilation, thanks to M. Letterle. Changes in FileOps to fix File.dirname (Rubyforge bugs 23669 and 22167), thanks to Ivan Porto Carrero. Tag changes for the FileOps fix. -------------- next part -------------- A non-text attachment was scrubbed... Name: bugfixes1.diff Type: application/octet-stream Size: 13101 bytes Desc: bugfixes1.diff URL: From Jimmy.Schementi at microsoft.com Tue Feb 10 21:08:00 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Feb 2009 18:08:00 -0800 Subject: [Ironruby-core] Code Review: bugfixes1 In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD88512@NA-EXMSG-C116.redmond.corp.microsoft.com> Looks good. Removing tags is good =) > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, February 10, 2009 4:47 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: bugfixes1 > > tfpt review "/shelveset:bugfixes1;REDMOND\jdeville" > Comment : > BinaryEncoding changes to help mono compilation, thanks to M. > Letterle. Changes in FileOps to fix File.dirname (Rubyforge bugs 23669 > and 22167), thanks to Ivan Porto Carrero. Tag changes for the FileOps > fix. > From jdeville at microsoft.com Tue Feb 10 22:09:29 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 10 Feb 2009 19:09:29 -0800 Subject: [Ironruby-core] Code Review: bugfixes1 In-Reply-To: References: Message-ID: Reviewed by JSchementi via IRC > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, February 10, 2009 4:47 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: bugfixes1 > > tfpt review "/shelveset:bugfixes1;REDMOND\jdeville" > Comment : > BinaryEncoding changes to help mono compilation, thanks to M. > Letterle. Changes in FileOps to fix File.dirname (Rubyforge bugs 23669 > and 22167), thanks to Ivan Porto Carrero. Tag changes for the FileOps > fix. > From jb at nurv.fr Wed Feb 11 05:31:28 2009 From: jb at nurv.fr (Jb Evain) Date: Wed, 11 Feb 2009 11:31:28 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> Message-ID: <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> Hey, On 2/10/09, Thibaut Barr?re wrote: > Macintosh:ironruby-labs thbar$ mono Release/ir.exe -D ui/ui.rb > mscorlib:0:in `set_Fallback': Argument cannot be null. > (System::ArgumentNullException) > from mscorlib:0:in `.ctor' > from mscorlib:0:in `GetDecoder' > from mscorlib:0:in `Initialize' > from mscorlib:0:in `.ctor' > from mscorlib:0:in `.ctor' I've fixed this issue in Mono, the fix will make it in Mono 2.4. -- Jb Evain From lists at ruby-forum.com Wed Feb 11 06:27:46 2009 From: lists at ruby-forum.com (Lurker2006@gmail.com Ann) Date: Wed, 11 Feb 2009 12:27:46 +0100 Subject: [Ironruby-core] Need help building IronRuby on Mono 2 + OS X In-Reply-To: References: <4959A796.9010504@gmail.com> Message-ID: <97973dfbaec706189a27886f53b11c5b@ruby-forum.com> Hi,there are many computer ebooks free download. www.51cnnet.net -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Feb 11 06:28:49 2009 From: lists at ruby-forum.com (Lurker2006@gmail.com Ann) Date: Wed, 11 Feb 2009 12:28:49 +0100 Subject: [Ironruby-core] computer ebooks free download Message-ID: <42a715df0c577c838f3791fc4a0781ac@ruby-forum.com> Hi,there are many computer ebooks free download. www.51cnnet.net -- Posted via http://www.ruby-forum.com/. From thibaut.barrere at gmail.com Wed Feb 11 07:56:05 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 11 Feb 2009 13:56:05 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> Message-ID: <4a68b8cf0902110456p1605341ct96b44d63c4a04ba6@mail.gmail.com> Hey, thanks guys for the feedback. Jb: is it fine to use this build ? http://mono.ximian.com/monobuild/preview/download-preview/ -- Thibaut On Wed, Feb 11, 2009 at 11:31 AM, Jb Evain wrote: > Hey, > > On 2/10/09, Thibaut Barr?re wrote: > > Macintosh:ironruby-labs thbar$ mono Release/ir.exe -D ui/ui.rb > > mscorlib:0:in `set_Fallback': Argument cannot be null. > > (System::ArgumentNullException) > > from mscorlib:0:in `.ctor' > > from mscorlib:0:in `GetDecoder' > > from mscorlib:0:in `Initialize' > > from mscorlib:0:in `.ctor' > > from mscorlib:0:in `.ctor' > > I've fixed this issue in Mono, the fix will make it in Mono 2.4. > > -- > Jb Evain > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jb at nurv.fr Wed Feb 11 08:10:33 2009 From: jb at nurv.fr (Jb Evain) Date: Wed, 11 Feb 2009 14:10:33 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <4a68b8cf0902110456p1605341ct96b44d63c4a04ba6@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> <4a68b8cf0902110456p1605341ct96b44d63c4a04ba6@mail.gmail.com> Message-ID: <69f7d8470902110510q1ea91790n1a4e78532a0dd33d@mail.gmail.com> Hey, On 2/11/09, Thibaut Barr?re wrote: > thanks guys for the feedback. Jb: is it fine to use this build ? > http://mono.ximian.com/monobuild/preview/download-preview/ It should be fine. Alternatively,the mono-2-4 branch from svn should work as well, and will always be up to date. -- Jb Evain From thibaut.barrere at gmail.com Wed Feb 11 08:14:23 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 11 Feb 2009 14:14:23 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <69f7d8470902110510q1ea91790n1a4e78532a0dd33d@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> <4a68b8cf0902110456p1605341ct96b44d63c4a04ba6@mail.gmail.com> <69f7d8470902110510q1ea91790n1a4e78532a0dd33d@mail.gmail.com> Message-ID: <4a68b8cf0902110514i257b805ev348dd97ec95382dd@mail.gmail.com> Hi, just tested with the latest dmg from http://mono.ximian.com/monobuild/preview/download-preview/ I confirm it's working :) thanks Jb! -- Thibaut On Wed, Feb 11, 2009 at 2:10 PM, Jb Evain wrote: > Hey, > > On 2/11/09, Thibaut Barr?re wrote: > > thanks guys for the feedback. Jb: is it fine to use this build ? > > http://mono.ximian.com/monobuild/preview/download-preview/ > > It should be fine. Alternatively,the mono-2-4 branch from svn should > work as well, and will always be up to date. > > -- > Jb Evain > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Wed Feb 11 09:16:42 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 11 Feb 2009 15:16:42 +0100 Subject: [Ironruby-core] sharing some stuff + one question on mono In-Reply-To: <69f7d8470902110510q1ea91790n1a4e78532a0dd33d@mail.gmail.com> References: <4a68b8cf0902091648xd9e183aqec56eacf271f600c@mail.gmail.com> <69f7d8470902110231i759ea3eem56815b716aeb07f1@mail.gmail.com> <4a68b8cf0902110456p1605341ct96b44d63c4a04ba6@mail.gmail.com> <69f7d8470902110510q1ea91790n1a4e78532a0dd33d@mail.gmail.com> Message-ID: When I build mono from svn then the compression stuff seems to be improperly linked. I have no idea what I should be doing to make that link properly that way I can just keep up with the trunk version on my laptop. On Wed, Feb 11, 2009 at 2:10 PM, Jb Evain wrote: > Hey, > > On 2/11/09, Thibaut Barr?re wrote: > > thanks guys for the feedback. Jb: is it fine to use this build ? > > http://mono.ximian.com/monobuild/preview/download-preview/ > > It should be fine. Alternatively,the mono-2-4 branch from svn should > work as well, and will always be up to date. > > -- > Jb Evain > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 11 11:58:41 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 11 Feb 2009 08:58:41 -0800 Subject: [Ironruby-core] Code Review: InflateJoin Message-ID: tfpt review "/shelveset:InflateJoin;REDMOND\tomat" Comment : Fixes Zlib::Inflate#inflate and File#join. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: InflateJoin.diff Type: application/octet-stream Size: 49135 bytes Desc: InflateJoin.diff URL: From ivan at flanders.co.nz Wed Feb 11 13:28:12 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 11 Feb 2009 19:28:12 +0100 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: <000001c98a46$9ae62e50$d0b28af0$@org> References: <000001c98a46$9ae62e50$d0b28af0$@org> Message-ID: Hi Will, I'd be keen to help you with that.. If you've created a project on github please post the url so we can clone, fork and contribute :) cheers Ivan 2009/2/9 Will Green > Woops, looks like it was on the GitHub wiki, and I may have ascribed more > meaning to what is there: > http://wiki.github.com/ironruby/ironruby/libraries > > I just had this idea this morning after attending a regional Ruby > conference > (acts_as_conference). I'll get right on getting set up. > > Thanks! > > == > Will > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Sunday, February 08, 2009 5:23 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby > > Hash is mostly implemented. Can you post a link to the page where it shows > it as not done? I'll fix it. I don't know if any of the methods needed by > Rack are missing. Jimmy, have you tried this scenario? > > In the mean time, if you started down this road, we'd be happy to have your > contributions. If you haven't already, you'll need to get setup to > contribute. The instructions are on the Github wiki at: > http://wiki.github.com/ironruby/ironruby/contributing. > > > Thanks, > > JD > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Will Green > > Sent: Sunday, February 08, 2009 12:23 PM > > To: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby > > > > First, I want to say that I'm very excited by the progress of IronRuby. > > > > So, my interrest lies in getting Ruby web applications running through > > IIS 7. Specifically Rails, but also others like Sinatra and Merb, all > > of which are now built on Rack. Rack implements a new web-to- > > application protocol, based partly on Python's WSGI, which supplants > > FastCGI. > > > > I've looked, and someone has already created nWSGI on CodePlex. This > > project implements WSGI, and hosts IronPython to run the Python app. > > > > I'm thinking of taking a similar approach, but one of the key > > requirements of the Rack protocol is that the Rack application's call > > method takes exactly one param: a Ruby Hash; it cannot be a subclass. > > Reading the status at IronRuby.net, it looks like Hash is not yet > > implemented. Is this the case? > > > > I guess I'm looking to see if my project is something that can be done > > at this time, or if IronRuby needs some more help before I can attempt > > it. I'd be happy to contribute time & code to get this working. > > > > Thanks! > > > > Will Green > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Wed Feb 11 13:47:26 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 11 Feb 2009 10:47:26 -0800 Subject: [Ironruby-core] Code Review: re Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0B92CE3E@NA-EXMSG-C104.redmond.corp.microsoft.com> tfpt review "/shelveset:re;REDMOND\sborde" Comment : Fixes couple of remaining blocking bugs in re: Ruby's /(?:m)/m should map to CLR's "(?:s)" Hacky fix for /(expr){N}+/ should be treated like /(?:expr{N})+/ -------------- next part -------------- A non-text attachment was scrubbed... Name: re.diff Type: application/octet-stream Size: 7664 bytes Desc: re.diff URL: From Shri.Borde at microsoft.com Wed Feb 11 14:13:23 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 11 Feb 2009 11:13:23 -0800 Subject: [Ironruby-core] RubySpec: Exceptions in before/after get lost in output Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0B92CE96@NA-EXMSG-C104.redmond.corp.microsoft.com> core/io/close_read_spec.rb does not work on my machine because it has the following code, but I don't have "cat" on my machine. describe "IO#close_read" do before :each do @io = IO.popen 'cat', "r+" @path = tmp('io.close.txt') end However, running it does not report any errors in the final summary. There is output indicating that something went bad, but if you run all the tests together, the output scrolls past, and you won't realize it. c:\vsl\Merlin\External\Languages\IronRuby\mspec>c:\vsl\Merlin\Main\test\scripts\ir.cmd mspec\bin\mspec-run -fd --verbose --excl-tag fails --excl-tag critical --config default.mspec rubyspec/core/io/close_read_spec.rb rubyspec/core/io/close_read_spec.rb'cat' is not recognized as an internal or external command, operable program or batch file. .'cat' is not recognized as an internal or external command, operable program or batch file. . Finished in 1.738000 seconds 1 file, 2 examples, 2 expectations, 0 failures, 0 errors Shouldn't mspec report this as an error? Thanks, Shri -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Wed Feb 11 14:38:30 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 11 Feb 2009 11:38:30 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0B92CE3E@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0B92CE3E@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Test looks good. I'll also work on making the diff script include our tests in diff's so the list can see them. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday, February 11, 2009 10:47 AM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Fixes couple of remaining blocking bugs in re: Ruby's /(?:m)/m should map to CLR's "(?:s)" Hacky fix for /(expr){N}+/ should be treated like /(?:expr{N})+/ From jdeville at microsoft.com Wed Feb 11 14:43:46 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 11 Feb 2009 11:43:46 -0800 Subject: [Ironruby-core] Git push Message-ID: I have pushed TFS to Git. Just an FYI, the building where the IronRuby team is located is having a building move the rest of the week. In addition, TFS is undergoing upgrades during that time. Due to all of this, I won't push again until Monday. JD -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Wed Feb 11 23:00:09 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Wed, 11 Feb 2009 23:00:09 -0500 Subject: [Ironruby-core] IronRuby Mono/Linux Build Message-ID: Is up and running again, under integrity now: http://www.integrityapp.com The twitter should update again, but only when I push to my linux branch (for now): http://twitter.com/ironrubyci -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From will at hotgazpacho.org Wed Feb 11 23:14:58 2009 From: will at hotgazpacho.org (Will Green) Date: Wed, 11 Feb 2009 23:14:58 -0500 Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby In-Reply-To: References: <000001c98a46$9ae62e50$d0b28af0$@org> Message-ID: <001501c98cc8$77ea4740$67bed5c0$@org> Awesome. I haven?t had a chance to get started yet; very hectic at work this week. From: Ivan Porto Carrero [mailto:ivan at flanders.co.nz] Sent: Wednesday, February 11, 2009 1:28 PM To: ironruby-core Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby Hi Will, I'd be keen to help you with that.. If you've created a project on github please post the url so we can clone, fork and contribute :) cheers Ivan 2009/2/9 Will Green Woops, looks like it was on the GitHub wiki, and I may have ascribed more meaning to what is there: http://wiki.github.com/ironruby/ironruby/libraries I just had this idea this morning after attending a regional Ruby conference (acts_as_conference). I'll get right on getting set up. Thanks! == Will -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Sunday, February 08, 2009 5:23 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby Hash is mostly implemented. Can you post a link to the page where it shows it as not done? I'll fix it. I don't know if any of the methods needed by Rack are missing. Jimmy, have you tried this scenario? In the mean time, if you started down this road, we'd be happy to have your contributions. If you haven't already, you'll need to get setup to contribute. The instructions are on the Github wiki at: http://wiki.github.com/ironruby/ironruby/contributing. Thanks, JD > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Will Green > Sent: Sunday, February 08, 2009 12:23 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IIS 7 HttpModule for Rails/Rack with IronRuby > > First, I want to say that I'm very excited by the progress of IronRuby. > > So, my interrest lies in getting Ruby web applications running through > IIS 7. Specifically Rails, but also others like Sinatra and Merb, all > of which are now built on Rack. Rack implements a new web-to- > application protocol, based partly on Python's WSGI, which supplants > FastCGI. > > I've looked, and someone has already created nWSGI on CodePlex. This > project implements WSGI, and hosts IronPython to run the Python app. > > I'm thinking of taking a similar approach, but one of the key > requirements of the Rack protocol is that the Rack application's call > method takes exactly one param: a Ruby Hash; it cannot be a subclass. > Reading the status at IronRuby.net, it looks like Hash is not yet > implemented. Is this the case? > > I guess I'm looking to see if my project is something that can be done > at this time, or if IronRuby needs some more help before I can attempt > it. I'd be happy to contribute time & code to get this working. > > Thanks! > > Will Green > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.nutter at sun.com Thu Feb 12 03:39:13 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Thu, 12 Feb 2009 02:39:13 -0600 Subject: [Ironruby-core] RubySpec: Exceptions in before/after get lost in output In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0B92CE96@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0B92CE96@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <4993E031.2040806@sun.com> Shri Borde wrote: > core/io/close_read_spec.rb does not work on my machine because it has > the following code, but I don?t have ?cat? on my machine. ... > However, running it does not report any errors in the final summary. > There is output indicating that something went bad, but if you run all > the tests together, the output scrolls past, and you won?t realize it. ... > .'cat' is not recognized as an internal or external command, ... > Shouldn?t mspec report this as an error? Probably should. The problem is that popen always returns the IO streams for the subprocess, which may be cmd reporting the 'cat' error. I suppose it could be modified to one of the other popen variants that set process exit status. You should bring it up on rubyspec ML or on IRC. - Charlie From suppakilla at gmail.com Thu Feb 12 09:30:36 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Thu, 12 Feb 2009 15:30:36 +0100 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# Message-ID: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> Hi, I'm refactoring and polishing the source code of my port of json/ext to IronRuby (it's feature complete by now) but I'm wondering if there is a better way to throw an Exception defined in ruby from C# compared to the only solution I've came up with so far. Here is the code I'm using right now, stripped down of checks and condensed in one method just for the sake of brevity: ----- ruby ----- module JSON class JSONError < StandardError; end class ParserError < JSONError; end end ----- C# ----- public static void RaiseParserError(RubyScope scope, String msg) { RubyModule eParserError; scope.RubyContext.TryGetModule(scope.GlobalScope, "JSON::ParserError", out eParserError ); RubyClass exceptionClass = eParserError as RubyClass; Type underlyingType = exceptionClass.GetUnderlyingSystemType(); BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance; ConstructorInfo constructor = underlyingType.GetConstructor( bindingFlags, null, new[] { typeof(RubyClass), typeof(String) }, null ); Exception exceptionInstance = constructor.Invoke( new object[] { exceptionClass, msg } ) as Exception; throw exceptionInstance; } -- Daniele Alessandri http://www.clorophilla.net/blog/ From lists at ruby-forum.com Thu Feb 12 14:42:11 2009 From: lists at ruby-forum.com (Brandon Jones) Date: Thu, 12 Feb 2009 20:42:11 +0100 Subject: [Ironruby-core] boolean and to_clr_type Message-ID: I'm working with a windows form application using IronRuby. I'm hitting a snag when using DataSets. I have a DataColumn that I want to be a boolean. But I can't figure out how to set the DataType properly. Numerics are easy enough: self.dcScore.DataType = Fixnum.to_clr_type self.dcTime.DataType = Float.to_clr_type self.dcPlaying.DataType = ??? TrueClass and FalseClass have no CLR type (that I can see). Must I hack in integer values in place of true/false? -- Posted via http://www.ruby-forum.com/. From ivan at flanders.co.nz Thu Feb 12 16:28:00 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 12 Feb 2009 22:28:00 +0100 Subject: [Ironruby-core] boolean and to_clr_type In-Reply-To: References: Message-ID: self.dcPlaying.DataType = System::Boolean On Thu, Feb 12, 2009 at 8:42 PM, Brandon Jones wrote: > I'm working with a windows form application using IronRuby. I'm hitting > a snag when using DataSets. I have a DataColumn that I want to be a > boolean. But I can't figure out how to set the DataType properly. > Numerics are easy enough: > > self.dcScore.DataType = Fixnum.to_clr_type > self.dcTime.DataType = Float.to_clr_type > self.dcPlaying.DataType = ??? > > TrueClass and FalseClass have no CLR type (that I can see). Must I hack > in integer values in place of true/false? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Thu Feb 12 22:33:09 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 12 Feb 2009 19:33:09 -0800 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> Message-ID: Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Thursday, February 12, 2009 6:31 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# Hi, I'm refactoring and polishing the source code of my port of json/ext to IronRuby (it's feature complete by now) but I'm wondering if there is a better way to throw an Exception defined in ruby from C# compared to the only solution I've came up with so far. Here is the code I'm using right now, stripped down of checks and condensed in one method just for the sake of brevity: ----- ruby ----- module JSON class JSONError < StandardError; end class ParserError < JSONError; end end ----- C# ----- public static void RaiseParserError(RubyScope scope, String msg) { RubyModule eParserError; scope.RubyContext.TryGetModule(scope.GlobalScope, "JSON::ParserError", out eParserError ); RubyClass exceptionClass = eParserError as RubyClass; Type underlyingType = exceptionClass.GetUnderlyingSystemType(); BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance; ConstructorInfo constructor = underlyingType.GetConstructor( bindingFlags, null, new[] { typeof(RubyClass), typeof(String) }, null ); Exception exceptionInstance = constructor.Invoke( new object[] { exceptionClass, msg } ) as Exception; throw exceptionInstance; } -- Daniele Alessandri http://www.clorophilla.net/blog/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From suppakilla at gmail.com Fri Feb 13 02:59:19 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Fri, 13 Feb 2009 08:59:19 +0100 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> Message-ID: <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> Yes it is meant to be used primarily from ruby as it is a port of a rather widespread library, and a dependency for a bunch of other libraries (see http://json.rubyforge.org/). The reason is simply to maintain compatibility with the ruby bits of the original json library in which exceptions are defined inside a common.rb file: this is due to the fact that this lib comes in two flavours, json-pure (everything is ruby) and json-ext (the generator and parser are implemented in C, the rest is ruby), so there are parts of the code that are shared between the two and eventually invoked from within the native code. Anyway I'm curious, I haven't found other means to do that in a much cleaner way :) On Fri, Feb 13, 2009 at 04:33, Tomas Matousek wrote: > Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 6:31 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Hi, > > I'm refactoring and polishing the source code of my port of json/ext > to IronRuby (it's feature complete by now) but I'm wondering if there > is a better way to throw an Exception defined in ruby from C# compared > to the only solution I've came up with so far. Here is the code I'm > using right now, stripped down of checks and condensed in one method > just for the sake of brevity: > > ----- ruby ----- > > module JSON > class JSONError < StandardError; end > class ParserError < JSONError; end > end > > ----- C# ----- > > public static void RaiseParserError(RubyScope scope, String msg) { > RubyModule eParserError; > > scope.RubyContext.TryGetModule(scope.GlobalScope, > "JSON::ParserError", > out eParserError > ); > > RubyClass exceptionClass = eParserError as RubyClass; > Type underlyingType = exceptionClass.GetUnderlyingSystemType(); > > BindingFlags bindingFlags = BindingFlags.NonPublic | > BindingFlags.Public | > BindingFlags.Instance; > > ConstructorInfo constructor = underlyingType.GetConstructor( > bindingFlags, > null, > new[] { typeof(RubyClass), typeof(String) }, > null > ); > > Exception exceptionInstance = constructor.Invoke( > new object[] { exceptionClass, msg } > ) as Exception; > > throw exceptionInstance; > } > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ From lists at ruby-forum.com Fri Feb 13 08:19:48 2009 From: lists at ruby-forum.com (Brandon Jones) Date: Fri, 13 Feb 2009 14:19:48 +0100 Subject: [Ironruby-core] boolean and to_clr_type In-Reply-To: References: Message-ID: Well now I feel dumb :p -- Posted via http://www.ruby-forum.com/. From bacondarwin at googlemail.com Fri Feb 13 09:13:13 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Fri, 13 Feb 2009 14:13:13 -0000 Subject: [Ironruby-core] Incorrect library paths in App.Config Message-ID: <002201c98de5$35ada750$a108f5f0$@com> Hi, I just noticed that the App.Config that is generated in an in Unsigned build of IronRuby (i.e. rake compile) contains incorrect library paths. When I tried to run rake mspec:core it failed to require 'fileutils'. Currently (Git commit 6855c7c41ee2...) has the following in Merlin/Main/Config/Unsigned/App.Config: But the repository has the following folder layout: Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 And Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby So therefore this file should look like this: I thought I must be wrong since this should have been picked up already but then I guess that most people who are building IR at the moment are either inside MSFT (and using signed builds) or running on Mono and having to rewrite this file anyway. Am I right here? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Fri Feb 13 10:53:41 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 13 Feb 2009 16:53:41 +0100 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: <002201c98de5$35ada750$a108f5f0$@com> References: <002201c98de5$35ada750$a108f5f0$@com> Message-ID: I think so.. I actually have an app.config.mine that I use to keep the paths correct. On Fri, Feb 13, 2009 at 3:13 PM, Pete Bacon Darwin < bacondarwin at googlemail.com> wrote: > Hi, > > > > I just noticed that the App.Config that is generated in an in Unsigned > build of IronRuby (i.e. rake compile) contains incorrect library paths. > When I tried to run rake mspec:core it failed to require 'fileutils'. > > > > Currently (Git commit 6855c7c41ee2...) has the following in > Merlin/Main/Config/Unsigned/App.Config: > > > > value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" > /> > > > > But the repository has the following folder layout: > > > > Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 > > And > > Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby > > > > So therefore this file should look like this: > > > > value='..\..\Languages\Ruby\libs;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby\1.8;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby;..\..\..\External\Languages\Ruby\redist-libs\ruby\1.8'/> > > > > I thought I must be wrong since this should have been picked up already but > then I guess that most people who are building IR at the moment are either > inside MSFT (and using signed builds) or running on Mono and having to > rewrite this file anyway. > > > > Am I right here? > > > > Pete > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Fri Feb 13 11:27:52 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 13 Feb 2009 17:27:52 +0100 Subject: [Ironruby-core] revised package.rake Message-ID: Hi, In my mono branch I use the following package task. It allows me to package up IronRuby and control the search paths. The problem with the previous task was that it shelled out to windows with windows specific commands. This made it fail on my mac of course. The code comes with no other guarantees except that it works on my machine I didn't fix the zip part because I'm not really interested in an archive, I've got the source ;) # **************************************************************************** # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Microsoft Public License. A # copy of the license can be found in the License.html file at the root of this distribution. If # you cannot locate the Microsoft Public License, please send an email to # ironruby at microsoft.com. By using this source code in any fashion, you are agreeing to be bound # by the terms of the Microsoft Public License. # # You must not remove this notice, or any other, from this software. # # # **************************************************************************** PACKAGE_DIR = File.expand_path(File.dirname(__FILE__) + '/../../../../../dist/') # directory that binary package is created in MERLIN_ROOT = File.expand_path(File.dirname(__FILE__) + '/../../..') BUILD_BIN = "#{MERLIN_ROOT}/bin/#{'mono_' if mono?}debug" desc "Generate an IronRuby binary redist package from the layout" task :package do # Directory layouts FileUtils.remove_dir(PACKAGE_DIR, true) if File.exist? PACKAGE_DIR FileUtils.mkdir_p "#{PACKAGE_DIR}/bin" # Copy Licenses FileUtils.cp Dir.glob("#{MERLIN_ROOT}/Languages/Ruby/Licenses/*"), PACKAGE_DIR # Copy binaries FileUtils.cp "#{MERLIN_ROOT}/app.config", "#{PACKAGE_DIR}/bin/ir.exe.config" FileUtils.cp "#{BUILD_BIN}/ir.exe", "#{PACKAGE_DIR}/bin/" FileUtils.cp Dir.glob("#{BUILD_BIN}/IronRuby*.dll"), "#{PACKAGE_DIR}/bin" FileUtils.cp "#{BUILD_BIN}/Microsoft.Scripting.Core.dll", "#{PACKAGE_DIR}/bin" FileUtils.cp "#{BUILD_BIN}/Microsoft.Scripting.dll", "#{PACKAGE_DIR}/bin" FileUtils.cp Dir.glob("#{MERLIN_ROOT}/Languages/Ruby/Scripts/bin/*"), "#{PACKAGE_DIR}/bin" # Generate ir.exe.config IronRubyCompiler.transform_config_file 'Binary', project_root + 'app.config.mono', "#{PACKAGE_DIR}/bin/ir.exe.config" # Copy standard library FileUtils.mkdir_p "#{PACKAGE_DIR}/lib/ruby" unless File.exist? "#{PACKAGE_DIR}/lib/ruby" FileUtils.cp_r "#{MERLIN_ROOT}/../External/Languages/Ruby/redist-libs/ruby", "#{PACKAGE_DIR}/lib/ruby" FileUtils.cp_r "#{MERLIN_ROOT}/Languages/Ruby/Libs", "#{PACKAGE_DIR}/lib/ironruby" # Generate compressed package if ENV['ZIP'] system %Q{del "#{ENV['TEMP']}\\ironruby.7z"} system %Q{"#{ENV['PROGRAM_FILES_32']}/7-Zip/7z.exe" a -bd -t7z -mx9 "#{ENV['TEMP']}\\ironruby.7z" "#{PACKAGE_DIR}\\"} system %Q{"#{ENV['PROGRAM_FILES_32']}/7-Zip/7z.exe" a -bd -tzip -mx9 "c:\\ironruby.zip" "#{PACKAGE_DIR}\\"} system %Q{copy /b /Y "#{ENV['PROGRAM_FILES_32']}\\7-Zip\\7zSD.sfx" + "#{ENV['MERLIN_ROOT']}\\Languages\\Ruby\\sfx_config.txt" + "#{ENV['TEMP']}\\ironruby.7z" "c:\\ironruby.exe"} end end -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Fri Feb 13 11:35:58 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 13 Feb 2009 17:35:58 +0100 Subject: [Ironruby-core] Scratch that task.. some file paths have changed Message-ID: That package task was what worked earlier this week. It looks like some of the paths have changed.. I'll fix it and update my repo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Fri Feb 13 11:56:49 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 13 Feb 2009 08:56:49 -0800 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: <002201c98de5$35ada750$a108f5f0$@com> References: <002201c98de5$35ada750$a108f5f0$@com> Message-ID: Yep, you're right. Will fix App.config by the next GIT push. BTW: What changes are needed for Mono? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Friday, February 13, 2009 6:13 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Incorrect library paths in App.Config Hi, I just noticed that the App.Config that is generated in an in Unsigned build of IronRuby (i.e. rake compile) contains incorrect library paths. When I tried to run rake mspec:core it failed to require 'fileutils'. Currently (Git commit 6855c7c41ee2...) has the following in Merlin/Main/Config/Unsigned/App.Config: But the repository has the following folder layout: Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 And Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby So therefore this file should look like this: I thought I must be wrong since this should have been picked up already but then I guess that most people who are building IR at the moment are either inside MSFT (and using signed builds) or running on Mono and having to rewrite this file anyway. Am I right here? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Fri Feb 13 12:55:34 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Fri, 13 Feb 2009 09:55:34 -0800 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> I don't think your code below will work as multiple Ruby types share the same underlying CLR type. If you want to do things in a strongly-bound way, you would need to use the RubyUtils and other runtime helpers to find the method "new", invoke it, etc. instead of using System.Reflection. An alternative is to just do an eval. Something like: RubyUtils.Evaluate("raise JSONError", scope) -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Thursday, February 12, 2009 11:59 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# Yes it is meant to be used primarily from ruby as it is a port of a rather widespread library, and a dependency for a bunch of other libraries (see http://json.rubyforge.org/). The reason is simply to maintain compatibility with the ruby bits of the original json library in which exceptions are defined inside a common.rb file: this is due to the fact that this lib comes in two flavours, json-pure (everything is ruby) and json-ext (the generator and parser are implemented in C, the rest is ruby), so there are parts of the code that are shared between the two and eventually invoked from within the native code. Anyway I'm curious, I haven't found other means to do that in a much cleaner way :) On Fri, Feb 13, 2009 at 04:33, Tomas Matousek wrote: > Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 6:31 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Hi, > > I'm refactoring and polishing the source code of my port of json/ext > to IronRuby (it's feature complete by now) but I'm wondering if there > is a better way to throw an Exception defined in ruby from C# compared > to the only solution I've came up with so far. Here is the code I'm > using right now, stripped down of checks and condensed in one method > just for the sake of brevity: > > ----- ruby ----- > > module JSON > class JSONError < StandardError; end > class ParserError < JSONError; end > end > > ----- C# ----- > > public static void RaiseParserError(RubyScope scope, String msg) { > RubyModule eParserError; > > scope.RubyContext.TryGetModule(scope.GlobalScope, > "JSON::ParserError", > out eParserError > ); > > RubyClass exceptionClass = eParserError as RubyClass; > Type underlyingType = exceptionClass.GetUnderlyingSystemType(); > > BindingFlags bindingFlags = BindingFlags.NonPublic | > BindingFlags.Public | > BindingFlags.Instance; > > ConstructorInfo constructor = underlyingType.GetConstructor( > bindingFlags, > null, > new[] { typeof(RubyClass), typeof(String) }, > null > ); > > Exception exceptionInstance = constructor.Invoke( > new object[] { exceptionClass, msg } > ) as Exception; > > throw exceptionInstance; > } > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Fri Feb 13 13:34:31 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 13 Feb 2009 10:34:31 -0800 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: You can use KernelOps.RaiseException: public static void RaiseException(RespondToStorage/*!*/ respondToStorage, UnaryOpStorage/*!*/ storage0, BinaryOpStorage/*!*/ storage1, RubyContext/*!*/ context, object self, object/*!*/ obj, [Optional]object arg, [Optional]RubyArray backtrace) { You'll need to allocate local site storages to do so. The storages are allocated automatically for methods called from Ruby. I assume you have some entry point to the C# part of the parser that you call from Ruby. That method should declare the storages and pass them thru to the place where you want to raise the exception. It might be easier to change your C# implementation not to throw Ruby exceptions. You can throw a C# exception, catch it in Ruby and rethrow the corresponding Ruby exception. This way your C# code would be usable from C# apps as well, not only from Ruby code. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Friday, February 13, 2009 9:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# I don't think your code below will work as multiple Ruby types share the same underlying CLR type. If you want to do things in a strongly-bound way, you would need to use the RubyUtils and other runtime helpers to find the method "new", invoke it, etc. instead of using System.Reflection. An alternative is to just do an eval. Something like: RubyUtils.Evaluate("raise JSONError", scope) -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Thursday, February 12, 2009 11:59 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# Yes it is meant to be used primarily from ruby as it is a port of a rather widespread library, and a dependency for a bunch of other libraries (see http://json.rubyforge.org/). The reason is simply to maintain compatibility with the ruby bits of the original json library in which exceptions are defined inside a common.rb file: this is due to the fact that this lib comes in two flavours, json-pure (everything is ruby) and json-ext (the generator and parser are implemented in C, the rest is ruby), so there are parts of the code that are shared between the two and eventually invoked from within the native code. Anyway I'm curious, I haven't found other means to do that in a much cleaner way :) On Fri, Feb 13, 2009 at 04:33, Tomas Matousek wrote: > Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 6:31 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Hi, > > I'm refactoring and polishing the source code of my port of json/ext > to IronRuby (it's feature complete by now) but I'm wondering if there > is a better way to throw an Exception defined in ruby from C# compared > to the only solution I've came up with so far. Here is the code I'm > using right now, stripped down of checks and condensed in one method > just for the sake of brevity: > > ----- ruby ----- > > module JSON > class JSONError < StandardError; end > class ParserError < JSONError; end > end > > ----- C# ----- > > public static void RaiseParserError(RubyScope scope, String msg) { > RubyModule eParserError; > > scope.RubyContext.TryGetModule(scope.GlobalScope, > "JSON::ParserError", > out eParserError > ); > > RubyClass exceptionClass = eParserError as RubyClass; > Type underlyingType = exceptionClass.GetUnderlyingSystemType(); > > BindingFlags bindingFlags = BindingFlags.NonPublic | > BindingFlags.Public | > BindingFlags.Instance; > > ConstructorInfo constructor = underlyingType.GetConstructor( > bindingFlags, > null, > new[] { typeof(RubyClass), typeof(String) }, > null > ); > > Exception exceptionInstance = constructor.Invoke( > new object[] { exceptionClass, msg } > ) as Exception; > > throw exceptionInstance; > } > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From bacondarwin at googlemail.com Fri Feb 13 13:51:42 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Fri, 13 Feb 2009 18:51:42 -0000 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: References: <002201c98de5$35ada750$a108f5f0$@com> Message-ID: <006301c98e0c$1d347a60$579d6f20$@com> Actually I guess that since all the paths are relative, the shouldn't need to be changed. I think I was assuming that mono users would automatically create their own App.config anyway, as a matter of course. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Friday,13 February 13, 2009 16:57 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Incorrect library paths in App.Config Yep, you're right. Will fix App.config by the next GIT push. BTW: What changes are needed for Mono? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Friday, February 13, 2009 6:13 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Incorrect library paths in App.Config Hi, I just noticed that the App.Config that is generated in an in Unsigned build of IronRuby (i.e. rake compile) contains incorrect library paths. When I tried to run rake mspec:core it failed to require 'fileutils'. Currently (Git commit 6855c7c41ee2...) has the following in Merlin/Main/Config/Unsigned/App.Config: But the repository has the following folder layout: Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 And Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby So therefore this file should look like this: I thought I must be wrong since this should have been picked up already but then I guess that most people who are building IR at the moment are either inside MSFT (and using signed builds) or running on Mono and having to rewrite this file anyway. Am I right here? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Fri Feb 13 13:57:51 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Fri, 13 Feb 2009 18:57:51 -0000 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <006801c98e0c$f8db6790$ea9236b0$@com> Could you not achieve the wanted effect through a kind of monkey patching? I.E. Create the exception class in C# then redeclare it in the common.rb. The new class in Ruby would extend the one created in C# but wouldn't change anything if the C# one was there in the first place. If it was there, i.e. you were using the pure Ruby version, then it would just be creating it for the first time. No harm done. Off the top of my head, I haven't thought hard about this or tried it... There are probably issues of order declaration or something. Pete From Shri.Borde at microsoft.com Fri Feb 13 14:12:38 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Fri, 13 Feb 2009 11:12:38 -0800 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0BE07003@NA-EXMSG-C104.redmond.corp.microsoft.com> Yes, the approach of throwing a C# exception and converting it to a Ruby exception is ideal as it preserves good layering and allows more code reuse (since the C# code could be used by IronPython, C#, VB.Net, etc). -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Friday, February 13, 2009 10:35 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# You can use KernelOps.RaiseException: public static void RaiseException(RespondToStorage/*!*/ respondToStorage, UnaryOpStorage/*!*/ storage0, BinaryOpStorage/*!*/ storage1, RubyContext/*!*/ context, object self, object/*!*/ obj, [Optional]object arg, [Optional]RubyArray backtrace) { You'll need to allocate local site storages to do so. The storages are allocated automatically for methods called from Ruby. I assume you have some entry point to the C# part of the parser that you call from Ruby. That method should declare the storages and pass them thru to the place where you want to raise the exception. It might be easier to change your C# implementation not to throw Ruby exceptions. You can throw a C# exception, catch it in Ruby and rethrow the corresponding Ruby exception. This way your C# code would be usable from C# apps as well, not only from Ruby code. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Friday, February 13, 2009 9:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# I don't think your code below will work as multiple Ruby types share the same underlying CLR type. If you want to do things in a strongly-bound way, you would need to use the RubyUtils and other runtime helpers to find the method "new", invoke it, etc. instead of using System.Reflection. An alternative is to just do an eval. Something like: RubyUtils.Evaluate("raise JSONError", scope) -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Thursday, February 12, 2009 11:59 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# Yes it is meant to be used primarily from ruby as it is a port of a rather widespread library, and a dependency for a bunch of other libraries (see http://json.rubyforge.org/). The reason is simply to maintain compatibility with the ruby bits of the original json library in which exceptions are defined inside a common.rb file: this is due to the fact that this lib comes in two flavours, json-pure (everything is ruby) and json-ext (the generator and parser are implemented in C, the rest is ruby), so there are parts of the code that are shared between the two and eventually invoked from within the native code. Anyway I'm curious, I haven't found other means to do that in a much cleaner way :) On Fri, Feb 13, 2009 at 04:33, Tomas Matousek wrote: > Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 6:31 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Hi, > > I'm refactoring and polishing the source code of my port of json/ext > to IronRuby (it's feature complete by now) but I'm wondering if there > is a better way to throw an Exception defined in ruby from C# compared > to the only solution I've came up with so far. Here is the code I'm > using right now, stripped down of checks and condensed in one method > just for the sake of brevity: > > ----- ruby ----- > > module JSON > class JSONError < StandardError; end > class ParserError < JSONError; end > end > > ----- C# ----- > > public static void RaiseParserError(RubyScope scope, String msg) { > RubyModule eParserError; > > scope.RubyContext.TryGetModule(scope.GlobalScope, > "JSON::ParserError", > out eParserError > ); > > RubyClass exceptionClass = eParserError as RubyClass; > Type underlyingType = exceptionClass.GetUnderlyingSystemType(); > > BindingFlags bindingFlags = BindingFlags.NonPublic | > BindingFlags.Public | > BindingFlags.Instance; > > ConstructorInfo constructor = underlyingType.GetConstructor( > bindingFlags, > null, > new[] { typeof(RubyClass), typeof(String) }, > null > ); > > Exception exceptionInstance = constructor.Invoke( > new object[] { exceptionClass, msg } > ) as Exception; > > throw exceptionInstance; > } > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From ivan at flanders.co.nz Fri Feb 13 14:13:46 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 13 Feb 2009 20:13:46 +0100 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: References: <002201c98de5$35ada750$a108f5f0$@com> Message-ID: This is from my app.config.mono On Fri, Feb 13, 2009 at 5:56 PM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote: > Yep, you're right. Will fix App.config by the next GIT push. > > BTW: What changes are needed for Mono? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Pete Bacon Darwin > *Sent:* Friday, February 13, 2009 6:13 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Incorrect library paths in App.Config > > > > Hi, > > > > I just noticed that the App.Config that is generated in an in Unsigned > build of IronRuby (i.e. rake compile) contains incorrect library paths. > When I tried to run rake mspec:core it failed to require 'fileutils'. > > > > Currently (Git commit 6855c7c41ee2...) has the following in > Merlin/Main/Config/Unsigned/App.Config: > > > > value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" > /> > > > > But the repository has the following folder layout: > > > > Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 > > And > > Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby > > > > So therefore this file should look like this: > > > > value='..\..\Languages\Ruby\libs;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby\1.8;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby;..\..\..\External\Languages\Ruby\redist-libs\ruby\1.8'/> > > > > I thought I must be wrong since this should have been picked up already but > then I guess that most people who are building IR at the moment are either > inside MSFT (and using signed builds) or running on Mono and having to > rewrite this file anyway. > > > > Am I right here? > > > > Pete > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From suppakilla at gmail.com Fri Feb 13 15:36:01 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Fri, 13 Feb 2009 21:36:01 +0100 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <3bf20550902131236u7e5c9ec8u2198958b6bd8f653@mail.gmail.com> Yeah, I don't really like my solution exactly because it is dependent on the underlying type. By the way I already tried to call JSON::ParserError#new from C# to get an instance of the class and it actually worked, but then the exception was getting thrown with an empty stack trace (well I can guess the reason for that and it is not something unexpected). On Fri, Feb 13, 2009 at 18:55, Shri Borde wrote: > I don't think your code below will work as multiple Ruby types share the same underlying CLR type. If you want to do things in a strongly-bound way, you would need to use the RubyUtils and other runtime helpers to find the method "new", invoke it, etc. instead of using System.Reflection. > > An alternative is to just do an eval. Something like: > RubyUtils.Evaluate("raise JSONError", scope) > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 11:59 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Yes it is meant to be used primarily from ruby as it is a port of a > rather widespread library, and a dependency for a bunch of other > libraries (see http://json.rubyforge.org/). > > The reason is simply to maintain compatibility with the ruby bits of > the original json library in which exceptions are defined inside a > common.rb file: this is due to the fact that this lib comes in two > flavours, json-pure (everything is ruby) and json-ext (the generator > and parser are implemented in C, the rest is ruby), so there are parts > of the code that are shared between the two and eventually invoked > from within the native code. > > Anyway I'm curious, I haven't found other means to do that in a much > cleaner way :) > > > On Fri, Feb 13, 2009 at 04:33, Tomas Matousek > wrote: >> Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? >> >> Tomas >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri >> Sent: Thursday, February 12, 2009 6:31 AM >> To: ironruby-core at rubyforge.org >> Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# >> >> Hi, >> >> I'm refactoring and polishing the source code of my port of json/ext >> to IronRuby (it's feature complete by now) but I'm wondering if there >> is a better way to throw an Exception defined in ruby from C# compared >> to the only solution I've came up with so far. Here is the code I'm >> using right now, stripped down of checks and condensed in one method >> just for the sake of brevity: >> >> ----- ruby ----- >> >> module JSON >> class JSONError < StandardError; end >> class ParserError < JSONError; end >> end >> >> ----- C# ----- >> >> public static void RaiseParserError(RubyScope scope, String msg) { >> RubyModule eParserError; >> >> scope.RubyContext.TryGetModule(scope.GlobalScope, >> "JSON::ParserError", >> out eParserError >> ); >> >> RubyClass exceptionClass = eParserError as RubyClass; >> Type underlyingType = exceptionClass.GetUnderlyingSystemType(); >> >> BindingFlags bindingFlags = BindingFlags.NonPublic | >> BindingFlags.Public | >> BindingFlags.Instance; >> >> ConstructorInfo constructor = underlyingType.GetConstructor( >> bindingFlags, >> null, >> new[] { typeof(RubyClass), typeof(String) }, >> null >> ); >> >> Exception exceptionInstance = constructor.Invoke( >> new object[] { exceptionClass, msg } >> ) as Exception; >> >> throw exceptionInstance; >> } >> >> >> -- >> Daniele Alessandri >> http://www.clorophilla.net/blog/ >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ From suppakilla at gmail.com Fri Feb 13 15:51:13 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Fri, 13 Feb 2009 21:51:13 +0100 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <3bf20550902131251s67a8c346mf0d9b28bb13f282a@mail.gmail.com> I will try going with this solution, thanks. As for the reusability of the code from other applications/languages, I think it would be something impossibile to begin with as the library is tightly coupled with ruby (especially the generator class, it interacts a lot with ruby code) and this is due to an intrinsic factor of its conceptual design (which goes back to the original implementation) and IMHO it is not really a matter of bad design choices. On Fri, Feb 13, 2009 at 19:34, Tomas Matousek wrote: > You can use KernelOps.RaiseException: > > public static void RaiseException(RespondToStorage/*!*/ respondToStorage, UnaryOpStorage/*!*/ storage0, BinaryOpStorage/*!*/ storage1, > RubyContext/*!*/ context, object self, object/*!*/ obj, [Optional]object arg, [Optional]RubyArray backtrace) { > > > You'll need to allocate local site storages to do so. The storages are allocated automatically for methods called from Ruby. > I assume you have some entry point to the C# part of the parser that you call from Ruby. That method should declare the storages and pass them thru to the place where you want to raise the exception. > > It might be easier to change your C# implementation not to throw Ruby exceptions. You can throw a C# exception, catch it in Ruby and rethrow the corresponding Ruby exception. This way your C# code would be usable from C# apps as well, not only from Ruby code. > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Friday, February 13, 2009 9:56 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > I don't think your code below will work as multiple Ruby types share the same underlying CLR type. If you want to do things in a strongly-bound way, you would need to use the RubyUtils and other runtime helpers to find the method "new", invoke it, etc. instead of using System.Reflection. > > An alternative is to just do an eval. Something like: > RubyUtils.Evaluate("raise JSONError", scope) > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Thursday, February 12, 2009 11:59 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Throwing Exceptions defined in Ruby from C# > > Yes it is meant to be used primarily from ruby as it is a port of a > rather widespread library, and a dependency for a bunch of other > libraries (see http://json.rubyforge.org/). > > The reason is simply to maintain compatibility with the ruby bits of > the original json library in which exceptions are defined inside a > common.rb file: this is due to the fact that this lib comes in two > flavours, json-pure (everything is ruby) and json-ext (the generator > and parser are implemented in C, the rest is ruby), so there are parts > of the code that are shared between the two and eventually invoked > from within the native code. > > Anyway I'm curious, I haven't found other means to do that in a much > cleaner way :) > > > On Fri, Feb 13, 2009 at 04:33, Tomas Matousek > wrote: >> Why don't you declare the exceptions in C#? I assume the library is primarily to be used from Ruby code, not from C#, right? >> >> Tomas >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri >> Sent: Thursday, February 12, 2009 6:31 AM >> To: ironruby-core at rubyforge.org >> Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# >> >> Hi, >> >> I'm refactoring and polishing the source code of my port of json/ext >> to IronRuby (it's feature complete by now) but I'm wondering if there >> is a better way to throw an Exception defined in ruby from C# compared >> to the only solution I've came up with so far. Here is the code I'm >> using right now, stripped down of checks and condensed in one method >> just for the sake of brevity: >> >> ----- ruby ----- >> >> module JSON >> class JSONError < StandardError; end >> class ParserError < JSONError; end >> end >> >> ----- C# ----- >> >> public static void RaiseParserError(RubyScope scope, String msg) { >> RubyModule eParserError; >> >> scope.RubyContext.TryGetModule(scope.GlobalScope, >> "JSON::ParserError", >> out eParserError >> ); >> >> RubyClass exceptionClass = eParserError as RubyClass; >> Type underlyingType = exceptionClass.GetUnderlyingSystemType(); >> >> BindingFlags bindingFlags = BindingFlags.NonPublic | >> BindingFlags.Public | >> BindingFlags.Instance; >> >> ConstructorInfo constructor = underlyingType.GetConstructor( >> bindingFlags, >> null, >> new[] { typeof(RubyClass), typeof(String) }, >> null >> ); >> >> Exception exceptionInstance = constructor.Invoke( >> new object[] { exceptionClass, msg } >> ) as Exception; >> >> throw exceptionInstance; >> } >> >> >> -- >> Daniele Alessandri >> http://www.clorophilla.net/blog/ >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ From suppakilla at gmail.com Fri Feb 13 15:54:03 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Fri, 13 Feb 2009 21:54:03 +0100 Subject: [Ironruby-core] Throwing Exceptions defined in Ruby from C# In-Reply-To: <006801c98e0c$f8db6790$ea9236b0$@com> References: <3bf20550902120630n7c59189fydb55fbdb5d0d8eca@mail.gmail.com> <3bf20550902122359v58106e1cu1182e365c525cea7@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E0BE06F52@NA-EXMSG-C104.redmond.corp.microsoft.com> <006801c98e0c$f8db6790$ea9236b0$@com> Message-ID: <3bf20550902131254i74d8b0d5ye4dbf63a79df230e@mail.gmail.com> I might try that just out of curiosity to see how it behaves, even though (honestly) I don't find it too much of a clean solution. Thanks! On Fri, Feb 13, 2009 at 19:57, Pete Bacon Darwin wrote: > Could you not achieve the wanted effect through a kind of monkey patching? > I.E. Create the exception class in C# then redeclare it in the common.rb. > The new class in Ruby would extend the one created in C# but wouldn't change > anything if the C# one was there in the first place. If it was there, i.e. > you were using the pure Ruby version, then it would just be creating it for > the first time. No harm done. > Off the top of my head, I haven't thought hard about this or tried it... > There are probably issues of order declaration or something. > Pete > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ From Shri.Borde at microsoft.com Fri Feb 13 18:01:19 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Fri, 13 Feb 2009 15:01:19 -0800 Subject: [Ironruby-core] $KCODE and encodings Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> I was searching for string encoding issues in Ruby. Here is the summary of what I learnt, in case its useful to anyone else of if anyone has any corrections to this. Ruby 1.8 support for encoding: * A comment like "# -*- coding: utf-8 -*-" at the start of the file is supposed to determine how to parse a .rb file, but I haven't really figured out how to make this work. Non-ansi characters cause an error while loading the file. * ruby.exe -K sets $KCODE (which can also be set programmaticaly) * $KCODE affects the following: * Determines the encoding to use to parse .rb files. Normally, identifiers have to be ANSI, but the limitation is removed if $KCODE is set to "UTF8". * Affects whether inspect escapes non-ascii chars, or if it leaves them as is. * Affects how regexps without an explicit encoding interpret the input string. Ruby 1.9 support for encodings: * Identifiers can be non-ANSI by default. Ruby 2.0 support for encodings: * Each string and symbol knows its own encoding, and String#force_encoding can change the encoding of an existing string. * IO#encoding to control encoding to use for reading/writing from disk -------------- next part -------------- An HTML attachment was scrubbed... URL: From diakopter at gmail.com Fri Feb 13 20:10:51 2009 From: diakopter at gmail.com (Matthew Wilson) Date: Fri, 13 Feb 2009 19:10:51 -0600 Subject: [Ironruby-core] $KCODE and encodings In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: On Fri, Feb 13, 2009 at 5:01 PM, Shri Borde wrote: > > Ruby 1.8 support for encoding: > > ? A comment like "# -*- coding: utf-8 -*-" at the start of the > file is supposed to determine how to parse a .rb file, but I haven't really > figured out how to make this work. Non-ansi characters cause an error while > loading the file. > Did the utf-8 file(s) you tried have a BOM or not? -Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Fri Feb 13 20:22:48 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Fri, 13 Feb 2009 17:22:48 -0800 Subject: [Ironruby-core] $KCODE and encodings In-Reply-To: References: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0BE072BB@NA-EXMSG-C104.redmond.corp.microsoft.com> If I use Notepad2's menu to set the encoding to "UTF8 with signature", and run either "ruby utf8_with_signature.rb" or "ruby -Ku utf8_with_signature.rb", the file fails to parse. The file is attached. If I save the file with encoding set just as "UTF8", the file is 3 bytes smaller. "ruby utf8.rb" fails, but "ruby -Ku utf8.rb" works. With "-Ku", things work even if I do not have "# -*- coding: utf-8 -*-" in the file. The repro files are attached. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Matthew Wilson Sent: Friday, February 13, 2009 5:11 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] $KCODE and encodings On Fri, Feb 13, 2009 at 5:01 PM, Shri Borde > wrote: Ruby 1.8 support for encoding: * A comment like "# -*- coding: utf-8 -*-" at the start of the file is supposed to determine how to parse a .rb file, but I haven't really figured out how to make this work. Non-ansi characters cause an error while loading the file. Did the utf-8 file(s) you tried have a BOM or not? -Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: utf8_with_signature.rb Type: application/octet-stream Size: 45 bytes Desc: utf8_with_signature.rb URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: utf8.rb Type: application/octet-stream Size: 42 bytes Desc: utf8.rb URL: From Tomas.Matousek at microsoft.com Fri Feb 13 21:40:57 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 13 Feb 2009 18:40:57 -0800 Subject: [Ironruby-core] $KCODE and encodings In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0BE07203@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: AFAIK Ruby 1.8 doesn't support magic comments that specify encodings at all, 1.9 does. Ruby 1.8 also doesn't recognize BOM. Even version 1.9 has full encoding support, not just 2.0. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Friday, February 13, 2009 3:01 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] $KCODE and encodings I was searching for string encoding issues in Ruby. Here is the summary of what I learnt, in case its useful to anyone else of if anyone has any corrections to this. Ruby 1.8 support for encoding: * A comment like "# -*- coding: utf-8 -*-" at the start of the file is supposed to determine how to parse a .rb file, but I haven't really figured out how to make this work. Non-ansi characters cause an error while loading the file. * ruby.exe -K sets $KCODE (which can also be set programmaticaly) * $KCODE affects the following: * Determines the encoding to use to parse .rb files. Normally, identifiers have to be ANSI, but the limitation is removed if $KCODE is set to "UTF8". * Affects whether inspect escapes non-ascii chars, or if it leaves them as is. * Affects how regexps without an explicit encoding interpret the input string. Ruby 1.9 support for encodings: * Identifiers can be non-ANSI by default. Ruby 2.0 support for encodings: * Each string and symbol knows its own encoding, and String#force_encoding can change the encoding of an existing string. * IO#encoding to control encoding to use for reading/writing from disk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Sun Feb 15 09:03:32 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Sun, 15 Feb 2009 14:03:32 -0000 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: References: <002201c98de5$35ada750$a108f5f0$@com> Message-ID: <00af01c98f76$309c91d0$91d5b570$@com> Actually the offending bit is actually hard coded into context.rb!! def transform_config_file(configuration, source_path, target_build_path) # signing is on for IronRuby in Merlin, off for SVN and Binary layout = {'Merlin' => { :signing => false, :LibraryPaths => '..\..\Languages\Ruby\libs;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\r uby\site_ruby\1.8;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\ruby\site_ ruby;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\ruby\1.8' }, 'Binary' => { :signing => true, :LibraryPaths => '..\lib\IronRuby;..\lib\ruby\site_ruby\1.8;..\lib\ruby\site_ruby;..\lib\ruby \1.8' } } transform_config source_path, target_build_path, layout[configuration][:LibraryPaths] end Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Friday,13 February 13, 2009 16:57 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Incorrect library paths in App.Config Yep, you're right. Will fix App.config by the next GIT push. BTW: What changes are needed for Mono? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Friday, February 13, 2009 6:13 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Incorrect library paths in App.Config Hi, I just noticed that the App.Config that is generated in an in Unsigned build of IronRuby (i.e. rake compile) contains incorrect library paths. When I tried to run rake mspec:core it failed to require 'fileutils'. Currently (Git commit 6855c7c41ee2...) has the following in Merlin/Main/Config/Unsigned/App.Config: But the repository has the following folder layout: Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 And Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby So therefore this file should look like this: I thought I must be wrong since this should have been picked up already but then I guess that most people who are building IR at the moment are either inside MSFT (and using signed builds) or running on Mono and having to rewrite this file anyway. Am I right here? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Sun Feb 15 09:29:01 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 15 Feb 2009 15:29:01 +0100 Subject: [Ironruby-core] Incorrect library paths in App.Config In-Reply-To: <00af01c98f76$309c91d0$91d5b570$@com> References: <002201c98de5$35ada750$a108f5f0$@com> <00af01c98f76$309c91d0$91d5b570$@com> Message-ID: Yes I also found that out.. I added a new one there in my branch. MonoDist On Sun, Feb 15, 2009 at 3:03 PM, Pete Bacon Darwin < bacondarwin at googlemail.com> wrote: > Actually the offending bit is actually hard coded into context.rb!! > > > > def transform_config_file(configuration, source_path, target_build_path) > > # signing is on for IronRuby in Merlin, off for SVN and Binary > > layout = {'Merlin' => { :signing => false, :LibraryPaths => > '..\..\Languages\Ruby\libs;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\ruby\site_ruby\1.8;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\ruby\site_ruby;..\..\..\External\Languages\Ruby\Ruby-1.8.6\lib\ruby\1.8' > }, > > 'Binary' => { :signing => true, :LibraryPaths => > '..\lib\IronRuby;..\lib\ruby\site_ruby\1.8;..\lib\ruby\site_ruby;..\lib\ruby\1.8' > } } > > > > transform_config source_path, target_build_path, > layout[configuration][:LibraryPaths] > > end > > > > Pete > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek > *Sent:* Friday,13 February 13, 2009 16:57 > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Incorrect library paths in App.Config > > > > Yep, you're right. Will fix App.config by the next GIT push. > > BTW: What changes are needed for Mono? > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Pete Bacon Darwin > *Sent:* Friday, February 13, 2009 6:13 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Incorrect library paths in App.Config > > > > Hi, > > > > I just noticed that the App.Config that is generated in an in Unsigned > build of IronRuby (i.e. rake compile) contains incorrect library paths. > When I tried to run rake mspec:core it failed to require 'fileutils'. > > > > Currently (Git commit 6855c7c41ee2...) has the following in > Merlin/Main/Config/Unsigned/App.Config: > > > > value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" > /> > > > > But the repository has the following folder layout: > > > > Merlin/External/Languages/Ruby/redist-libs/ruby/1.8 > > And > > Merlin/External/Languages/Ruby/redist-libs/ruby/site_ruby > > > > So therefore this file should look like this: > > > > value='..\..\Languages\Ruby\libs;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby\1.8;..\..\..\External\Languages\Ruby\redist-libs\ruby\site_ruby;..\..\..\External\Languages\Ruby\redist-libs\ruby\1.8'/> > > > > I thought I must be wrong since this should have been picked up already but > then I guess that most people who are building IR at the moment are either > inside MSFT (and using signed builds) or running on Mono and having to > rewrite this file anyway. > > > > Am I right here? > > > > Pete > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Mon Feb 16 09:34:01 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 16 Feb 2009 15:34:01 +0100 Subject: [Ironruby-core] problem with WPF animation.Duration= and TimeSpan Message-ID: <43d756720902160634v1f4ddeb0p901c8822cd89d15@mail.gmail.com> Hi all, Once again I am hitting some unexpected behavior in IronRuby. Might be a bug ;) >>> animation = System::Windows::Media::Animation::DoubleAnimation.new() => # >>> animation.Duration= System::Windows::Duration.new( System::TimeSpan.FromSeconds(2)) => # >>> animation.Duration= System::Windows::Duration.Forever => # So far everything works as expected. Now trying to directly set a timespan which should be possible in C#: >>> animation.Duration= System::TimeSpan.FromSeconds(2) :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) ok, automatic conversion seems not yet to work here ... but the next thing is really strange: >>> animation.Duration= System::Windows::Duration.new( System::TimeSpan.FromSeconds(2)) :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) >>> animation.Duration= System::Windows::Duration.Forever :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) >>> ??? What has already worked now doesn't any more, depending on the value that has been set before. You will probably know what is going on. Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Feb 16 09:36:21 2009 From: lists at ruby-forum.com (Roman Zawada) Date: Mon, 16 Feb 2009 15:36:21 +0100 Subject: [Ironruby-core] RubyCLR anyone? Message-ID: Hi, I asked this question http://www.ruby-forum.com/topic/178661 in main ruby forums, because its about MRI ruby and it's gem, but maybe here I can find someone who will know the answer or at least can provide some useful information. I'm really looking forward to start using IronRuby after it's first stable release, before this I'm stuck with MRI. :-/ Thanks -- Posted via http://www.ruby-forum.com/. From ivan at flanders.co.nz Mon Feb 16 09:54:06 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 16 Feb 2009 15:54:06 +0100 Subject: [Ironruby-core] RubyCLR anyone? In-Reply-To: References: Message-ID: Subversion already has MRI ruby bindings.You may want to look into those instead of interop with .NET http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/ http://www.oneofthewolves.com/2007/12/22/ruby-subversion-bindings-better-documentation/ http://agylen.com/2006/07/14/using-the-ruby-bindings-for-subversion/ http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/ruby/ On Mon, Feb 16, 2009 at 3:36 PM, Roman Zawada wrote: > Hi, > I asked this question > http://www.ruby-forum.com/topic/178661 > in main ruby forums, because its about MRI ruby and it's gem, but maybe > here I can find someone who will know the answer or at least can provide > some useful information. > > I'm really looking forward to start using IronRuby after it's first > stable release, before this I'm stuck with MRI. :-/ > > Thanks > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Mon Feb 16 12:50:52 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 16 Feb 2009 18:50:52 +0100 Subject: [Ironruby-core] Implementing ASP.NET MVC Message-ID: Hi, I'm currently implementing ActionFilters and ActionResults in ironruby mvc. I do have some questions about that.. Why so many filters? Is there an example somewhere so I can see their intended use? At the moment I'm doing it this way: class HomeController < Controller before_filter :some_name do |ar| # do some really cool shizzit here end before_filter :some_action after_filter around_filter result_filter exception_filter authorize_filter # or filter :some_name, :when => :after do |res|; end; filter :action_name, :when => :authorize end Then there are also selectors.. they seem to do the same thing as filters but I might be mistaking. Can I just lump those together and just call it a different kind of filter? What would be the best strategy because the amount of filters is a little bit over doing it IMHO ? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at zwadar.net Mon Feb 16 14:57:41 2009 From: info at zwadar.net (Roman Zawada) Date: Mon, 16 Feb 2009 20:57:41 +0100 Subject: [Ironruby-core] RubyCLR anyone? In-Reply-To: References: Message-ID: <4999C535.5080709@zwadar.net> Doh. Last time I looked at svn ruby bindigs a found somewhere that they are not compilable under windows. I must look at at this more often, since now there is nice distribution of svn ruby bindings for windows on http://subversion.tigris.org site. Thank you very much! But I still want to know how to solve .NET interop with SharpSVN or with some other .NET library with similar usage. Or if only way how to use it, is to wirte some wrapper class around it to be able to use it from RubyCLR or even from IR.. Thanks. Ivan Porto Carrero napsal(a): > Subversion already has MRI ruby bindings. > You may want to look into those instead of interop with .NET > > http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/ > http://www.oneofthewolves.com/2007/12/22/ruby-subversion-bindings-better-documentation/ > http://agylen.com/2006/07/14/using-the-ruby-bindings-for-subversion/ > http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/ruby/ > > > On Mon, Feb 16, 2009 at 3:36 PM, Roman Zawada > wrote: > > Hi, > I asked this question > http://www.ruby-forum.com/topic/178661 > in main ruby forums, because its about MRI ruby and it's gem, but > maybe > here I can find someone who will know the answer or at least can > provide > some useful information. > > I'm really looking forward to start using IronRuby after it's first > stable release, before this I'm stuck with MRI. :-/ > > Thanks > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > ------------------------------------------------------------------------ > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > From Tomas.Matousek at microsoft.com Mon Feb 16 16:04:48 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 16 Feb 2009 13:04:48 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0B92CE3E@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0B92CE3E@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Looks good. Tomas -----Original Message----- From: Shri Borde Sent: Wednesday, February 11, 2009 10:47 AM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Fixes couple of remaining blocking bugs in re: Ruby's /(?:m)/m should map to CLR's "(?:s)" Hacky fix for /(expr){N}+/ should be treated like /(?:expr{N})+/ From ivan at flanders.co.nz Mon Feb 16 16:57:51 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 16 Feb 2009 22:57:51 +0100 Subject: [Ironruby-core] RubyCLR anyone? In-Reply-To: <4999C535.5080709@zwadar.net> References: <4999C535.5080709@zwadar.net> Message-ID: You should be able to do it with ironruby and your example ported would look like require 'SharpSVN.dll' target_path = "C:/dev/experiments/silverlight' target = SvnTarget.parse target_path client = SvnClient.new begin client.log target, Action.new(&lambda { |sender, args| .... } finally client.dispose end I'm not sure about the parse method.. I just translated it in gmail Cheers Ivan On Mon, Feb 16, 2009 at 8:57 PM, Roman Zawada wrote: > Doh. Last time I looked at svn ruby bindigs a found somewhere that they are > not compilable under windows. I must look at at this more often, since now > there is nice distribution of svn ruby bindings for windows on > http://subversion.tigris.org site. > Thank you very much! > > But I still want to know how to solve .NET interop with SharpSVN or with > some other .NET library with similar usage. Or if only way how to use it, is > to wirte some wrapper class around it to be able to use it from RubyCLR or > even from IR.. > > Thanks. > > Ivan Porto Carrero napsal(a): > >> Subversion already has MRI ruby bindings. >> You may want to look into those instead of interop with .NET >> >> >> http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/ >> >> http://www.oneofthewolves.com/2007/12/22/ruby-subversion-bindings-better-documentation/ >> http://agylen.com/2006/07/14/using-the-ruby-bindings-for-subversion/ >> http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/ruby/ >> >> >> On Mon, Feb 16, 2009 at 3:36 PM, Roman Zawada > lists at ruby-forum.com>> wrote: >> >> Hi, >> I asked this question >> http://www.ruby-forum.com/topic/178661 >> in main ruby forums, because its about MRI ruby and it's gem, but >> maybe >> here I can find someone who will know the answer or at least can >> provide >> some useful information. >> >> I'm really looking forward to start using IronRuby after it's first >> stable release, before this I'm stuck with MRI. :-/ >> >> Thanks >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 16 18:19:23 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 16 Feb 2009 15:19:23 -0800 Subject: [Ironruby-core] problem with WPF animation.Duration= and TimeSpan In-Reply-To: <43d756720902160634v1f4ddeb0p901c8822cd89d15@mail.gmail.com> References: <43d756720902160634v1f4ddeb0p901c8822cd89d15@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB27814C@NA-EXMSG-C116.redmond.corp.microsoft.com> Crazy. I've opened a bug: http://rubyforge.org/tracker/index.php?func=detail&aid=23953&group_id=4359&atid=16798 ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Monday, February 16, 2009 6:34 AM To: ironruby-core Subject: [Ironruby-core] problem with WPF animation.Duration= and TimeSpan Hi all, Once again I am hitting some unexpected behavior in IronRuby. Might be a bug ;) >>> animation = System::Windows::Media::Animation::DoubleAnimation.new() => # >>> animation.Duration= System::Windows::Duration.new( System::TimeSpan.FromSeconds(2)) => # >>> animation.Duration= System::Windows::Duration.Forever => # So far everything works as expected. Now trying to directly set a timespan which should be possible in C#: >>> animation.Duration= System::TimeSpan.FromSeconds(2) :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) ok, automatic conversion seems not yet to work here ... but the next thing is really strange: >>> animation.Duration= System::Windows::Duration.new( System::TimeSpan.FromSeconds(2)) :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) >>> animation.Duration= System::Windows::Duration.Forever :0: can't convert System::TimeSpan into System::Windows::Duration (TypeError) >>> ??? What has already worked now doesn't any more, depending on the value that has been set before. You will probably know what is going on. Cheers, -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Feb 16 18:56:48 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 16 Feb 2009 15:56:48 -0800 Subject: [Ironruby-core] RubySpec: Exceptions in before/after get lost in output In-Reply-To: <4993E031.2040806@sun.com> References: <710DF26F214D2B4BB94287123FFE980A2E0B92CE96@NA-EXMSG-C104.redmond.corp.microsoft.com> <4993E031.2040806@sun.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781A5@NA-EXMSG-C116.redmond.corp.microsoft.com> There's also a dependency on "yes" in the popen specs. However, you can get "cat" if you install the gnutools for windows, but that definitely shouldn't be a requirement on the specs. Especially since "yes" isn't included in the gnutools. In both cases you can probably just depend on the current ruby install to do replicate the behavior of those commands. Anyway, Jim, can you submit a patch to RubySpec that removes these dependencies? ~js > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Charles Oliver Nutter > Sent: Thursday, February 12, 2009 12:39 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] RubySpec: Exceptions in before/after get > lost in output > > Shri Borde wrote: > > core/io/close_read_spec.rb does not work on my machine because it has > > the following code, but I don?t have ?cat? on my machine. > ... > > However, running it does not report any errors in the final summary. > > There is output indicating that something went bad, but if you run > all > > the tests together, the output scrolls past, and you won?t realize > it. > ... > > .'cat' is not recognized as an internal or external command, > ... > > Shouldn?t mspec report this as an error? > > Probably should. The problem is that popen always returns the IO > streams > for the subprocess, which may be cmd reporting the 'cat' error. I > suppose it could be modified to one of the other popen variants that > set > process exit status. You should bring it up on rubyspec ML or on IRC. > > - Charlie > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Jimmy.Schementi at microsoft.com Mon Feb 16 19:50:56 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 16 Feb 2009 16:50:56 -0800 Subject: [Ironruby-core] IronRuby Mono/Linux Build In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> Awesome! Good choice =) Is there a link to the actual app? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Wednesday, February 11, 2009 8:00 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRuby Mono/Linux Build Is up and running again, under integrity now: http://www.integrityapp.com The twitter should update again, but only when I push to my linux branch (for now): http://twitter.com/ironrubyci -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Mon Feb 16 20:51:53 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Mon, 16 Feb 2009 20:51:53 -0500 Subject: [Ironruby-core] IronRuby Mono/Linux Build In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Working on that ;) On Mon, Feb 16, 2009 at 7:50 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > Awesome! Good choice =) Is there a link to the actual app? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Michael Letterle > *Sent:* Wednesday, February 11, 2009 8:00 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] IronRuby Mono/Linux Build > > > > Is up and running again, under integrity now: http://www.integrityapp.com > > The twitter should update again, but only when I push to my linux branch > (for now): http://twitter.com/ironrubyci > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Tue Feb 17 17:02:12 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 17 Feb 2009 14:02:12 -0800 Subject: [Ironruby-core] Code Review: MoreProtocols8 Message-ID: tfpt review "/shelveset:MoreProtocols8;REDMOND\tomat" Affects DLR outer ring, IronPython and IronRuby. DLR: - Changes names of arguments/parameters in default binder to be typed to strings instead of SymbolIds. - Adds NonNullItems attribute. If applied on a params-array or dict-array parameter the binder only binds non-null arguments to the items of the array/dict. IronPython: - Reflects changes in DLR. IronRuby: - Implements missing protocols and removes all static sites used in protocol conversions. - Fixes caching issues in protocol conversions. - Misc fixes in libraries. Passed "run 0". Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MoreProtocols8.diff Type: application/octet-stream Size: 218380 bytes Desc: MoreProtocols8.diff URL: From meinrad.recheis at gmail.com Tue Feb 17 17:36:31 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 17 Feb 2009 23:36:31 +0100 Subject: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? Message-ID: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> hello, I am now currently using this ugly hack to get a reasonable (let's say user friendly) exception backtrace from an error in executed code: public object Execute(string code, ScriptScope scope) { code = @"begin _=( "+code+@" ) rescue Exception self.__message__=$!.message.to_clr_string self.__backtrace__ = $!.backtrace throw end"; object result = null; try { LogManager.GetLogger("Ruby").Debug("\r\n" + code); result = m_engine.Execute(code, scope); } catch (Exception e) { var backtrace = scope.GetVariable("__backtrace__"); string msg = scope.GetVariable("__message__") +"\r\n" + string.Join("\r\n", backtrace.Select(s => s.ToString()).ToArray()); LogManager.GetLogger("Ruby").Error(msg); } return result; } Even though it seems to work well I am absolutely not satisfied with it. Is there a better way to do this? -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From curth at microsoft.com Tue Feb 17 18:23:50 2009 From: curth at microsoft.com (Curt Hagenlocher) Date: Tue, 17 Feb 2009 15:23:50 -0800 Subject: [Ironruby-core] Code Review: MoreProtocols8 In-Reply-To: <350E7D38B6D819428718949920EC2355571BBDA7EB@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <350E7D38B6D819428718949920EC2355571BBDA7EB@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Ruby changes look good. From: Dino Viehland Sent: Tuesday, February 17, 2009 2:27 PM To: Tomas Matousek; IronRuby External Code Reviewers; Rowan Code Reviewers; DLR Code Reviews Cc: ironruby-core at rubyforge.org Subject: RE: Code Review: MoreProtocols8 Python changes look good. From: Tomas Matousek Sent: Tuesday, February 17, 2009 2:02 PM To: IronRuby External Code Reviewers; Rowan Code Reviewers; DLR Code Reviews Cc: ironruby-core at rubyforge.org Subject: Code Review: MoreProtocols8 tfpt review "/shelveset:MoreProtocols8;REDMOND\tomat" Affects DLR outer ring, IronPython and IronRuby. DLR: - Changes names of arguments/parameters in default binder to be typed to strings instead of SymbolIds. - Adds NonNullItems attribute. If applied on a params-array or dict-array parameter the binder only binds non-null arguments to the items of the array/dict. IronPython: - Reflects changes in DLR. IronRuby: - Implements missing protocols and removes all static sites used in protocol conversions. - Fixes caching issues in protocol conversions. - Misc fixes in libraries. Passed "run 0". Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Tue Feb 17 19:44:25 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 17 Feb 2009 16:44:25 -0800 Subject: [Ironruby-core] New Git revision pushed Message-ID: -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 17 22:11:48 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 17 Feb 2009 22:11:48 -0500 Subject: [Ironruby-core] IronRuby Mono/Linux Build In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: http://ironruby.colliertech.org/integrity/ On Mon, Feb 16, 2009 at 8:51 PM, Michael Letterle < michael.letterle at gmail.com> wrote: > Working on that ;) > > > > On Mon, Feb 16, 2009 at 7:50 PM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > >> Awesome! Good choice =) Is there a link to the actual app? >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Michael Letterle >> *Sent:* Wednesday, February 11, 2009 8:00 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* [Ironruby-core] IronRuby Mono/Linux Build >> >> >> >> Is up and running again, under integrity now: >> http://www.integrityapp.com >> >> The twitter should update again, but only when I push to my linux branch >> (for now): http://twitter.com/ironrubyci >> >> -- >> Michael Letterle >> IronRuby MVP >> http://blog.prokrams.com >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Feb 17 22:22:33 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 17 Feb 2009 19:22:33 -0800 Subject: [Ironruby-core] IronRuby Mono/Linux Build In-Reply-To: References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3620C3@NA-EXMSG-C116.redmond.corp.microsoft.com> Thanks! Linked to from here: http://ironruby.net/About ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Tuesday, February 17, 2009 7:12 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] IronRuby Mono/Linux Build http://ironruby.colliertech.org/integrity/ On Mon, Feb 16, 2009 at 8:51 PM, Michael Letterle > wrote: Working on that ;) On Mon, Feb 16, 2009 at 7:50 PM, Jimmy Schementi > wrote: Awesome! Good choice =) Is there a link to the actual app? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Wednesday, February 11, 2009 8:00 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRuby Mono/Linux Build Is up and running again, under integrity now: http://www.integrityapp.com The twitter should update again, but only when I push to my linux branch (for now): http://twitter.com/ironrubyci -- Michael Letterle IronRuby MVP http://blog.prokrams.com _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Tue Feb 17 22:57:06 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Tue, 17 Feb 2009 22:57:06 -0500 Subject: [Ironruby-core] IronRuby Mono/Linux Build In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3620C3@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB2781F1@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3620C3@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: BTW I have it set up doing true CI now. Any time anyone pushes to the linux branch of my fork it will run a build. If anyone would like to be a contributor just send me an email and I'll add you to the repo. On Tue, Feb 17, 2009 at 10:22 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > Thanks! Linked to from here: http://ironruby.net/About > > > > ~js > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Michael Letterle > *Sent:* Tuesday, February 17, 2009 7:12 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] IronRuby Mono/Linux Build > > > > http://ironruby.colliertech.org/integrity/ > > On Mon, Feb 16, 2009 at 8:51 PM, Michael Letterle < > michael.letterle at gmail.com> wrote: > > Working on that ;) > > > On Mon, Feb 16, 2009 at 7:50 PM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > Awesome! Good choice =) Is there a link to the actual app? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Michael Letterle > *Sent:* Wednesday, February 11, 2009 8:00 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] IronRuby Mono/Linux Build > > > > Is up and running again, under integrity now: http://www.integrityapp.com > > The twitter should update again, but only when I push to my linux branch > (for now): http://twitter.com/ironrubyci > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Wed Feb 18 01:49:32 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 18 Feb 2009 07:49:32 +0100 Subject: [Ironruby-core] community chapter Message-ID: Hi I would like to put a "real-world" IronRuby chapter in my book that is created by people from the community. People that are interested in writing a short piece (2-5 pages in word) on how IronRuby made their live easier because of ... Michael has a thing about ActiveDirectory Daniele also has a topic. I was thinking Ben???? if anybody else is interested just let me know and I'll give you access to the repository in which we stick all our stuff around that. 2 pages would be an average blog post :) Also I took over the rubydoes.net website. If somebody wants to blog there => email me :) Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Wed Feb 18 04:24:47 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 18 Feb 2009 10:24:47 +0100 Subject: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? In-Reply-To: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> References: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> Message-ID: <43d756720902180124q69033beflc49767b62eabf575@mail.gmail.com> I've given it some thought. I would like to avoid wrapping the code in "begin - rescue" and instead catch the exception in c#. Then just send the ruby methods "message" and "backtrace" to the Ruby-exception-object from C#. How would that be done? Any other hints?-- Henon On Tue, Feb 17, 2009 at 11:36 PM, Meinrad Recheis wrote: > hello, > > I am now currently using this ugly hack to get a reasonable (let's say user > friendly) exception backtrace from an error in executed code: > > public object Execute(string code, ScriptScope scope) > { > code = @"begin > _=( > "+code+@" > ) > rescue Exception > self.__message__=$!.message.to_clr_string > self.__backtrace__ = $!.backtrace > throw > end"; > object result = null; > try > { > LogManager.GetLogger("Ruby").Debug("\r\n" + code); > result = m_engine.Execute(code, scope); > > } > catch (Exception e) > { > var backtrace = > scope.GetVariable("__backtrace__"); > string msg = scope.GetVariable("__message__") > +"\r\n" + string.Join("\r\n", backtrace.Select(s => > s.ToString()).ToArray()); > > LogManager.GetLogger("Ruby").Error(msg); > } > return result; > } > Even though it seems to work well I am absolutely not satisfied with it. Is > there a better way to do this? > -- henon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Wed Feb 18 05:54:30 2009 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 18 Feb 2009 10:54:30 +0000 Subject: [Ironruby-core] community chapter In-Reply-To: References: Message-ID: Hi Ivan, Sounds like a great idea! I would be interested in writing a couple of pages, i'll contact you offline - if I don't, nudge me ;) Ben On Wed, Feb 18, 2009 at 6:49 AM, Ivan Porto Carrero wrote: > Hi > > I would like to put a "real-world" IronRuby chapter in my book that is > created by people from the community. People that are interested in writing > a short piece (2-5 pages in word) on how IronRuby made their live easier > because of ... > > Michael has a thing about ActiveDirectory > Daniele also has a topic. > > I was thinking Ben???? > > if anybody else is interested just let me know and I'll give you access to > the repository in which we stick all our stuff around that. > 2 pages would be an average blog post :) > > Also I took over the rubydoes.net website. If somebody wants to blog there > => email me :) > > Cheers > Ivan > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > From ivan at flanders.co.nz Wed Feb 18 07:13:42 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 18 Feb 2009 13:13:42 +0100 Subject: [Ironruby-core] community chapter In-Reply-To: References: Message-ID: Great! Other people I thought about were Thibaut Barr?re Robert Brotherus Cheers On Wed, Feb 18, 2009 at 11:54 AM, Ben Hall wrote: > Hi Ivan, > > Sounds like a great idea! I would be interested in writing a couple of > pages, i'll contact you offline - if I don't, nudge me ;) > > Ben > > On Wed, Feb 18, 2009 at 6:49 AM, Ivan Porto Carrero > wrote: > > Hi > > > > I would like to put a "real-world" IronRuby chapter in my book that is > > created by people from the community. People that are interested in > writing > > a short piece (2-5 pages in word) on how IronRuby made their live easier > > because of ... > > > > Michael has a thing about ActiveDirectory > > Daniele also has a topic. > > > > I was thinking Ben???? > > > > if anybody else is interested just let me know and I'll give you access > to > > the repository in which we stick all our stuff around that. > > 2 pages would be an average blog post :) > > > > Also I took over the rubydoes.net website. If somebody wants to blog > there > > => email me :) > > > > Cheers > > Ivan > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Wed Feb 18 07:54:22 2009 From: thibaut.barrere at gmail.com (thibaut.barrere at gmail.com) Date: Wed, 18 Feb 2009 13:54:22 +0100 Subject: [Ironruby-core] community chapter In-Reply-To: References: Message-ID: <5C048CC8-DA7E-42A6-A53A-33BF574C1EBB@gmail.com> Hi Ivan, I'm interested - I'll get back to you next week (I'm currently on holidays). Cheers! -- Thibaut Envoy? de mon iPhone Le 18 f?vr. 09 ? 13:13, Ivan Porto Carrero a ?crit : > Great! > > Other people I thought about were > Thibaut Barr?re > Robert Brotherus > > Cheers > > > On Wed, Feb 18, 2009 at 11:54 AM, Ben Hall > wrote: > Hi Ivan, > > Sounds like a great idea! I would be interested in writing a couple of > pages, i'll contact you offline - if I don't, nudge me ;) > > Ben > > On Wed, Feb 18, 2009 at 6:49 AM, Ivan Porto Carrero > wrote: > > Hi > > > > I would like to put a "real-world" IronRuby chapter in my book > that is > > created by people from the community. People that are interested > in writing > > a short piece (2-5 pages in word) on how IronRuby made their live > easier > > because of ... > > > > Michael has a thing about ActiveDirectory > > Daniele also has a topic. > > > > I was thinking Ben???? > > > > if anybody else is interested just let me know and I'll give you > access to > > the repository in which we stick all our stuff around that. > > 2 pages would be an average blog post :) > > > > Also I took over the rubydoes.net website. If somebody wants to > blog there > > => email me :) > > > > Cheers > > Ivan > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Wed Feb 18 10:19:10 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Wed, 18 Feb 2009 15:19:10 -0000 Subject: [Ironruby-core] Debugging rubyspecs Message-ID: <007101c991dc$40e2d550$c2a87ff0$@com> Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Wed Feb 18 11:11:18 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Wed, 18 Feb 2009 16:11:18 -0000 Subject: [Ironruby-core] Debugging rubyspecs Message-ID: <008001c991e3$896e7110$9c4b5330$@com> The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 18 11:51:55 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 18 Feb 2009 08:51:55 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <008001c991e3$896e7110$9c4b5330$@com> References: <008001c991e3$896e7110$9c4b5330$@com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Wed Feb 18 12:58:51 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 18 Feb 2009 09:58:51 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 18 13:25:48 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 10:25:48 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <008001c991e3$896e7110$9c4b5330$@com> References: <008001c991e3$896e7110$9c4b5330$@com> Message-ID: Do you pass -D to the ir.exe that runs the specs? The debugging is better that way, although I admit it is not good at all in any case :( Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Wed Feb 18 17:28:36 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 18 Feb 2009 14:28:36 -0800 Subject: [Ironruby-core] Added some mug shots to http://www.ironruby.net/About/People Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0C88D8B4@NA-EXMSG-C104.redmond.corp.microsoft.com> I added a few photos to http://www.ironruby.net/About/People (using the en.gravatar.com links from the github profile). There seems to be a bug to add an image. So here is the process if others want to add their own. * Goto http://www.ironruby.net/About/People. * Edit Page * Click on the "Insert image" button in the toolbar at the top. This will pop up a dialog box. * If you add a URL on the textbox at the top, the "Insert Image" button is still not enabled. Looks like a bug. So... * Click on the "Browse" tab * Click on the blue "Up a level" button on the left side twice. You should see "Documentation" as one of the entries in the list of folders. Click it once * Then click "CLR Interop" and then "Specification". * Select ExceptionHierarchy.png. This will populate the textbox at the top with "/@api/deki/files/6/=ExceptionHierarchy.png", and enable the "Insert Image" button at the bottom. Finally! * At this point, you can switch back to the "Search" tab, and a link to a photo (hosted somewhere else) in place of "/@api/deki/files/6/=ExceptionHierarchy.png". * Select the middle alignment option (flowing text to the right of the image). * The "Size" option is not enabled. Again, looks like a bug. * Click "Insert Image" * Manually resize the huge image size that is inserted to a smaller size. * Save Page Thanks, Shri -------------- next part -------------- An HTML attachment was scrubbed... URL: From orion.edwards at gmail.com Wed Feb 18 19:20:02 2009 From: orion.edwards at gmail.com (Orion Edwards) Date: Thu, 19 Feb 2009 13:20:02 +1300 Subject: [Ironruby-core] Attributes Message-ID: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> I'd like to mock up a WCF service using IronRuby. This presents some stumbling blocks however, in that WCF ServiceContracts are defined by creating an Interface and then applying attributes to it. Interface ~= Module in IronRuby, so that would probably be fine, but how can I apply attributes to the module and the methods it declares? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 18 19:54:34 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 16:54:34 -0800 Subject: [Ironruby-core] Attributes In-Reply-To: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> References: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> Message-ID: We currently don't support attributes. As a workaround you can define a class in C# that will have all the attributes. The class can then forward all functionality to Ruby (e.g. via abstract methods implemented in a class derived in Ruby). Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, February 18, 2009 4:20 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Attributes I'd like to mock up a WCF service using IronRuby. This presents some stumbling blocks however, in that WCF ServiceContracts are defined by creating an Interface and then applying attributes to it. Interface ~= Module in IronRuby, so that would probably be fine, but how can I apply attributes to the module and the methods it declares? -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.letterle at gmail.com Wed Feb 18 20:01:47 2009 From: michael.letterle at gmail.com (Michael Letterle) Date: Wed, 18 Feb 2009 20:01:47 -0500 Subject: [Ironruby-core] Attributes In-Reply-To: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> References: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> Message-ID: AFAIK you can't yet. It's one of those interop things that are on the back burner while language compatibility is worked on. There's still alot of discussion needed about how to do this... On Wed, Feb 18, 2009 at 7:20 PM, Orion Edwards wrote: > I'd like to mock up a WCF service using IronRuby. > > This presents some stumbling blocks however, in that WCF ServiceContracts > are defined by creating an Interface and then applying attributes to it. > > Interface ~= Module in IronRuby, so that would probably be fine, but how > can I apply attributes to the module and the methods it declares? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Michael Letterle IronRuby MVP http://blog.prokrams.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Wed Feb 18 20:03:04 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 18 Feb 2009 17:03:04 -0800 Subject: [Ironruby-core] Code Review: esupport Message-ID: DLR: FYI on formatting change. No response needed. tfpt review "/shelveset:esupport;REDMOND\jdeville" Comment : Adds -e support to IronRuby using CommonConsoleOptions.Command. Also fixes a formatting error in ConsoleHost.cs -------------- next part -------------- A non-text attachment was scrubbed... Name: esupport.diff Type: application/octet-stream Size: 1153 bytes Desc: esupport.diff URL: From orion.edwards at gmail.com Wed Feb 18 20:18:06 2009 From: orion.edwards at gmail.com (Orion Edwards) Date: Thu, 19 Feb 2009 14:18:06 +1300 Subject: [Ironruby-core] Attributes In-Reply-To: References: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> Message-ID: <7c1b59c00902181718t3022f58r5b6e517d862b861a@mail.gmail.com> Fair enough: Here's my thoughts on what such a thing might look like: module IMyService clr_attribute ServiceContractAttribute.new("blah") clr_attribute OperationContractAttribute.new, :on => "SomeMethod" def SomeMethod; end end Could also have similar methods which map from string to ClassName at runtime clr_attr "ServiceContract" clr_attr "OperationContract", :on => "SomeMethod" Could also implement named parameters eg clr_attr "ServiceContract", :name => "MyFancyContract" clr_attr "OperationContract", :name => "CoolOperation", :on => "SomeMethod" Hope this helps inspire :-) On Thu, Feb 19, 2009 at 2:01 PM, Michael Letterle < michael.letterle at gmail.com> wrote: > AFAIK you can't yet. It's one of those interop things that are on the back > burner while language compatibility is worked on. There's still alot of > discussion needed about how to do this... > > On Wed, Feb 18, 2009 at 7:20 PM, Orion Edwards wrote: > >> I'd like to mock up a WCF service using IronRuby. >> >> This presents some stumbling blocks however, in that WCF ServiceContracts >> are defined by creating an Interface and then applying attributes to it. >> >> Interface ~= Module in IronRuby, so that would probably be fine, but how >> can I apply attributes to the module and the methods it declares? >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > Michael Letterle > IronRuby MVP > http://blog.prokrams.com > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From orion.edwards at gmail.com Wed Feb 18 20:26:12 2009 From: orion.edwards at gmail.com (Orion Edwards) Date: Thu, 19 Feb 2009 14:26:12 +1300 Subject: [Ironruby-core] IronRuby overloaded method selection? Message-ID: <7c1b59c00902181726r30943e56o8fd95c62ac82a579@mail.gmail.com> I have the following C# code, which I'm trying to translate to IronRuby var host = new ServiceHost(typeof(MyService )); host.AddServiceEndpoint(typeof(IWcfContract), new WSHttpBinding(), new Uri("...")); This compiles fine. My ruby translation looks like this: host = ServiceHost.new( MyService ) # this line works fine host.add_service_endpoint( IWcfContract, WSHttpBinding.new, Uri.new("...") ) As far as I can tell, that's a direct translation and how it should work, but the second line always throws wrong number or type of arguments for `add_service_endpoint' (ArgumentError) Is it something to do with the way IronRuby resolves overloads? that method has about 8 different overloads, but I've tried passing in strings (and all the other overload combinations), and nothing helps. Note which may be of use: The second parameter is typed to accept System.ServiceModel.Channels.Binding, whereas the WSHttpBinding is about 3 or 4 steps down (up?) the inheritance tree from that. Could that be confusing it? Note 2: I'm running this particular IronRuby => http://nbs.blob.core.windows.net/dlr/DLR.10369.release.zip At any rate: 1) How can I figure out which overload IronRuby is deciding to call? 2) How can I make it select the correct overload if it's not doing so? -------------- next part -------------- An HTML attachment was scrubbed... URL: From orion.edwards at gmail.com Wed Feb 18 20:26:49 2009 From: orion.edwards at gmail.com (Orion Edwards) Date: Thu, 19 Feb 2009 14:26:49 +1300 Subject: [Ironruby-core] Attributes In-Reply-To: References: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> Message-ID: <7c1b59c00902181726l63e4595dldc8619a25186a845@mail.gmail.com> Thanks for answering that. I wrote a small C# interface and then implemented that from IronRuby On Thu, Feb 19, 2009 at 1:54 PM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote: > We currently don't support attributes. As a workaround you can define a > class in C# that will have all the attributes. The class can then forward > all functionality to Ruby (e.g. via abstract methods implemented in a class > derived in Ruby). > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Orion Edwards > *Sent:* Wednesday, February 18, 2009 4:20 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Attributes > > > > I'd like to mock up a WCF service using IronRuby. > > This presents some stumbling blocks however, in that WCF ServiceContracts > are defined by creating an Interface and then applying attributes to it. > > Interface ~= Module in IronRuby, so that would probably be fine, but how > can I apply attributes to the module and the methods it declares? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Wed Feb 18 21:09:41 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 18 Feb 2009 18:09:41 -0800 Subject: [Ironruby-core] Code Review: esupport In-Reply-To: References: Message-ID: Updated shelveset to add tests, and make __FILE__ work correctly. tfpt review "/shelveset:esupport;REDMOND\jdeville" Comment : Adds -e support to IronRuby using CommonConsoleOptions.Command. Adds basic tests for -e. Finally, it makes the parser set __FILE__ to -e when it parses a SourceUnit from -e. Also fixes a formatting error in ConsoleHost.cs -----Original Message----- From: Jim Deville Sent: Wednesday, February 18, 2009 5:03 PM To: IronRuby External Code Reviewers; DLR Code Reviews Cc: ironruby-core at rubyforge.org Subject: Code Review: esupport DLR: FYI on formatting change. No response needed. tfpt review "/shelveset:esupport;REDMOND\jdeville" Comment : Adds -e support to IronRuby using CommonConsoleOptions.Command. Also fixes a formatting error in ConsoleHost.cs -------------- next part -------------- A non-text attachment was scrubbed... Name: esupport.diff Type: application/octet-stream Size: 2303 bytes Desc: esupport.diff URL: From Tomas.Matousek at microsoft.com Wed Feb 18 21:30:25 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 18:30:25 -0800 Subject: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? In-Reply-To: <43d756720902180124q69033beflc49767b62eabf575@mail.gmail.com> References: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> <43d756720902180124q69033beflc49767b62eabf575@mail.gmail.com> Message-ID: You can use ExceptionService: var engine = Ruby.CreateEngine(); try { engine.Execute(@" def foo goo end def goo raise 'hello' end foo "); } catch (Exception e) { var exceptionService = engine.GetService(); string message, typeName; exceptionService.GetExceptionMessage(e, out message, out typeName); Console.WriteLine(message); Console.WriteLine(typeName); Console.WriteLine(exceptionService.FormatException(e)); } The current implementation is not ideal. If you're missing some features on the service let us know. We might consider adding them. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Wednesday, February 18, 2009 1:25 AM To: ironruby-core Subject: Re: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? I've given it some thought. I would like to avoid wrapping the code in "begin - rescue" and instead catch the exception in c#. Then just send the ruby methods "message" and "backtrace" to the Ruby-exception-object from C#. How would that be done? Any other hints? -- Henon On Tue, Feb 17, 2009 at 11:36 PM, Meinrad Recheis > wrote: hello, I am now currently using this ugly hack to get a reasonable (let's say user friendly) exception backtrace from an error in executed code: public object Execute(string code, ScriptScope scope) { code = @"begin _=( "+code+@" ) rescue Exception self.__message__=$!.message.to_clr_string self.__backtrace__ = $!.backtrace throw end"; object result = null; try { LogManager.GetLogger("Ruby").Debug("\r\n" + code); result = m_engine.Execute(code, scope); } catch (Exception e) { var backtrace = scope.GetVariable("__backtrace__"); string msg = scope.GetVariable("__message__") +"\r\n" + string.Join("\r\n", backtrace.Select(s => s.ToString()).ToArray()); LogManager.GetLogger("Ruby").Error(msg); } return result; } Even though it seems to work well I am absolutely not satisfied with it. Is there a better way to do this? -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 18 21:31:58 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 18:31:58 -0800 Subject: [Ironruby-core] Attributes In-Reply-To: <7c1b59c00902181718t3022f58r5b6e517d862b861a@mail.gmail.com> References: <7c1b59c00902181620hc7f9e58o7de11cff66e07e9e@mail.gmail.com> <7c1b59c00902181718t3022f58r5b6e517d862b861a@mail.gmail.com> Message-ID: We think in similar directions. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, February 18, 2009 5:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Attributes Fair enough: Here's my thoughts on what such a thing might look like: module IMyService clr_attribute ServiceContractAttribute.new("blah") clr_attribute OperationContractAttribute.new, :on => "SomeMethod" def SomeMethod; end end Could also have similar methods which map from string to ClassName at runtime clr_attr "ServiceContract" clr_attr "OperationContract", :on => "SomeMethod" Could also implement named parameters eg clr_attr "ServiceContract", :name => "MyFancyContract" clr_attr "OperationContract", :name => "CoolOperation", :on => "SomeMethod" Hope this helps inspire :-) On Thu, Feb 19, 2009 at 2:01 PM, Michael Letterle > wrote: AFAIK you can't yet. It's one of those interop things that are on the back burner while language compatibility is worked on. There's still alot of discussion needed about how to do this... On Wed, Feb 18, 2009 at 7:20 PM, Orion Edwards > wrote: I'd like to mock up a WCF service using IronRuby. This presents some stumbling blocks however, in that WCF ServiceContracts are defined by creating an Interface and then applying attributes to it. Interface ~= Module in IronRuby, so that would probably be fine, but how can I apply attributes to the module and the methods it declares? _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -- Michael Letterle IronRuby MVP http://blog.prokrams.com _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 18 21:41:30 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 18:41:30 -0800 Subject: [Ironruby-core] IronRuby overloaded method selection? In-Reply-To: <7c1b59c00902181726r30943e56o8fd95c62ac82a579@mail.gmail.com> References: <7c1b59c00902181726r30943e56o8fd95c62ac82a579@mail.gmail.com> Message-ID: Could you try the latest build? Also try: host.method(:add_service_endpoint).clr_members.each { |m| puts m.to_string } What does it print? Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, February 18, 2009 5:26 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRuby overloaded method selection? I have the following C# code, which I'm trying to translate to IronRuby var host = new ServiceHost(typeof(MyService )); host.AddServiceEndpoint(typeof(IWcfContract), new WSHttpBinding(), new Uri("...")); This compiles fine. My ruby translation looks like this: host = ServiceHost.new( MyService ) # this line works fine host.add_service_endpoint( IWcfContract, WSHttpBinding.new, Uri.new("...") ) As far as I can tell, that's a direct translation and how it should work, but the second line always throws wrong number or type of arguments for `add_service_endpoint' (ArgumentError) Is it something to do with the way IronRuby resolves overloads? that method has about 8 different overloads, but I've tried passing in strings (and all the other overload combinations), and nothing helps. Note which may be of use: The second parameter is typed to accept System.ServiceModel.Channels.Binding, whereas the WSHttpBinding is about 3 or 4 steps down (up?) the inheritance tree from that. Could that be confusing it? Note 2: I'm running this particular IronRuby => http://nbs.blob.core.windows.net/dlr/DLR.10369.release.zip At any rate: 1) How can I figure out which overload IronRuby is deciding to call? 2) How can I make it select the correct overload if it's not doing so? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 18 21:44:34 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 18 Feb 2009 18:44:34 -0800 Subject: [Ironruby-core] Code Review: esupport In-Reply-To: References: Message-ID: Looks good. Tomas -----Original Message----- From: Jim Deville Sent: Wednesday, February 18, 2009 6:10 PM To: Jim Deville; IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: RE: Code Review: esupport Updated shelveset to add tests, and make __FILE__ work correctly. tfpt review "/shelveset:esupport;REDMOND\jdeville" Comment : Adds -e support to IronRuby using CommonConsoleOptions.Command. Adds basic tests for -e. Finally, it makes the parser set __FILE__ to -e when it parses a SourceUnit from -e. Also fixes a formatting error in ConsoleHost.cs -----Original Message----- From: Jim Deville Sent: Wednesday, February 18, 2009 5:03 PM To: IronRuby External Code Reviewers; DLR Code Reviews Cc: ironruby-core at rubyforge.org Subject: Code Review: esupport DLR: FYI on formatting change. No response needed. tfpt review "/shelveset:esupport;REDMOND\jdeville" Comment : Adds -e support to IronRuby using CommonConsoleOptions.Command. Also fixes a formatting error in ConsoleHost.cs From robert.brotherus at napa.fi Thu Feb 19 03:47:24 2009 From: robert.brotherus at napa.fi (Robert Brotherus) Date: Thu, 19 Feb 2009 10:47:24 +0200 Subject: [Ironruby-core] community chapter References: Message-ID: <53194650933664488F3F0C3A0AB56832EE2F05@nw60.napa.fi> Hi Ivan, Yes, I can also write about our (still ongoing) path to WPF + XAML + IronRuby enlightment Any deadline you want to set for contributions? Let's continue in private emails. Robert Brotherus _____ From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Wednesday, February 18, 2009 2:14 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] community chapter Great! Other people I thought about were Thibaut Barr?re Robert Brotherus Cheers On Wed, Feb 18, 2009 at 11:54 AM, Ben Hall wrote: Hi Ivan, Sounds like a great idea! I would be interested in writing a couple of pages, i'll contact you offline - if I don't, nudge me ;) Ben On Wed, Feb 18, 2009 at 6:49 AM, Ivan Porto Carrero wrote: > Hi > > I would like to put a "real-world" IronRuby chapter in my book that is > created by people from the community. People that are interested in writing > a short piece (2-5 pages in word) on how IronRuby made their live easier > because of ... > > Michael has a thing about ActiveDirectory > Daniele also has a topic. > > I was thinking Ben???? > > if anybody else is interested just let me know and I'll give you access to > the repository in which we stick all our stuff around that. > 2 pages would be an average blog post :) > > Also I took over the rubydoes.net website. If somebody wants to blog there > => email me :) > > Cheers > Ivan > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Thu Feb 19 04:06:07 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Thu, 19 Feb 2009 10:06:07 +0100 Subject: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? In-Reply-To: References: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> <43d756720902180124q69033beflc49767b62eabf575@mail.gmail.com> Message-ID: <43d756720902190106k53a426d0y26551d56594932fa@mail.gmail.com> Thanks Thomas, thats very good. As for a suggestion about ExceptionService features: It would be quite useful to retrieve the exception backtrace as string[] in order to be able format it to one's needs. For instance, I like using the VisualStudio error parser to be able to jump from the backtrace in the output right into the right line in the source file (see my blog post: http://www.eqqon.com/index.php/Navigating_in_Exception_Stack_Traces_in_Visual_C-Sharp). To do that, currently, I would need to parse the formatted backtrace and re-format it. No big deal. Just would be nice to have. Cheers, -- henon On Thu, Feb 19, 2009 at 3:30 AM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote: > You can use ExceptionService: > > > > var engine = Ruby.CreateEngine(); > > try { > > engine.Execute(@" > > def foo > > goo > > end > > > > def goo > > raise 'hello' > > end > > > > foo > > "); > > } catch (Exception e) { > > var exceptionService = engine.GetService >(); > > string message, typeName; > > exceptionService.GetExceptionMessage(e, out message, outtypeName); > > Console.WriteLine(message); > > Console.WriteLine(typeName); > > Console.WriteLine(exceptionService.FormatException(e)); > > } > > > > The current implementation is not ideal. If you're missing some features on > the service let us know. We might consider adding them. > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Meinrad Recheis > *Sent:* Wednesday, February 18, 2009 1:25 AM > *To:* ironruby-core > *Subject:* Re: [Ironruby-core] hosting: howto get the nice ruby backtrace > on exception thrown from ruby? > > > > I've given it some thought. I would like to avoid wrapping the code in > "begin - rescue" and instead catch the exception in c#. Then just send the > ruby methods "message" and "backtrace" to the Ruby-exception-object from C#. > How would that be done? > Any other hints? > > -- Henon > > On Tue, Feb 17, 2009 at 11:36 PM, Meinrad Recheis < > meinrad.recheis at gmail.com> wrote: > > hello, > > I am now currently using this ugly hack to get a reasonable (let's say user > friendly) exception backtrace from an error in executed code: > > public object Execute(string code, ScriptScope scope) > > { > > code = @"begin > > _=( > > "+code+@" > > ) > > rescue Exception > > self.__message__=$!.message.to_clr_string > > self.__backtrace__ = $!.backtrace > > throw > > end"; > > object result = null; > > try > > { > > LogManager.GetLogger("Ruby").Debug("\r\n" + code); > > result = m_engine.Execute(code, scope); > > > > } > > catch (Exception e) > > { > > var backtrace = > scope.GetVariable("__backtrace__"); > > string msg = scope.GetVariable("__message__") > +"\r\n" + string.Join("\r\n", backtrace.Select(s => > s.ToString()).ToArray()); > > > > LogManager.GetLogger("Ruby").Error(msg); > > } > > return result; > > } > > > > Even though it seems to work well I am absolutely not satisfied with it. Is > there a better way to do this? > -- henon > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Thu Feb 19 09:21:02 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Thu, 19 Feb 2009 14:21:02 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <010101c9929d$4c0c11f0$e42435d0$@com> Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Thu Feb 19 12:10:23 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 19 Feb 2009 09:10:23 -0800 Subject: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? In-Reply-To: <43d756720902190106k53a426d0y26551d56594932fa@mail.gmail.com> References: <43d756720902171436l762ac586i98b300f86c24d82e@mail.gmail.com> <43d756720902180124q69033beflc49767b62eabf575@mail.gmail.com> <43d756720902190106k53a426d0y26551d56594932fa@mail.gmail.com> Message-ID: I completely agree with that. I think we should add a method GetStackTrace() that returns an instance of some StackTrace class, which is an array of StackFrames, where StackFrame is some struct/class that contains method name, file name and line number. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Thursday, February 19, 2009 1:06 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? Thanks Thomas, thats very good. As for a suggestion about ExceptionService features: It would be quite useful to retrieve the exception backtrace as string[] in order to be able format it to one's needs. For instance, I like using the VisualStudio error parser to be able to jump from the backtrace in the output right into the right line in the source file (see my blog post: http://www.eqqon.com/index.php/Navigating_in_Exception_Stack_Traces_in_Visual_C-Sharp). To do that, currently, I would need to parse the formatted backtrace and re-format it. No big deal. Just would be nice to have. Cheers, -- henon On Thu, Feb 19, 2009 at 3:30 AM, Tomas Matousek > wrote: You can use ExceptionService: var engine = Ruby.CreateEngine(); try { engine.Execute(@" def foo goo end def goo raise 'hello' end foo "); } catch (Exception e) { var exceptionService = engine.GetService(); string message, typeName; exceptionService.GetExceptionMessage(e, out message, out typeName); Console.WriteLine(message); Console.WriteLine(typeName); Console.WriteLine(exceptionService.FormatException(e)); } The current implementation is not ideal. If you're missing some features on the service let us know. We might consider adding them. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Wednesday, February 18, 2009 1:25 AM To: ironruby-core Subject: Re: [Ironruby-core] hosting: howto get the nice ruby backtrace on exception thrown from ruby? I've given it some thought. I would like to avoid wrapping the code in "begin - rescue" and instead catch the exception in c#. Then just send the ruby methods "message" and "backtrace" to the Ruby-exception-object from C#. How would that be done? Any other hints? -- Henon On Tue, Feb 17, 2009 at 11:36 PM, Meinrad Recheis > wrote: hello, I am now currently using this ugly hack to get a reasonable (let's say user friendly) exception backtrace from an error in executed code: public object Execute(string code, ScriptScope scope) { code = @"begin _=( "+code+@" ) rescue Exception self.__message__=$!.message.to_clr_string self.__backtrace__ = $!.backtrace throw end"; object result = null; try { LogManager.GetLogger("Ruby").Debug("\r\n" + code); result = m_engine.Execute(code, scope); } catch (Exception e) { var backtrace = scope.GetVariable("__backtrace__"); string msg = scope.GetVariable("__message__") +"\r\n" + string.Join("\r\n", backtrace.Select(s => s.ToString()).ToArray()); LogManager.GetLogger("Ruby").Error(msg); } return result; } Even though it seems to work well I am absolutely not satisfied with it. Is there a better way to do this? -- henon _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Feb 19 12:18:37 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 19 Feb 2009 18:18:37 +0100 Subject: [Ironruby-core] community chapter In-Reply-To: <53194650933664488F3F0C3A0AB56832EE2F05@nw60.napa.fi> References: <53194650933664488F3F0C3A0AB56832EE2F05@nw60.napa.fi> Message-ID: Another one I'd like to convince to write a short essay is Orion Edwards. I believe we've actually met once or twice when I was living in Wellington but can't be sure, my memory is like swiss cheese. I'm discussing with the publisher on how we can make this work for them too and next week I'll contact all of you off list to discuss this further. If there are other people listening that have done something cool please tell me about it. I firmly believe in the fact that enthusiasm and success stories are the best way to spreading something. 2009/2/19 Robert Brotherus > Hi Ivan, > > > > Yes, I can also write about our (still ongoing) path to WPF + XAML + > IronRuby enlightment > > > > Any deadline you want to set for contributions? > > > > Let's continue in private emails. > > > > Robert Brotherus > > > ------------------------------ > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Wednesday, February 18, 2009 2:14 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] community chapter > > > > Great! > > > > Other people I thought about were > > Thibaut Barr?re > > Robert Brotherus > > > > Cheers > > > > On Wed, Feb 18, 2009 at 11:54 AM, Ben Hall > wrote: > > Hi Ivan, > > Sounds like a great idea! I would be interested in writing a couple of > pages, i'll contact you offline - if I don't, nudge me ;) > > Ben > > > On Wed, Feb 18, 2009 at 6:49 AM, Ivan Porto Carrero > wrote: > > Hi > > > > I would like to put a "real-world" IronRuby chapter in my book that is > > created by people from the community. People that are interested in > writing > > a short piece (2-5 pages in word) on how IronRuby made their live easier > > because of ... > > > > Michael has a thing about ActiveDirectory > > Daniele also has a topic. > > > > I was thinking Ben???? > > > > if anybody else is interested just let me know and I'll give you access > to > > the repository in which we stick all our stuff around that. > > 2 pages would be an average blog post :) > > > > Also I took over the rubydoes.net website. If somebody wants to blog > there > > => email me :) > > > > Cheers > > Ivan > > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 19 13:09:13 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 19 Feb 2009 10:09:13 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <010101c9929d$4c0c11f0$e42435d0$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> Message-ID: All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Thu Feb 19 13:24:26 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 19 Feb 2009 10:24:26 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <010101c9929d$4c0c11f0$e42435d0$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0C88DC9E@NA-EXMSG-C104.redmond.corp.microsoft.com> The following command runs a single spec, and only launches ir.exe once. Note that the command launches mspec-run.rb which does not spawn any processes. The other runners like mspec-ci etc do spawn a new process for mspec-run.rb. c:\vsl\Merlin\Main>c:\vsl\Merlin\Main\bin\debug\ir.exe -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "caches" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/language/regexp_spec.rb Also, note that in my previous command line, I had an extra "1.8". This was needed for an earlier version of mspec, but should not be used anymore. I have updated the wiki with the latest instructions that I have verified work for me and allow me to hit a breakpoint where I expect. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Thu Feb 19 13:50:07 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Thu, 19 Feb 2009 18:50:07 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0C88DC9E@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <710DF26F214D2B4BB94287123FFE980A2E0C88DC9E@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <012401c992c2$e307f4f0$a917ded0$@com> I am still having problems with this... D:\dev\ruby\ironruby\current\Merlin\Main> D:\dev\ruby\ironruby\current\Merlin\Main\bin\debug\ir.exe -v -X:Interpret d:/dev/ruby/mspec/bin/mspec-run -e "caches" -fs -V -B "c:/Documents and Settings/pete/default.mspec" d:/dev/ruby/rubyspec/lang uage/regexp_spec.rb unknown: Unable to find a suitable ruby executable. (Exception) Even this has the same result... D:\dev\ruby\ironruby\current\Merlin\Main>d:\dev\ruby\ironruby\current\Merlin \Main\bin\debug\ir.exe -v -X:Interpret d:/dev/ruby/mspec/bin/mspec-run unknown: Unable to find a suitable ruby executable. (Exception) Don't have time to delve into this at the moment but will do so tomorrow. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday,19 February 19, 2009 18:24 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The following command runs a single spec, and only launches ir.exe once. Note that the command launches mspec-run.rb which does not spawn any processes. The other runners like mspec-ci etc do spawn a new process for mspec-run.rb. c:\vsl\Merlin\Main>c:\vsl\Merlin\Main\bin\debug\ir.exe -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "caches" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/language/regexp_spe c.rb Also, note that in my previous command line, I had an extra "1.8". This was needed for an earlier version of mspec, but should not be used anymore. I have updated the wiki with the latest instructions that I have verified work for me and allow me to hit a breakpoint where I expect. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 19 19:10:26 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 19 Feb 2009 16:10:26 -0800 Subject: [Ironruby-core] Code Review: command_line Message-ID: This also sets up the code review script to include tests. tfpt review "/shelveset:command_line;REDMOND\jdeville" Comment : Adds specs for common Ruby command line options. -------------- next part -------------- A non-text attachment was scrubbed... Name: command_line.diff Type: application/octet-stream Size: 7353 bytes Desc: command_line.diff URL: From ivan at flanders.co.nz Fri Feb 20 03:31:06 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 20 Feb 2009 09:31:06 +0100 Subject: [Ironruby-core] possible problem on mono Message-ID: Hi When I try to run the igem script on mono it always comes back with a NullReferenceException. igem list --debug --backtrace ERROR: While executing gem ... (System::NullReferenceException) Object reference not set to an instance of an object IronRuby.Libraries:0:in `TryFlattenArray' :0:in `flatten!' mscorlib:0:in `_stub_$2591' gem_runner.rb:25:in `run' mscorlib:0:in `_stub_$2495' igem:0 Is this known or should I add it to the bugs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Fri Feb 20 11:59:20 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 20 Feb 2009 08:59:20 -0800 Subject: [Ironruby-core] possible problem on mono In-Reply-To: References: Message-ID: Could you try to narrow it down to a simple repro? What parameters are passed to ?flatten!? that make it fail? (You may want to run it with ?D to get full stack information, although it will be slower). Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Friday, February 20, 2009 12:31 AM To: ironruby-core Subject: [Ironruby-core] possible problem on mono Hi When I try to run the igem script on mono it always comes back with a NullReferenceException. igem list --debug --backtrace ERROR: While executing gem ... (System::NullReferenceException) Object reference not set to an instance of an object IronRuby.Libraries:0:in `TryFlattenArray' :0:in `flatten!' mscorlib:0:in `_stub_$2591' gem_runner.rb:25:in `run' mscorlib:0:in `_stub_$2495' igem:0 Is this known or should I add it to the bugs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Fri Feb 20 12:34:18 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 20 Feb 2009 09:34:18 -0800 Subject: [Ironruby-core] Code Review: command_line In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB362DBF@NA-EXMSG-C116.redmond.corp.microsoft.com> Awesomo > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Thursday, February 19, 2009 4:10 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: command_line > > This also sets up the code review script to include tests. > > tfpt review "/shelveset:command_line;REDMOND\jdeville" > Comment : > Adds specs for common Ruby command line options. > From ivan at flanders.co.nz Sat Feb 21 15:42:07 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sat, 21 Feb 2009 21:42:07 +0100 Subject: [Ironruby-core] possible problem on mono In-Reply-To: References: Message-ID: I'll try but i'm just moving into a new flat so it may take a few days before I get some actual pc time --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Fri, Feb 20, 2009 at 5:59 PM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote: > Could you try to narrow it down to a simple repro? What parameters are > passed to "flatten!" that make it fail? (You may want to run it with ?D to > get full stack information, although it will be slower). > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Friday, February 20, 2009 12:31 AM > *To:* ironruby-core > *Subject:* [Ironruby-core] possible problem on mono > > > > Hi > > When I try to run the igem script on mono it always comes back with a > NullReferenceException. > > igem list --debug --backtrace > ERROR: While executing gem ... (System::NullReferenceException) > Object reference not set to an instance of an object > IronRuby.Libraries:0:in `TryFlattenArray' > :0:in `flatten!' > mscorlib:0:in `_stub_$2591' > gem_runner.rb:25:in `run' > mscorlib:0:in `_stub_$2495' > igem:0 > > Is this known or should I add it to the bugs? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Sun Feb 22 04:28:59 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Sun, 22 Feb 2009 09:28:59 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> Message-ID: <000901c994cf$fe620e70$fb262b50$@com> OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From orion.edwards at gmail.com Sun Feb 22 15:15:29 2009 From: orion.edwards at gmail.com (Orion Edwards) Date: Mon, 23 Feb 2009 09:15:29 +1300 Subject: [Ironruby-core] IronRuby overloaded method selection? In-Reply-To: References: <7c1b59c00902181726r30943e56o8fd95c62ac82a579@mail.gmail.com> Message-ID: <7c1b59c00902221215v73444a87ie5567d79eb217ead@mail.gmail.com> I'm now running 10606 from the nightly builds, and it seems to be somewhat fixed, but still not functioning. The error message now reads: host.add_service_endpoint( IWcfContract, WSHttpBinding.new, Uri.new("...") ) => :0: can't convert Module into ClrString (TypeError) Running the code you suggested gives this: >>> host.method(:add_service_endpoint).clr_members.each { |m| puts m.to_string } System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.String, System.ServiceModel.Channels.Binding, System.String) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.String, System.ServiceModel.Channels.Binding, System.String, System.Uri) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.String, System.ServiceModel.Channels.Binding, System.Uri) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.String, System.ServiceModel.Channels.Binding, System.Uri, System.Uri) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.Type, System.ServiceModel.Channels.Binding, System.String) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.Type, System.ServiceModel.Channels.Binding, System.String, System.Uri) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.Type, System.ServiceModel.Channels.Binding, System.Uri) System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(System.Type, System.ServiceModel.Channels.Binding, System.Uri, System.Uri) It looks like IronRuby is having to choose between (String, Binding, Uri) and (Type, Binding, Uri), and is selecting the former (when I want it to select the latter). I've tried doing this host.add_service_endpoint( IWcfContract.to_clr_type, WSHttpBinding.new, Uri.new("...") ) but the error message is still the same (can't convert module to ClrString). to_clr_type returns a System.RuntimeType - does this inherit from System.Type or is it a different thing entirely? - my knowledge of the CLR in this area is somewhat weak :-( Thanks a lot -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Mon Feb 23 02:09:20 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Sun, 22 Feb 2009 23:09:20 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <000901c994cf$fe620e70$fb262b50$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Mon Feb 23 03:00:07 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 23 Feb 2009 00:00:07 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Mon Feb 23 03:51:36 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 23 Feb 2009 00:51:36 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.brotherus at napa.fi Mon Feb 23 04:07:09 2009 From: robert.brotherus at napa.fi (Robert Brotherus) Date: Mon, 23 Feb 2009 11:07:09 +0200 Subject: [Ironruby-core] Touble with -i command line option for ir.exe Message-ID: <53194650933664488F3F0C3A0AB56832EE32D8@nw60.napa.fi> I'm using IR "NightlyBuilds\10606" I have trouble using the -i option for command-line. Has this worked at some point? c:\DATA\irb_test>ir -help Usage: ir.exe [options] [file|- [arguments]] ... Options: -i Inspect interactively after running ... c:\DATA\irb_test>\work\bin\ir.exe -i method_add.rb mscorlib:0:in `WinIOError': Could not find file 'c:\DATA\irb_test\-i'. (System::IO::FileNotFoundException) from mscorlib:0:in `Init' from mscorlib:0:in `.ctor' I can post a bug in the tracker if someone confirms I'm not doing something wrong here. Robert Brotherus From bacondarwin at googlemail.com Mon Feb 23 09:56:26 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Mon, 23 Feb 2009 14:56:26 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <000c01c995c6$e7d9be80$b78d3b80$@com> I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Mon Feb 23 13:10:57 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 23 Feb 2009 10:10:57 -0800 Subject: [Ironruby-core] Code Review: re Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CDA0355@NA-EXMSG-C104.redmond.corp.microsoft.com> tfpt review "/shelveset:re;REDMOND\sborde" Comment : Regexp literal support for /o. /foo/ should compare equal with /foo/o, so we ensure that RubyRegexpOptions.Once is passed into the RubyOps runtime helper, but we then remove it in the RubyRegex constructor Caching of the RubyRegex (and the underlying System.Text.RegularExpressions.Regex) for regexp literals so that the expression is processed only once Sort the method names in the generated ReflectionCache. This will make reduce the chances of conflicts during merging. Currently, the order is whatever System.Reflection choses. -------------- next part -------------- A non-text attachment was scrubbed... Name: re.diff Type: application/octet-stream Size: 96529 bytes Desc: re.diff URL: From Shri.Borde at microsoft.com Mon Feb 23 13:13:27 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 23 Feb 2009 10:13:27 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <000c01c995c6$e7d9be80$b78d3b80$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Mon Feb 23 13:20:51 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 23 Feb 2009 10:20:51 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <000c01c995c6$e7d9be80$b78d3b80$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> Message-ID: I made some corrections and added a point: * Mspec doesn't spawn each spec under a new process, just the mspec-run command. This doesn't prevent corruption of specs, which is why there is the conflicts_with guard. It's also why you should run core before library specs if you are doing a full run (Complex conflicts with most Numeric subclasses). * If you are setting RUBY_EXE, you should also set RUBY_FLAGS. The latter is the options passed to the implementation, and sense you are suggesting adding -X:Interpret to the command, you'll want RUBY_FLAGS set to "-X:Interpret", so that the specs run under ruby_exe get the correct runner. * We should also figure out how to debug a spec that uses ruby_exe and add that to the wiki. It will probably come down to translating the ruby_exe method into the command line that gets called, but there might be another way. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Mon Feb 23 14:00:11 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 23 Feb 2009 11:00:11 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Mon Feb 23 14:15:11 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 23 Feb 2009 11:15:11 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CDA0355@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0CDA0355@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: ReflectionCacheGenerator: More concise way how to sort an array: var methods = ReflectMethods(typeof(RubyOps)).Values; Array.Sort(methods, (m1, m2) => m1.Name.CompareTo(m2.Name)); ScringConstructor: I would prefer TransformConcatenation to take 2 parameters (Expr regexOptions, Expr regexCache) rather than params array. Then this would not be necessary: List allArgs = new List(2 + additionalArgs.Length); allArgs.Add(paramArray); allArgs.Add(codePage); allArgs.AddRange(additionalArgs); and we could do just: if (regexOptions != null) opFactory("N").OpCall(paramArray, codePage, regexOptions, regexCache) : ... Other than that looks good. Tomas -----Original Message----- From: Shri Borde Sent: Monday, February 23, 2009 10:11 AM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Regexp literal support for /o. /foo/ should compare equal with /foo/o, so we ensure that RubyRegexpOptions.Once is passed into the RubyOps runtime helper, but we then remove it in the RubyRegex constructor Caching of the RubyRegex (and the underlying System.Text.RegularExpressions.Regex) for regexp literals so that the expression is processed only once Sort the method names in the generated ReflectionCache. This will make reduce the chances of conflicts during merging. Currently, the order is whatever System.Reflection choses. From thibaut.barrere at gmail.com Mon Feb 23 15:31:57 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Mon, 23 Feb 2009 21:31:57 +0100 Subject: [Ironruby-core] http://ironruby.info/ shows Internal Server Error Message-ID: <4a68b8cf0902231231j14a11391iffd078adee196143@mail.gmail.com> in case the owner is not yet aware of that hth, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Mon Feb 23 15:34:22 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Mon, 23 Feb 2009 20:34:22 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <001e01c995f6$1d1ca600$5755f200$@com> Sadly I don't think that mspec-run looks at the standard command line options for specifying the target implementation. I tried specifying set :target, ... in my ~/.mspecrc file but it didn't help. To be honest, this is really a bug in mspec-run. It should not actually require ruby_exe.rb at all as it doesn't use it. It should only really be used when it is spawning off new processes. There is an alternative solution which requires a change to the rbconfig.rb file inside the standard libraries. The ruby_exe.rb file will look into this configuration class and pull out the following to calculate the path to the ruby exectuble. bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"] bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '') File.join(Config::CONFIG['bindir'], bin) If the version of rbconfig.rb that is shipped with IronRuby was correctly set up then this would work automatically for everyone. This is exactly how the standard MRI version works when it requires ruby_exe.rb. Currently the version of rbconfig.rb that is included via the ir.exe.config is found in Merlin/Main/Languages/Ruby/Libs/rbconfig.rb and specifies the following: # TODO: Temporary hack to locate where we are based on relative MERLIN # layout paths. We will replace this with just the path to this file when # we build out the Ruby/libs directory to contain our own private copy of # the Ruby libraries # Note that this symbol should be redefined by the packaging script for binary # layouts TOPDIR = File.dirname(__FILE__) + '/../../../../External/languages/ruby/ruby-1.8.6/' CONFIG["prefix"] = (TOPDIR || DESTDIR + "") CONFIG["exec_prefix"] = "$(prefix)" CONFIG["bindir"] = "$(exec_prefix)/bin" # TODO: change back to ironruby CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" # END TODO: Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 19:00 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Mon Feb 23 15:44:27 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 23 Feb 2009 12:44:27 -0800 Subject: [Ironruby-core] Code Review: re In-Reply-To: References: <710DF26F214D2B4BB94287123FFE980A2E0CDA0355@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CDA04DE@NA-EXMSG-C104.redmond.corp.microsoft.com> Array.Sort(methods, ...) does not work because methods is an IEnumerable, not IList, and so I have to create an auxiliary list. I did use the inline lambda for the comparision delegate. Changed TransformConcatenation too. Thanks, Shri -----Original Message----- From: Tomas Matousek Sent: Monday, February 23, 2009 11:15 AM To: Shri Borde; IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: RE: Code Review: re ReflectionCacheGenerator: More concise way how to sort an array: var methods = ReflectMethods(typeof(RubyOps)).Values; Array.Sort(methods, (m1, m2) => m1.Name.CompareTo(m2.Name)); ScringConstructor: I would prefer TransformConcatenation to take 2 parameters (Expr regexOptions, Expr regexCache) rather than params array. Then this would not be necessary: List allArgs = new List(2 + additionalArgs.Length); allArgs.Add(paramArray); allArgs.Add(codePage); allArgs.AddRange(additionalArgs); and we could do just: if (regexOptions != null) opFactory("N").OpCall(paramArray, codePage, regexOptions, regexCache) : ... Other than that looks good. Tomas -----Original Message----- From: Shri Borde Sent: Monday, February 23, 2009 10:11 AM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: re tfpt review "/shelveset:re;REDMOND\sborde" Comment : Regexp literal support for /o. /foo/ should compare equal with /foo/o, so we ensure that RubyRegexpOptions.Once is passed into the RubyOps runtime helper, but we then remove it in the RubyRegex constructor Caching of the RubyRegex (and the underlying System.Text.RegularExpressions.Regex) for regexp literals so that the expression is processed only once Sort the method names in the generated ReflectionCache. This will make reduce the chances of conflicts during merging. Currently, the order is whatever System.Reflection choses. From Jimmy.Schementi at microsoft.com Mon Feb 23 15:56:52 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 23 Feb 2009 12:56:52 -0800 Subject: [Ironruby-core] http://ironruby.info/ shows Internal Server Error In-Reply-To: <4a68b8cf0902231231j14a11391iffd078adee196143@mail.gmail.com> References: <4a68b8cf0902231231j14a11391iffd078adee196143@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB45833F@NA-EXMSG-C116.redmond.corp.microsoft.com> My fault ... the nightly script generated some really bogus results that the site freaked out about. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, February 23, 2009 12:32 PM To: ironruby-core Subject: [Ironruby-core] http://ironruby.info/ shows Internal Server Error in case the owner is not yet aware of that hth, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Mon Feb 23 17:29:08 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 23 Feb 2009 14:29:08 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <001e01c995f6$1d1ca600$5755f200$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> Message-ID: Yeah, that is correct. -t and -T, and set :target are used by MSpec, not mspec-run (and it's sibling scripts). As for not using ruby_exe, it is used in various specs, and all of the command line specs I am writing. It's not directly required by mspec-run, it gets required during the loading of the rest of mspec. I feel that ruby_exe is part of MSpec, just like should, the matchers, and the other helpers. I agree that it would be nice to get rbconfig set up correctly, in addition to RUBY_NAME. However, it does appear that RUBY_NAME is set to RUBY_ENGINE if RUBY_NAME isn't defined. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 12:34 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Sadly I don't think that mspec-run looks at the standard command line options for specifying the target implementation. I tried specifying set :target, ... in my ~/.mspecrc file but it didn't help. To be honest, this is really a bug in mspec-run. It should not actually require ruby_exe.rb at all as it doesn't use it. It should only really be used when it is spawning off new processes. There is an alternative solution which requires a change to the rbconfig.rb file inside the standard libraries. The ruby_exe.rb file will look into this configuration class and pull out the following to calculate the path to the ruby exectuble. bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"] bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '') File.join(Config::CONFIG['bindir'], bin) If the version of rbconfig.rb that is shipped with IronRuby was correctly set up then this would work automatically for everyone. This is exactly how the standard MRI version works when it requires ruby_exe.rb. Currently the version of rbconfig.rb that is included via the ir.exe.config is found in Merlin/Main/Languages/Ruby/Libs/rbconfig.rb and specifies the following: # TODO: Temporary hack to locate where we are based on relative MERLIN # layout paths. We will replace this with just the path to this file when # we build out the Ruby/libs directory to contain our own private copy of # the Ruby libraries # Note that this symbol should be redefined by the packaging script for binary # layouts TOPDIR = File.dirname(__FILE__) + '/../../../../External/languages/ruby/ruby-1.8.6/' CONFIG["prefix"] = (TOPDIR || DESTDIR + "") CONFIG["exec_prefix"] = "$(prefix)" CONFIG["bindir"] = "$(exec_prefix)/bin" # TODO: change back to ironruby CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" # END TODO: Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 19:00 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Tue Feb 24 02:20:41 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Tue, 24 Feb 2009 07:20:41 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> Message-ID: <004a01c99650$67302b90$359082b0$@com> Oops yeah I forgot that ruby_exe is probably used in some of the rubyspecs. How about we knock up a small ruby file that sets everything up and passes through to mspec-run that we can just run directly without any command line arguments from VS debugger? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 22:29 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Yeah, that is correct. -t and -T, and set :target are used by MSpec, not mspec-run (and it's sibling scripts). As for not using ruby_exe, it is used in various specs, and all of the command line specs I am writing. It's not directly required by mspec-run, it gets required during the loading of the rest of mspec. I feel that ruby_exe is part of MSpec, just like should, the matchers, and the other helpers. I agree that it would be nice to get rbconfig set up correctly, in addition to RUBY_NAME. However, it does appear that RUBY_NAME is set to RUBY_ENGINE if RUBY_NAME isn't defined. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 12:34 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Sadly I don't think that mspec-run looks at the standard command line options for specifying the target implementation. I tried specifying set :target, ... in my ~/.mspecrc file but it didn't help. To be honest, this is really a bug in mspec-run. It should not actually require ruby_exe.rb at all as it doesn't use it. It should only really be used when it is spawning off new processes. There is an alternative solution which requires a change to the rbconfig.rb file inside the standard libraries. The ruby_exe.rb file will look into this configuration class and pull out the following to calculate the path to the ruby exectuble. bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"] bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '') File.join(Config::CONFIG['bindir'], bin) If the version of rbconfig.rb that is shipped with IronRuby was correctly set up then this would work automatically for everyone. This is exactly how the standard MRI version works when it requires ruby_exe.rb. Currently the version of rbconfig.rb that is included via the ir.exe.config is found in Merlin/Main/Languages/Ruby/Libs/rbconfig.rb and specifies the following: # TODO: Temporary hack to locate where we are based on relative MERLIN # layout paths. We will replace this with just the path to this file when # we build out the Ruby/libs directory to contain our own private copy of # the Ruby libraries # Note that this symbol should be redefined by the packaging script for binary # layouts TOPDIR = File.dirname(__FILE__) + '/../../../../External/languages/ruby/ruby-1.8.6/' CONFIG["prefix"] = (TOPDIR || DESTDIR + "") CONFIG["exec_prefix"] = "$(prefix)" CONFIG["bindir"] = "$(exec_prefix)/bin" # TODO: change back to ironruby CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" # END TODO: Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 19:00 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Tue Feb 24 02:30:36 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 23 Feb 2009 23:30:36 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <004a01c99650$67302b90$359082b0$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$67302b90$359082b0$@com> Message-ID: So something that does what mspec does, without the new process? I wonder if we could just make mspec not spawn a new process if the running Ruby is the same as the target ruby. We would still need to pass -T and -t, thus specifying the args 2x, but I think that it is better than maintaining a separate script if something changes in MSpec. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 11:21 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Oops yeah I forgot that ruby_exe is probably used in some of the rubyspecs. How about we knock up a small ruby file that sets everything up and passes through to mspec-run that we can just run directly without any command line arguments from VS debugger? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 22:29 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Yeah, that is correct. -t and -T, and set :target are used by MSpec, not mspec-run (and it's sibling scripts). As for not using ruby_exe, it is used in various specs, and all of the command line specs I am writing. It's not directly required by mspec-run, it gets required during the loading of the rest of mspec. I feel that ruby_exe is part of MSpec, just like should, the matchers, and the other helpers. I agree that it would be nice to get rbconfig set up correctly, in addition to RUBY_NAME. However, it does appear that RUBY_NAME is set to RUBY_ENGINE if RUBY_NAME isn't defined. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 12:34 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Sadly I don't think that mspec-run looks at the standard command line options for specifying the target implementation. I tried specifying set :target, ... in my ~/.mspecrc file but it didn't help. To be honest, this is really a bug in mspec-run. It should not actually require ruby_exe.rb at all as it doesn't use it. It should only really be used when it is spawning off new processes. There is an alternative solution which requires a change to the rbconfig.rb file inside the standard libraries. The ruby_exe.rb file will look into this configuration class and pull out the following to calculate the path to the ruby exectuble. bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"] bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '') File.join(Config::CONFIG['bindir'], bin) If the version of rbconfig.rb that is shipped with IronRuby was correctly set up then this would work automatically for everyone. This is exactly how the standard MRI version works when it requires ruby_exe.rb. Currently the version of rbconfig.rb that is included via the ir.exe.config is found in Merlin/Main/Languages/Ruby/Libs/rbconfig.rb and specifies the following: # TODO: Temporary hack to locate where we are based on relative MERLIN # layout paths. We will replace this with just the path to this file when # we build out the Ruby/libs directory to contain our own private copy of # the Ruby libraries # Note that this symbol should be redefined by the packaging script for binary # layouts TOPDIR = File.dirname(__FILE__) + '/../../../../External/languages/ruby/ruby-1.8.6/' CONFIG["prefix"] = (TOPDIR || DESTDIR + "") CONFIG["exec_prefix"] = "$(prefix)" CONFIG["bindir"] = "$(exec_prefix)/bin" # TODO: change back to ironruby CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" # END TODO: Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 19:00 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Tue Feb 24 03:02:15 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Tue, 24 Feb 2009 08:02:15 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$67302b90$359082b0$@com > Message-ID: <005801c99656$35b7ed90$a127c8b0$@com> I might be wrong but all the command line arguments can be monkey patched in by defining a MSpecScript class like in default.mspec type file. So what I am suggesting is that we knock up a mspec-debug.rb file that sets up the MSpecScript class and also defines RUBY_EXE constant and then runs the MSpecRun class. I think then the only command line item would be the specs to run... From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday,24 February 24, 2009 07:31 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs So something that does what mspec does, without the new process? I wonder if we could just make mspec not spawn a new process if the running Ruby is the same as the target ruby. We would still need to pass -T and -t, thus specifying the args 2x, but I think that it is better than maintaining a separate script if something changes in MSpec. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 11:21 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Oops yeah I forgot that ruby_exe is probably used in some of the rubyspecs. How about we knock up a small ruby file that sets everything up and passes through to mspec-run that we can just run directly without any command line arguments from VS debugger? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 22:29 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Yeah, that is correct. -t and -T, and set :target are used by MSpec, not mspec-run (and it's sibling scripts). As for not using ruby_exe, it is used in various specs, and all of the command line specs I am writing. It's not directly required by mspec-run, it gets required during the loading of the rest of mspec. I feel that ruby_exe is part of MSpec, just like should, the matchers, and the other helpers. I agree that it would be nice to get rbconfig set up correctly, in addition to RUBY_NAME. However, it does appear that RUBY_NAME is set to RUBY_ENGINE if RUBY_NAME isn't defined. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 12:34 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Sadly I don't think that mspec-run looks at the standard command line options for specifying the target implementation. I tried specifying set :target, ... in my ~/.mspecrc file but it didn't help. To be honest, this is really a bug in mspec-run. It should not actually require ruby_exe.rb at all as it doesn't use it. It should only really be used when it is spawning off new processes. There is an alternative solution which requires a change to the rbconfig.rb file inside the standard libraries. The ruby_exe.rb file will look into this configuration class and pull out the following to calculate the path to the ruby exectuble. bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"] bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '') File.join(Config::CONFIG['bindir'], bin) If the version of rbconfig.rb that is shipped with IronRuby was correctly set up then this would work automatically for everyone. This is exactly how the standard MRI version works when it requires ruby_exe.rb. Currently the version of rbconfig.rb that is included via the ir.exe.config is found in Merlin/Main/Languages/Ruby/Libs/rbconfig.rb and specifies the following: # TODO: Temporary hack to locate where we are based on relative MERLIN # layout paths. We will replace this with just the path to this file when # we build out the Ruby/libs directory to contain our own private copy of # the Ruby libraries # Note that this symbol should be redefined by the packaging script for binary # layouts TOPDIR = File.dirname(__FILE__) + '/../../../../External/languages/ruby/ruby-1.8.6/' CONFIG["prefix"] = (TOPDIR || DESTDIR + "") CONFIG["exec_prefix"] = "$(prefix)" CONFIG["bindir"] = "$(exec_prefix)/bin" # TODO: change back to ironruby CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" # END TODO: Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday,23 February 23, 2009 19:00 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Well, mspec takes all the arguments on the command line. I wouldn't want to specify all of the options 2x. Once as the runner, and once as arguments. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, February 23, 2009 10:13 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs That is a comprehensive description! Its unfortunate it has to be as complex. Ideally, mspec-run will take all arguments (like the ruby executable) on the command line which will increase discoverability. But for now, the workarounds will do. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Monday, February 23, 2009 6:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I have updated the wiki. Let me know if this doesn't make sense or doesn't work for someone... http://wiki.github.com/ironruby/ironruby Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday,23 February 23, 2009 08:52 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The convenience of being able to hit F5 in an existing VS session and getting to the breakpoint you have previously set will be worth the pain of setting it up for some folks. With mspec and Jimmy's wrapper (which is also documented on the wiki), you have to edit the Ruby files you are debugging (which will require doing "tf edit" first), will launch a new VS session which can be slow, won't allow setting conditional breakpoints easily, wont show unexpected exceptions prior to the sleep/attach which might be triggering a failure later on, etc. Having options is a good thing so people can chose whatever works best for them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, February 23, 2009 12:00 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs In my opinion, the most future proof way is going to be using the standard runner (mspec) and a sleep, or using Jimmy's debugger wrapper. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Sunday, February 22, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I did have to play with a bunch of settings to get mspec to work under VS, and its possible that I have set some setting that I am now forgetting, but I do not have RUBY_EXE set, and I don't seem to have a .mspecrc file either. Could you please update http://wiki.github.com/ironruby/ironruby with the exact step you took to enable you to debug with VS so that others don't have to go through the same issues? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Sunday, February 22, 2009 1:29 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I worked it out. Mspec-run does indeed run only a single process but it still requires mspec/lib/mspec/helpers/ruby_exe.rb. This file tries to set a constant called RUBY_EXE but it is not able to do so: It tries to guess it from various environment, constant and config settings. Since ir does not set RUBY_NAME you have to do something like set the environment variable RUBY_EXE or have a ~/.mspecrc file that specifies the :target => ... and so on. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,19 February 19, 2009 18:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs All the versions that IronRuby has used, have the outer layer CRuby process kick off a target implementation process. If you call mspec -fs core -t "ir.exe", it becomes a call to ir.exe mspec-run -fs core. For many of the specs, you can skip the outer layer, and run mspec-run (or mspec-ci, or mspec-tag) directly. For debugging, this is what Shri is talking about. As a side note, I advise not doing it this way in general, since there are environment variables set via the outer layer runner, which will affect the operation of Mspec. Until now, it has only been MSPEC_RUNNER=1, which tells Mspec that the specs are being run by Mspec, not Rspec. However, Mspec also sets RUBY_EXE and RUBY_OPTIONS, to the values of the -t and -T flags. Now that ir -e works (I will be pushing the new revision today), these variables will affect the operation of the specs. Many of the specs that test top level code, depend on testing a fresh process, or test the command line options (I am adding these right now) use the ruby_exe helper. This helper starts a new process of the currently running implementation to run the specified command or file. Using the outer layer with -t and -T ensures that these specs are run on the proper implementation and options. I know that the implementation attempts to be inferred via other means (RUBY_NAME, RUBY_PLATFORM), but the options are not as easily taken care of. The wiki (http://wiki.github.com/ironruby/ironruby/rubyspec) tells how to get things set up, and if you set things up correctly (using ~/.mspecrc and setting /path/to/mspec/bin in your PATH) you can run a spec file as easily as mspec ci core/array/pack (to run core/array/pack_spec.rb). You have to make sure set :target, "/path/to/ir.exe" and set :prefix, "path/to/rubyspec" are set in ~/.mspecrc, from there it should just work. Let me know if you have more questions on any of this. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 19, 2009 6:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri and Jimmy, Thanks for the suggestions. What version of mspec are you running? I am running the head version directly from rubyspecs github: "d482804 Added should have_constant matcher." In my version, the initial ruby process kicks off a new ruby process (potentially a completely different implementation, like JRuby or Rubinius) for each test run. So there is no point in debugging the initial process. Shri, on my machine your instructions below result in "unknown: Unable to find a suitable ruby executable. (Exception)", which I guess is mspec telling me it couldn't load ir.exe or equivalent as a sub-process for executing the spec. Jimmy, how do you attach to the mspec process in the first place? The same problem as above is true for just debugging mspec run ... Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,18 February 18, 2009 17:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki. Debugging with Visual Studio In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows: * Start Action: For Ruby.Console.csproj, "Start project" should be enabled. For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe" * Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb: -v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsu b_spec.rb Hitting F5 should now run the single RubySpec example under VS Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, February 18, 2009 8:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs You can pass the spec file to mspec itself like: mspec run core/io/popen_close Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 18, 2009 8:11 AM To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting. It does totally kill the computer performance while you are debugging (like minutes to step through each line!) Pete From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com] Sent: Wednesday,18 February 18, 2009 15:19 To: 'ironruby-core at rubyforge.org' Subject: Debugging rubyspecs Anybody know how to run rubyspecs under the Visual Studio debugger? If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Tue Feb 24 06:11:24 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Tue, 24 Feb 2009 11:11:24 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$67302b90$359082b0$@com > Message-ID: <006901c99670$a220ec60$e662c520$@com> OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mspec-debug.rb Type: application/octet-stream Size: 394 bytes Desc: not available URL: From Tomas.Matousek at microsoft.com Tue Feb 24 19:12:49 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 24 Feb 2009 16:12:49 -0800 Subject: [Ironruby-core] Code Review: EventsAndSites5 Message-ID: tfpt review "/shelveset:EventsAndSites5;REDMOND\tomat" DLR, Python: - Refactors Python's RelfectedEvent and moves the language independent part to DLR EventTracker. - Fixes CompilerHelpers.GetCallableMethod - it didn't throw for non-visible methods since TryGetCallableMethod never returns null. - Passes "run 0". Ruby: - Implements events using EventTracker - an event can be hooked and unhooked in 2 ways now: C#: class C { public event Action OnFoo; } Ruby: def handler a,b puts ""handler: #{a} #{b}"" end c = C.new # using a block: h = c.on_foo { |a,b| ... } c.on_foo.remove(h) # using a method object: h = method(:handler) c.on_foo.add(h) c.on_foo.remove(h) - Reimplements Enumerable::Enumerator, implements missing features and fixes bugs. - Changes default protocol for CLR string to allow nil unless NotNull attribute is specificed. - Removes static sites from builtins and YAML. - Refactors reflection cache generator to produce merge-friendly source code. - Disables protected method test - we relied on the above bug in DLR. We need to implement protected visibility check correctly. Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EventsAndSites5.diff Type: application/octet-stream Size: 290649 bytes Desc: EventsAndSites5.diff URL: From jdeville at microsoft.com Tue Feb 24 19:39:02 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 24 Feb 2009 16:39:02 -0800 Subject: [Ironruby-core] Code Review: netinterop1 Message-ID: tfpt review "/shelveset:netinterop1;REDMOND\jdeville" Comment : Adds more netinterop tests related to methods. Adds these tests to snap. Adds tags for netinterop Modifies testsupport.cs (ClrAssembly) to make the Flag Value field public to match with other Flag classes, and to work better with Ruby testing. -------------- next part -------------- A non-text attachment was scrubbed... Name: netinterop1.diff Type: application/octet-stream Size: 10300 bytes Desc: netinterop1.diff URL: From Jimmy.Schementi at microsoft.com Tue Feb 24 21:58:02 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 24 Feb 2009 18:58:02 -0800 Subject: [Ironruby-core] Code Review: netinterop1 In-Reply-To: References: Message-ID: <15A77467-EAAF-444A-BA0B-0F1DCD61F0EC@microsoft.com> Looks awesome. I'll get around to specing this behavior on the website shortly. ~Jimmy Sent from my phone On Feb 24, 2009, at 5:06 PM, "Jim Deville" wrote: > tfpt review "/shelveset:netinterop1;REDMOND\jdeville" > Comment : > Adds more netinterop tests related to methods. > Adds these tests to snap. > Adds tags for netinterop > Modifies testsupport.cs (ClrAssembly) to make the Flag Value field > public to match with other Flag classes, and to work better with > Ruby testing. > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Jimmy.Schementi at microsoft.com Wed Feb 25 13:50:23 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Feb 2009 10:50:23 -0800 Subject: [Ironruby-core] WPF: registering a routed event In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F3D@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <43d756720902081545mf276f3ame83acab38b995744@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEAD87F3D@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB5418D2@NA-EXMSG-C116.redmond.corp.microsoft.com> FYI, Tomas's latest patch (http://www.ruby-forum.com/topic/179668) expands IronRuby's .NET event support to: def handler a,b puts ""handler: #{a} #{b}"" end c = C.new # using a block: h = c.on_foo { |a,b| ... } c.on_foo.remove(h) # using a method object: h = method(:handler) c.on_foo.add(h) c.on_foo.remove(h) ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Monday, February 09, 2009 6:28 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] WPF: registering a routed event We only have blocks/lambda->event handlers working. Passing a method handle is on the list, but not done yet. Feel free to post a bug on RubyForge to make sure we get around to it. http://rubyforge.org/tracker/?func=add&group_id=4359&atid=16798 ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, February 08, 2009 3:46 PM To: ironruby-core Subject: [Ironruby-core] WPF: registering a routed event Hi all, I seem to step in every hole there is on my IronRuby test drive. Using the latest git head I am failing to register a button click event in WPF: >>> require "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" => true >>> require 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' => true >>> b = System::Windows::Controls::Button.new => # >>> def on_click o, args ... puts "clicked!!" ... end => nil >>> b.add_Click( method(:on_click)) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) >>> h=System::Windows::RoutedEventHandler.new{|o, args| puts "clicked!!" } => # >>> h.Invoke(nil, nil) clicked!! => nil >>> b.add_Click(h) :0: can't convert Method into System::Windows::RoutedEventHandler (TypeError) Actually I would have expected b.add_Click( method(:on_click)) or b.add_Click( lambda {|o, args| ... } ) to work, just like it does in IronPython: >>> clr.AddReference( 'WindowsBase') >>> clr.AddReference( 'PresentationCore') >>> clr.AddReference( 'PresentationFramework') >>> import System >>> from System import Windows >>> from System.Windows import Controls >>> from System.Windows.Controls import * >>> b= Button() >>> def on_click(o, args): ... print "clicked!!" ... >>> b.add_Click(on_click) >>> I hope, I am not starting to annoy you guys ;) -- henon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Wed Feb 25 16:32:56 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 25 Feb 2009 13:32:56 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <006901c99670$a220ec60$e662c520$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@com > <006901c99670$a220ec60$e662c520$@com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Wed Feb 25 18:01:08 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 25 Feb 2009 15:01:08 -0800 Subject: [Ironruby-core] Code Review: netinterop1 Message-ID: tfpt review "/shelveset:netinterop1;REDMOND\jdeville" Comment : Adds more netinterop tests related to methods. Adds these tests to snap. Reorganizes the ruby generictest folder Adds the command line tests to snap Adds tags for netinterop Modifies testsupport.cs (ClrAssembly) to make the Flag Value field public to match with other Flag classes, and to work better with Ruby testing. -------------- next part -------------- A non-text attachment was scrubbed... Name: netinterop1.diff Type: application/octet-stream Size: 10473 bytes Desc: netinterop1.diff URL: From Jimmy.Schementi at microsoft.com Wed Feb 25 19:57:58 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Feb 2009 16:57:58 -0800 Subject: [Ironruby-core] Code Review: netinterop1 In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB541BB5@NA-EXMSG-C116.redmond.corp.microsoft.com> Do people prefer using "\" or "/" as the directory separator in Ruby code? I prefer "/" since all existing Ruby code uses that, and Ruby on windows understands it as well. Plus you don't have to play the escape-slash game when using double-quoted strings. Also, some folks might be confused at the strange class/method names uses in these tests. They come from rowantest.*.dll, which are full of test cases IronPython uses for .NET interop testing, so we are just reusing them. However, it's only a temporary solution, as we'll probably move to a C#-code-inline approach which Jim is going to get working shortly. Regardless, I approve =) > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Wednesday, February 25, 2009 3:01 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: netinterop1 > > tfpt review "/shelveset:netinterop1;REDMOND\jdeville" > Comment : > Adds more netinterop tests related to methods. > Adds these tests to snap. > Reorganizes the ruby generictest folder > Adds the command line tests to snap > Adds tags for netinterop > Modifies testsupport.cs (ClrAssembly) to make the Flag Value field > public to match with other Flag classes, and to work better with Ruby > testing. > From jdeville at microsoft.com Wed Feb 25 20:21:51 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 25 Feb 2009 17:21:51 -0800 Subject: [Ironruby-core] Code Review: netinterop1 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB541BB5@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB541BB5@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Where are you talking about / vs \? I'll change it. The \ in context.rb has to stay because it gets put directly into app.config during the transforms. The odd class names (rowantest.*.dll) are in the git repo at Merlin\Main\Test\ClrAssembly. It's a naked csproj (no solution), but it should compile from VS. I might remove it after inline support is finished. JD > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jimmy Schementi > Sent: Wednesday, February 25, 2009 4:58 PM > To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers > Subject: Re: [Ironruby-core] Code Review: netinterop1 > > Do people prefer using "\" or "/" as the directory separator in Ruby > code? I prefer "/" since all existing Ruby code uses that, and Ruby on > windows understands it as well. Plus you don't have to play the escape- > slash game when using double-quoted strings. > > > Also, some folks might be confused at the strange class/method names > uses in these tests. They come from rowantest.*.dll, which are full of > test cases IronPython uses for .NET interop testing, so we are just > reusing them. However, it's only a temporary solution, as we'll > probably move to a C#-code-inline approach which Jim is going to get > working shortly. > > Regardless, I approve =) > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Wednesday, February 25, 2009 3:01 PM > > To: IronRuby External Code Reviewers > > Cc: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Code Review: netinterop1 > > > > tfpt review "/shelveset:netinterop1;REDMOND\jdeville" > > Comment : > > Adds more netinterop tests related to methods. > > Adds these tests to snap. > > Reorganizes the ruby generictest folder > > Adds the command line tests to snap > > Adds tags for netinterop > > Modifies testsupport.cs (ClrAssembly) to make the Flag Value field > > public to match with other Flag classes, and to work better with Ruby > > testing. > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From bacondarwin at googlemail.com Wed Feb 25 23:30:43 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Thu, 26 Feb 2009 04:30:43 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@co m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <014d01c997ca$fd241c80$f76c5580$@com> Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Feb 26 00:12:31 2009 From: lists at ruby-forum.com (Mr X enterprises) Date: Thu, 26 Feb 2009 06:12:31 +0100 Subject: [Ironruby-core] Getting started in VB? Message-ID: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> I'd like to use IronRuby to make some applications extensible, but I'm having some problems getting started: Here's code I run when you click a button: runtime = ScriptRuntime.CreateFromConfiguration() runtime.ExecuteFile("MyController.rb") Dim engine As ScriptEngine = runtime.GetEngine("Ruby") Dim code As String code = String.Format("{0}.new.method :{1}", "MyController", "do_foo") Dim action As ScriptSource = engine.CreateScriptSourceFromString(code) Dim result As Object result = engine.Operations.Call(action, 1, 2) '^I get an exception saying: The method or operation is not implemented. Me.TextBox1.Text = result.ToString() Here is the ruby code: class MyController def do_foo a, b puts a, b end end I've tried googleing the problem but I can't find any good tutorials. Any help? -- Posted via http://www.ruby-forum.com/. From Jimmy.Schementi at microsoft.com Thu Feb 26 00:54:26 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Feb 2009 21:54:26 -0800 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB541CB3@NA-EXMSG-C116.redmond.corp.microsoft.com> A ScriptSource isn't compiled code yet, so you'll need to call ScriptSource.Execute() to actually run it. So, your example never ran the string in the "code" variable. Also, because your "action" variable contains code that hasn't been compiled, sending it to ObjectOperations.Call() will tell you "The method or operation is not implemented", because it can't do anything with non-compiled code. =) Lastly, in this scenario, there's no reason to use a string to grab the method, just to later call it with VB; you can do it all in VB. Here's a snippet of code which will grab a Ruby class, instantiate it, get a method on that class, and call it with arguments: ' Initialize the DLR runtime = ScriptRuntime.CreateFromConfiguration() Dim engine As ScriptEngine = runtime.GetEngine("Ruby") ' Execute a Ruby file runtime.ExecuteFile("MyController.rb") ' Get a class and initialize it Dim rubyClass As Object = runtime.Globals.GetVariable("MyController") Dim rubyObject As Object = engine.Operations.CreateInstance(rubyClass) ' Get a method and call it Dim rubyMethod As Object = engine.Operations.GetMember(rubyObject, "do_foo") Dim params() As Integer = {1, 2} Dim result As Object = engine.Operations.Call(rubyMethod, params) ' And lastly ... Me.TextBox1.Text = result.ToString() Hope that helps, ~Jimmy > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Mr X enterprises > Sent: Wednesday, February 25, 2009 9:13 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Getting started in VB? > > I'd like to use IronRuby to make some applications extensible, but I'm > having some problems getting started: > > Here's code I run when you click a button: > > runtime = ScriptRuntime.CreateFromConfiguration() > runtime.ExecuteFile("MyController.rb") > Dim engine As ScriptEngine = runtime.GetEngine("Ruby") > Dim code As String > code = String.Format("{0}.new.method :{1}", "MyController", "do_foo") > Dim action As ScriptSource = engine.CreateScriptSourceFromString(code) > Dim result As Object > > result = engine.Operations.Call(action, 1, 2) > '^I get an exception saying: The method or operation is not > implemented. > > Me.TextBox1.Text = result.ToString() > > > > Here is the ruby code: > > class MyController > def do_foo a, b > puts a, b > end > end > > > I've tried googleing the problem but I can't find any good tutorials. > > Any help? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Thu Feb 26 01:43:23 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 25 Feb 2009 22:43:23 -0800 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: This should work: Dim engine = IronRuby.Ruby.CreateEngine() engine.ExecuteFile("MyController.rb") Dim controllerClass = engine.Runtime.Globals.GetVariable("MyController") Dim controller = engine.Operations.CreateInstance(controllerClass) engine.Operations.InvokeMember(controller, "do_foo") Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Mr X enterprises Sent: Wednesday, February 25, 2009 9:13 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Getting started in VB? I'd like to use IronRuby to make some applications extensible, but I'm having some problems getting started: Here's code I run when you click a button: runtime = ScriptRuntime.CreateFromConfiguration() runtime.ExecuteFile("MyController.rb") Dim engine As ScriptEngine = runtime.GetEngine("Ruby") Dim code As String code = String.Format("{0}.new.method :{1}", "MyController", "do_foo") Dim action As ScriptSource = engine.CreateScriptSourceFromString(code) Dim result As Object result = engine.Operations.Call(action, 1, 2) '^I get an exception saying: The method or operation is not implemented. Me.TextBox1.Text = result.ToString() Here is the ruby code: class MyController def do_foo a, b puts a, b end end I've tried googleing the problem but I can't find any good tutorials. Any help? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Shri.Borde at microsoft.com Thu Feb 26 02:08:55 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 25 Feb 2009 23:08:55 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <014d01c997ca$fd241c80$f76c5580$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@co m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up... From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Feb 26 02:09:59 2009 From: lists at ruby-forum.com (Mr X enterprises) Date: Thu, 26 Feb 2009 08:09:59 +0100 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: Thank you guys so much! :D Now I can continue on with this. :) Thank you! -- Posted via http://www.ruby-forum.com/. From jdeville at microsoft.com Thu Feb 26 02:38:38 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 25 Feb 2009 23:38:38 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@co m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: The version is some portion of the version 1.5.6 (I don't know the exact commit, but that is the version number)(Shri, if you ever need to find out, it's in a weird place. Mspec/lib/mspec/version.rb). As Shri said, after my current task goes through (braving the troll right now), I will try to make things a little easier and setup files that should get consumed by default, so you won't need -B. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday, February 25, 2009 11:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up... From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Thu Feb 26 02:51:58 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Thu, 26 Feb 2009 07:51:58 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@co m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <000601c997e7$1a991790$4fcb46b0$@com> OK so I am running a recent (if not latest) pull from the github/rubyspec/mspec repository. May be that is the difference. Neither .mspecrc or -B file get loaded before the ruby_exe.rb so neither files will fix this problem. The only long term solution is to fix rbconfig.rb. The short term one is to set RUBY_EXE as an environment variable or as a ruby constant before any call to require "mspec". Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday,26 February 26, 2009 07:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 26 03:14:08 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 26 Feb 2009 00:14:08 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <000601c997e7$1a991790$4fcb46b0$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@co m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> <000601c997e7$1a991790$4fcb46b0$@com> Message-ID: The other option, which I've already asked Brian Ford to do, is to not find the force the RUBY_EXE evaluation unless the ruby_exe method is called. That will make it only matter when you want to run a ruby_exe method. It sounds like there might be another issue, but I'll look into it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 11:52 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I am running a recent (if not latest) pull from the github/rubyspec/mspec repository. May be that is the difference. Neither .mspecrc or -B file get loaded before the ruby_exe.rb so neither files will fix this problem. The only long term solution is to fix rbconfig.rb. The short term one is to set RUBY_EXE as an environment variable or as a ruby constant before any call to require "mspec". Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday,26 February 26, 2009 07:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up... From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacondarwin at googlemail.com Thu Feb 26 03:34:51 2009 From: bacondarwin at googlemail.com (Pete Bacon Darwin) Date: Thu, 26 Feb 2009 08:34:51 -0000 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@c o m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> <000601c997e7$1a991790$4fcb46b0$@com> Message-ID: <001701c997ed$1839bc10$48ad3430$@com> Yes, that would be a good idea; then .mspecrc or similar would have been loaded before ruby_exe gets called. I think they need to look at the implementation of resolve_ruby_exe in that class anyway as I don't think it looks at the :target option but I might be wrong. If that is true then you will still need to set RUBY_EXE in the .mspecrc or similar file. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,26 February 26, 2009 08:14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The other option, which I've already asked Brian Ford to do, is to not find the force the RUBY_EXE evaluation unless the ruby_exe method is called. That will make it only matter when you want to run a ruby_exe method. It sounds like there might be another issue, but I'll look into it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 11:52 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I am running a recent (if not latest) pull from the github/rubyspec/mspec repository. May be that is the difference. Neither .mspecrc or -B file get loaded before the ruby_exe.rb so neither files will fix this problem. The only long term solution is to fix rbconfig.rb. The short term one is to set RUBY_EXE as an environment variable or as a ruby constant before any call to require "mspec". Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday,26 February 26, 2009 07:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Feb 26 04:05:35 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 26 Feb 2009 01:05:35 -0800 Subject: [Ironruby-core] Debugging rubyspecs In-Reply-To: <001701c997ed$1839bc10$48ad3430$@com> References: <008001c991e3$896e7110$9c4b5330$@com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB3621D4@NA-EXMSG-C116.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0C88D608@NA-EXMSG-C104.redmond.corp.microsoft.com> <010101c9929d$4c0c11f0$e42435d0$@com> <000901c994cf$fe620e70$fb262b50$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01DC@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A2E0CDA01E9@NA-EXMSG-C104.redmond.corp.microsoft.com> <000c01c995c6$e7d9be80$b78d3b80$@com> <710DF26F214D2B4BB94287123FFE980A2E0CDA0360@NA-EXMSG-C104.redmond.corp.microsoft.com> <001e01c995f6$1d1ca600$5755f200$@com> <004a01c99650$ 67302b90$359082b0$@c o m > <006901c99670$a220ec60$e662c520$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47B0A@NA-EXMSG-C104.redmond.corp.microsoft.com> <014d01c997ca$fd241c80$f76c5580$@com> <710DF26F214D2B4BB94287123FFE980A2E0CF47D9A@NA-EXMSG-C104.redmond.corp.microsoft.com> <000601c997e7$1a991790$4fcb46b0$@com> <001701c997ed$1839bc10$48ad3430$@com> Message-ID: I think it is currently by design that resolve_ruby_exe doesn't look at :target, but it would be a good heuristic to add. ENV['RUBY_EXE'] gets set to :target by mspec/lib/mspec/commands/mspec.rb, but it probably makes sense to move that into mspec/lib/mspec/utils/script.rb so it gets called by all runners. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Thursday, February 26, 2009 12:35 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Yes, that would be a good idea; then .mspecrc or similar would have been loaded before ruby_exe gets called. I think they need to look at the implementation of resolve_ruby_exe in that class anyway as I don't think it looks at the :target option but I might be wrong. If that is true then you will still need to set RUBY_EXE in the .mspecrc or similar file. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Thursday,26 February 26, 2009 08:14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs The other option, which I've already asked Brian Ford to do, is to not find the force the RUBY_EXE evaluation unless the ruby_exe method is called. That will make it only matter when you want to run a ruby_exe method. It sounds like there might be another issue, but I'll look into it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 11:52 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK so I am running a recent (if not latest) pull from the github/rubyspec/mspec repository. May be that is the difference. Neither .mspecrc or -B file get loaded before the ruby_exe.rb so neither files will fix this problem. The only long term solution is to fix rbconfig.rb. The short term one is to set RUBY_EXE as an environment variable or as a ruby constant before any call to require "mspec". Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Thursday,26 February 26, 2009 07:09 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I am not sure how to describe our version of mspec. I don't see any version number in the mspec folder. Jim should confirm, but it must be the one from http://github.com/ironruby/mspec/tree/master. Btw, Jim is looking to make it easier to run mspec by adding a .mspecrc file and some other utility commands. Lets see if that clears this up... From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Wednesday, February 25, 2009 8:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs Hi Shri, I tried just using the -B option with this information inside my default.mspec file but in my install of mspec, the default.mspec never gets loaded as the ruby_exe.rb is required before the mspec.default file and it blows up inside ruby_exe.rb. The reason that mspec-debug.rb works is that the RUBY_EXE constant is defined before mspec and therefore ruby_exe are required. What version of mspec are you running? Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Wednesday,25 February 25, 2009 21:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs I checked a bit, and I don't have a RUBY_EXE environment variable, or a %HOME%\.mspecrc file. Peter, did you use "-B /path/to/default.mspec" in the ir.exe command-line, and does it set :target? I do have both of these, and maybe that is why it works for me. If mspec-debug.rb works for you, sure, you should add a note on the wiki about it. I would be fine with using either a default.mspec (which already exists) or a mspec-debug.rb. Thanks, Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin Sent: Tuesday, February 24, 2009 3:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Debugging rubyspecs OK, this is what I mean. I save the following file (attached also) as Merlin/Main/Languages/Ruby/mspec-debug.rb: RUBY_EXE = 'd:/dev/ruby/ironruby/current/Merlin/Main/Bin/debug/ir.exe' $:.unshift 'd:/dev/ruby/mspec/lib' require 'mspec/commands/mspec-run' require 'mspec' class MSpecScript set :target, RUBY_EXE set :flags, [ ' -D'] set :ci_files, ["rubyspec/1.8/core",] set :tags_patterns, [ [%r(rubyspec/), 'ironruby-tags/'], [/_spec.rb$/, '_tags.txt'] ] end MSpecRun.main Once you have modified the paths for your setup, you can then run this file just like mspec-run: /path/to/ir.exe mspec-debug.rb /path/to/rubyspec/some_spec.rb In the VS Ruby.Console project properties I set the following: Start Action: Start Project Start Options: Command Line Options: -D mspec-debug.rb -V d:/dev/ruby/rubyspec/core/fixnum/abs_spec.rb Working Directory: D:\dev\ruby\ironruby\current\Merlin\Main\Languages\Ruby\ Then I can set breakpoints in the C# code to debug and so on. This solution is self contained, doesn't require any environment variables, doesn't spawn any sub processes and doesn't rely on mspec guessing the ruby engine. I personally don't feel that it uses too much of the internals of mspec: the configuration bits are public interfaces to mspec and all we are doing is including a couple of files (that are unlikely to change name) and running a single class method. Let me know what you think. Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Thu Feb 26 14:55:10 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 26 Feb 2009 11:55:10 -0800 Subject: [Ironruby-core] Code Review: numeric types Message-ID: <710DF26F214D2B4BB94287123FFE980A2E0CF48040@NA-EXMSG-C104.redmond.corp.microsoft.com> tfpt review "/shelveset:num;REDMOND\sborde" Comment : Fixnum + Bignum should yield a Bignum, not a Float. This was causing complex/denominator_spec to fail as Bignum was monkey-patched and not Float. A different return type affects whether the monkey-patched method is visible or not. Also changed fixnum/plus_spec to check for the result type. BigDecimal coercing works a bit differently. So added a protocol for that. Small change to the MSpec eql guard to show the type of actual and expected values since the inspect string itself can be identical. Tomas, I had added tests for Enumerable#each_cons each_slice. Let me know if you want to grab them since you are working on the fix. Else, I can check it in with tags (will need to move it from library/enumerator to core/enumerable). -------------- next part -------------- A non-text attachment was scrubbed... Name: num.diff Type: application/octet-stream Size: 54118 bytes Desc: num.diff URL: From Tomas.Matousek at microsoft.com Thu Feb 26 16:07:42 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 26 Feb 2009 13:07:42 -0800 Subject: [Ironruby-core] Code Review: numeric types In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E0CF48040@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <710DF26F214D2B4BB94287123FFE980A2E0CF48040@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Looks good. Tomas -----Original Message----- From: Shri Borde Sent: Thursday, February 26, 2009 11:55 AM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: numeric types tfpt review "/shelveset:num;REDMOND\sborde" Comment : Fixnum + Bignum should yield a Bignum, not a Float. This was causing complex/denominator_spec to fail as Bignum was monkey-patched and not Float. A different return type affects whether the monkey-patched method is visible or not. Also changed fixnum/plus_spec to check for the result type. BigDecimal coercing works a bit differently. So added a protocol for that. Small change to the MSpec eql guard to show the type of actual and expected values since the inspect string itself can be identical. Tomas, I had added tests for Enumerable#each_cons each_slice. Let me know if you want to grab them since you are working on the fix. Else, I can check it in with tags (will need to move it from library/enumerator to core/enumerable). From lists at ruby-forum.com Thu Feb 26 17:17:53 2009 From: lists at ruby-forum.com (Mr X enterprises) Date: Thu, 26 Feb 2009 23:17:53 +0100 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: Sorry, I have another problem: engine.Operations.CreateInstance(rubyClass) It is saying that CreateInstance is not a member of Microsoft.Scripting.Hosting.ObjectOperations. There are Create() and CreateObjRef() functions. Any help? Thanks. :) -- Posted via http://www.ruby-forum.com/. From thibaut.barrere at gmail.com Thu Feb 26 17:25:41 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Thu, 26 Feb 2009 23:25:41 +0100 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted Message-ID: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> Hi, I started working on UI bits, both for Ivan book and because my customers are interested (and well - because it's fun, too!). First topic is how to build menus more easily (next one will be long running operations and how to sugar them). I'd be interested to get your opinion on both the DSL syntax (below for quick read or here on github) and the implementation . form.menu = MainMenu.build do item("&File") { item("&New") { item("Spreadsheet") item("Document") } item "&Quit", lambda { Application.Exit } } item("&Tools") { item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } item "&Scissors" } end what do you think ? cheers, Thibaut Barr?re -- LoGeek [blog] http://evolvingworker.com - tools for a better day [blog] http://blog.logeek.fr - about writing software -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Thu Feb 26 17:41:48 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Thu, 26 Feb 2009 23:41:48 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" Message-ID: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> Hi again, I'm using Mono 2.4 to run the binaries at http://nightlybuilds.cloudapp.net/rss.ashx?project=dlr(DLR.xxxxx.release.zip) - (not sure if it supposed to work, but it did until today). Everything I tried worked fine with DLR.10606.release.zip. Switching to the latest DLR.12211.release.zip makes "require 'mscorlib'" throw the following error: mscorlib:0:in `CreateDelegate': Invalid IL code in (wrapper dynamic-method) object:CallSite.Target (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString): IL_0024: pop (System::InvalidProgramException) from mscorlib:0:in `CreateDelegate' from mscorlib:0:in `CreateDelegate' from Microsoft.Scripting.Core:0:in `CreateDelegate' from Microsoft.Scripting.Core:0:in `Compile' from Microsoft.Scripting.Core:0:in `Compile' from Microsoft.Scripting.Core:0:in `SetTarget' Is it a know issue ? (I'm staying on previous builds for the moment). -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Thu Feb 26 18:04:00 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 26 Feb 2009 15:04:00 -0800 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: Do you have the latest build? See http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Mr X enterprises Sent: Thursday, February 26, 2009 2:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Getting started in VB? Sorry, I have another problem: engine.Operations.CreateInstance(rubyClass) It is saying that CreateInstance is not a member of Microsoft.Scripting.Hosting.ObjectOperations. There are Create() and CreateObjRef() functions. Any help? Thanks. :) -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Thu Feb 26 18:13:26 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 26 Feb 2009 15:13:26 -0800 Subject: [Ironruby-core] Code Review: MiscFixes Message-ID: tfpt review "/shelveset:MiscFixes;REDMOND\tomat" Comment : Implements Ruby protected visibility, fixes other bugs in Module (all specs pass now) and assignment in eval. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: MiscFixes.diff Type: application/octet-stream Size: 54986 bytes Desc: MiscFixes.diff URL: From jdeville at microsoft.com Thu Feb 26 18:32:55 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 26 Feb 2009 15:32:55 -0800 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted In-Reply-To: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> References: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> Message-ID: I think it looks very nice. It's a shame that you have to resort to direct lambda's since you can't pass two lambda's in, but otherwise it's a nice visual representation of the menu, in code. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Thursday, February 26, 2009 2:26 PM To: ironruby-core Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted Hi, I started working on UI bits, both for Ivan book and because my customers are interested (and well - because it's fun, too!). First topic is how to build menus more easily (next one will be long running operations and how to sugar them). I'd be interested to get your opinion on both the DSL syntax (below for quick read or here on github) and the implementation. form.menu = MainMenu.build do item("&File") { item("&New") { item("Spreadsheet") item("Document") } item "&Quit", lambda { Application.Exit } } item("&Tools") { item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } item "&Scissors" } end what do you think ? cheers, Thibaut Barr?re -- LoGeek [blog] http://evolvingworker.com - tools for a better day [blog] http://blog.logeek.fr - about writing software -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Feb 27 00:35:01 2009 From: lists at ruby-forum.com (Mr X Enterprises) Date: Fri, 27 Feb 2009 06:35:01 +0100 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> Message-ID: I got the newest build. It said use Invoke() instead of Call(), so I used Invoke(). I get and exception for: engine.Operations.Call(rubyMethod, params) saying: wrong number of arguments (1 for 2) Thanks for all of your help. :) -- Posted via http://www.ruby-forum.com/. From Jimmy.Schementi at microsoft.com Fri Feb 27 01:23:06 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 26 Feb 2009 22:23:06 -0800 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> , Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB399E58@NA-EXMSG-C116.redmond.corp.microsoft.com> What does "params" contain? If I recall, the method you're calling requires two parameters ... ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Mr X Enterprises [lists at ruby-forum.com] Sent: Thursday, February 26, 2009 9:35 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Getting started in VB? I got the newest build. It said use Invoke() instead of Call(), so I used Invoke(). I get and exception for: engine.Operations.Call(rubyMethod, params) saying: wrong number of arguments (1 for 2) Thanks for all of your help. :) -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From ivan at flanders.co.nz Fri Feb 27 01:41:49 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 27 Feb 2009 07:41:49 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> Message-ID: I can confirm this but from git. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Thu, Feb 26, 2009 at 11:41 PM, Thibaut Barr?re wrote: > Hi again, > I'm using Mono 2.4 to run the binaries at > http://nightlybuilds.cloudapp.net/rss.ashx?project=dlr(DLR.xxxxx.release.zip) - (not sure if it supposed to work, but it did until > today). > > Everything I tried worked fine with DLR.10606.release.zip. Switching to the > latest DLR.12211.release.zip makes "require 'mscorlib'" throw the following > error: > > mscorlib:0:in `CreateDelegate': Invalid IL code in (wrapper dynamic-method) > object:CallSite.Target > (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString): > IL_0024: pop > > (System::InvalidProgramException) > from mscorlib:0:in `CreateDelegate' > from mscorlib:0:in `CreateDelegate' > from Microsoft.Scripting.Core:0:in `CreateDelegate' > from Microsoft.Scripting.Core:0:in `Compile' > from Microsoft.Scripting.Core:0:in `Compile' > from Microsoft.Scripting.Core:0:in `SetTarget' > > Is it a know issue ? (I'm staying on previous builds for the moment). > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Feb 27 01:55:05 2009 From: lists at ruby-forum.com (Mr X Enterprises) Date: Fri, 27 Feb 2009 07:55:05 +0100 Subject: [Ironruby-core] Getting started in VB? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB399E58@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <314bc8fa6c5b2a85532982ad12a4ef67@ruby-forum.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB399E58@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Dim params() As Integer = {1, 2} -- Posted via http://www.ruby-forum.com/. From jdeville at microsoft.com Fri Feb 27 02:42:11 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 26 Feb 2009 23:42:11 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> Message-ID: Can anyone confirm if this is only a Mono problem? Also, what platform x86 or x64 (doubt it makes a difference, but I want to be certain)? I can?t repro on .NET. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Thursday, February 26, 2009 10:42 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" I can confirm this but from git. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Thu, Feb 26, 2009 at 11:41 PM, Thibaut Barr?re > wrote: Hi again, I'm using Mono 2.4 to run the binaries at http://nightlybuilds.cloudapp.net/rss.ashx?project=dlr (DLR.xxxxx.release.zip) - (not sure if it supposed to work, but it did until today). Everything I tried worked fine with DLR.10606.release.zip. Switching to the latest DLR.12211.release.zip makes "require 'mscorlib'" throw the following error: mscorlib:0:in `CreateDelegate': Invalid IL code in (wrapper dynamic-method) object:CallSite.Target (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString): IL_0024: pop (System::InvalidProgramException) from mscorlib:0:in `CreateDelegate' from mscorlib:0:in `CreateDelegate' from Microsoft.Scripting.Core:0:in `CreateDelegate' from Microsoft.Scripting.Core:0:in `Compile' from Microsoft.Scripting.Core:0:in `Compile' from Microsoft.Scripting.Core:0:in `SetTarget' Is it a know issue ? (I'm staying on previous builds for the moment). -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Fri Feb 27 02:52:20 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 27 Feb 2009 08:52:20 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> Message-ID: It seems that it's only a mono problem. I use mono from trunk. and to repro it I built Michaels linux branch Then I just enter a console and do require 'rubygems' that did it for me. On Fri, Feb 27, 2009 at 8:42 AM, Jim Deville wrote: > Can anyone confirm if this is only a Mono problem? Also, what platform > x86 or x64 (doubt it makes a difference, but I want to be certain)? I can?t > repro on .NET. > > > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Thursday, February 26, 2009 10:42 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper > dynamic-method)" > > > > I can confirm this but from git. > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > GSM: +32.486.787.582 > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > > > On Thu, Feb 26, 2009 at 11:41 PM, Thibaut Barr?re < > thibaut.barrere at gmail.com> wrote: > > Hi again, > > > > I'm using Mono 2.4 to run the binaries at > http://nightlybuilds.cloudapp.net/rss.ashx?project=dlr(DLR.xxxxx.release.zip) - (not sure if it supposed to work, but it did until > today). > > > > Everything I tried worked fine with DLR.10606.release.zip. Switching to the > latest DLR.12211.release.zip makes "require 'mscorlib'" throw the following > error: > > > > mscorlib:0:in `CreateDelegate': Invalid IL code in (wrapper dynamic-method) > object:CallSite.Target > (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString): > IL_0024: pop > > > > (System::InvalidProgramException) > > from mscorlib:0:in `CreateDelegate' > > from mscorlib:0:in `CreateDelegate' > > from Microsoft.Scripting.Core:0:in `CreateDelegate' > > from Microsoft.Scripting.Core:0:in `Compile' > > from Microsoft.Scripting.Core:0:in `Compile' > > from Microsoft.Scripting.Core:0:in `SetTarget' > > > > Is it a know issue ? (I'm staying on previous builds for the moment). > > > > -- Thibaut > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jb at nurv.fr Fri Feb 27 03:08:59 2009 From: jb at nurv.fr (Jb Evain) Date: Fri, 27 Feb 2009 09:08:59 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> Message-ID: <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Hey Jim, On 2/27/09, Jim Deville wrote: > Can anyone confirm if this is only a Mono problem? Also, what platform x86 > or x64 (doubt it makes a difference, but I want to be certain)? I can?t > repro on .NET. Let say it's a shared problem :) The issue comes from our verifier, which, well, verifies the whole method body. It's shocking on a dynamic method which looks like: ldc.i4.1 brfalse target ldarg.3 call foo ret pop target: ldarg.1 call bar bla bla bla ... The issue is the pop, in between the ret and the jump target. .net's JIT will optimize it away, and not even verify it, as it will never be executed. But our verifier, well, verifies the whole method body, hence the InvalidProgramException. We've had this issue already with some obfuscators injecting plain non sense, so I guess at some point we'll fix it on our side. It would be nice if IronRuby could emit nice and verifiable code though. -- Jb Evain From ivan at flanders.co.nz Fri Feb 27 03:42:33 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 27 Feb 2009 09:42:33 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: It isn't relevant to this problem but is there a reference or a good book for IL generation? Or some links? On Fri, Feb 27, 2009 at 9:08 AM, Jb Evain wrote: > Hey Jim, > > On 2/27/09, Jim Deville wrote: > > Can anyone confirm if this is only a Mono problem? Also, what platform > x86 > > or x64 (doubt it makes a difference, but I want to be certain)? I can?t > > repro on .NET. > > Let say it's a shared problem :) > > The issue comes from our verifier, which, well, verifies the whole > method body. It's shocking on a dynamic method which looks like: > > ldc.i4.1 > brfalse target > ldarg.3 > call foo > ret > pop > > target: > > ldarg.1 > call bar > bla bla bla > ... > > The issue is the pop, in between the ret and the jump target. .net's > JIT will optimize it away, and not even verify it, as it will never be > executed. > > But our verifier, well, verifies the whole method body, hence the > InvalidProgramException. > > We've had this issue already with some obfuscators injecting plain non > sense, so I guess at some point we'll fix it on our side. It would be > nice if IronRuby could emit nice and verifiable code though. > > -- > Jb Evain > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dotnetguy at gmail.com Fri Feb 27 03:52:23 2009 From: dotnetguy at gmail.com (Brad Wilson) Date: Fri, 27 Feb 2009 00:52:23 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: <6bbcce480902270052s582ed256r2d87feeb4a4e7def@mail.gmail.com> Serge Liden's book is probably the bible for MSIL 2.0. http://www.amazon.com/Expert-NET-2-0-IL-Assembler/dp/1590596463 IL generation is the trivial part, once you actually understand IL. :) On Fri, Feb 27, 2009 at 12:42 AM, Ivan Porto Carrero wrote: > It isn't relevant to this problem but is there a reference or a good book > for IL generation? > Or some links? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jb at nurv.fr Fri Feb 27 04:15:01 2009 From: jb at nurv.fr (Jb Evain) Date: Fri, 27 Feb 2009 10:15:01 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: <69f7d8470902270115i270af6bep8d4853ab7a4347d@mail.gmail.com> On 2/27/09, Jb Evain wrote: > The issue is the pop, in between the ret and the jump target. .net's > JIT will optimize it away, and not even verify it, as it will never be > executed. It's definitely a common pattern: push condition brfalse target ldarg 3 // action on the RubyContext ret pop target: bla bla bla I guess it shouldn't be too hard for you guys to bisect where the issues comes from between 10606:12221. -- Jb Evain From ivan at flanders.co.nz Fri Feb 27 05:44:46 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 27 Feb 2009 11:44:46 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <6bbcce480902270052s582ed256r2d87feeb4a4e7def@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> <6bbcce480902270052s582ed256r2d87feeb4a4e7def@mail.gmail.com> Message-ID: Great thanks, ordered it :) On Fri, Feb 27, 2009 at 9:52 AM, Brad Wilson wrote: > Serge Liden's book is probably the bible for MSIL 2.0. > http://www.amazon.com/Expert-NET-2-0-IL-Assembler/dp/1590596463 > > IL generation is the trivial part, once you actually understand IL. :) > > On Fri, Feb 27, 2009 at 12:42 AM, Ivan Porto Carrero wrote: > >> It isn't relevant to this problem but is there a reference or a good book >> for IL generation? >> Or some links? >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Fri Feb 27 12:08:57 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 27 Feb 2009 09:08:57 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: If this is true we should fix it. I'll investigate. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jb Evain Sent: Friday, February 27, 2009 12:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" Hey Jim, On 2/27/09, Jim Deville wrote: > Can anyone confirm if this is only a Mono problem? Also, what platform x86 > or x64 (doubt it makes a difference, but I want to be certain)? I can't > repro on .NET. Let say it's a shared problem :) The issue comes from our verifier, which, well, verifies the whole method body. It's shocking on a dynamic method which looks like: ldc.i4.1 brfalse target ldarg.3 call foo ret pop target: ldarg.1 call bar bla bla bla ... The issue is the pop, in between the ret and the jump target. .net's JIT will optimize it away, and not even verify it, as it will never be executed. But our verifier, well, verifies the whole method body, hence the InvalidProgramException. We've had this issue already with some obfuscators injecting plain non sense, so I guess at some point we'll fix it on our side. It would be nice if IronRuby could emit nice and verifiable code though. -- Jb Evain _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Fri Feb 27 12:40:29 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 27 Feb 2009 09:40:29 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: Jim, could you push the latest sources to GIT? Jb, could you try again using the latest source code (after Jim pushes it) and if it fails send me please full stack trace and complete IL of the offending method? Thanks, Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jb Evain Sent: Friday, February 27, 2009 12:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" Hey Jim, On 2/27/09, Jim Deville wrote: > Can anyone confirm if this is only a Mono problem? Also, what platform x86 > or x64 (doubt it makes a difference, but I want to be certain)? I can't > repro on .NET. Let say it's a shared problem :) The issue comes from our verifier, which, well, verifies the whole method body. It's shocking on a dynamic method which looks like: ldc.i4.1 brfalse target ldarg.3 call foo ret pop target: ldarg.1 call bar bla bla bla ... The issue is the pop, in between the ret and the jump target. .net's JIT will optimize it away, and not even verify it, as it will never be executed. But our verifier, well, verifies the whole method body, hence the InvalidProgramException. We've had this issue already with some obfuscators injecting plain non sense, so I guess at some point we'll fix it on our side. It would be nice if IronRuby could emit nice and verifiable code though. -- Jb Evain _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From jdeville at microsoft.com Fri Feb 27 12:59:32 2009 From: jdeville at microsoft.com (Jim Deville) Date: Fri, 27 Feb 2009 09:59:32 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: I have just pushed the latest. JD > -----Original Message----- > From: Tomas Matousek > Sent: Friday, February 27, 2009 9:40 AM > To: Jim Deville; ironruby-core at rubyforge.org > Subject: RE: [Ironruby-core] Regression ? "Invalid IL code in (wrapper > dynamic-method)" > > Jim, could you push the latest sources to GIT? > Jb, could you try again using the latest source code (after Jim pushes > it) and if it fails send me please full stack trace and complete IL of > the offending method? > > Thanks, > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jb Evain > Sent: Friday, February 27, 2009 12:09 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper > dynamic-method)" > > Hey Jim, > > On 2/27/09, Jim Deville wrote: > > Can anyone confirm if this is only a Mono problem? Also, what > platform x86 > > or x64 (doubt it makes a difference, but I want to be certain)? I > can't > > repro on .NET. > > Let say it's a shared problem :) > > The issue comes from our verifier, which, well, verifies the whole > method body. It's shocking on a dynamic method which looks like: > > ldc.i4.1 > brfalse target > ldarg.3 > call foo > ret > pop > > target: > > ldarg.1 > call bar > bla bla bla > ... > > The issue is the pop, in between the ret and the jump target. .net's > JIT will optimize it away, and not even verify it, as it will never be > executed. > > But our verifier, well, verifies the whole method body, hence the > InvalidProgramException. > > We've had this issue already with some obfuscators injecting plain non > sense, so I guess at some point we'll fix it on our side. It would be > nice if IronRuby could emit nice and verifiable code though. > > -- > Jb Evain > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From jb at nurv.fr Fri Feb 27 14:47:05 2009 From: jb at nurv.fr (Jb Evain) Date: Fri, 27 Feb 2009 20:47:05 +0100 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> Message-ID: <69f7d8470902271147y544f0024me7e62ea713fc1d4@mail.gmail.com> Hey Tomas, On 2/27/09, Tomas Matousek wrote: > Jb, could you try again using the latest source code (after Jim pushes it) and if it fails send me please full stack trace and complete IL of the offending method? Sure. So, after building from source the updated git repo, we have a different error, but similar error. I'm simply executing mono ir.exe test.rb, where test.rb only contains a call to `require "mscorlib"`. The stacktrace looks like this: (gdb) bt #0 mono_method_to_ir (cfg=0x8ec0ac0, method=0x8ecbce8, start_bblock=0x8ec48b4, end_bblock=0x8ec494c, return_var=0x0, dont_inline=0x8ec9a60, inline_args=0x0, inline_offset=0, is_virtual_call=0)at method-to-ir.c:4606 #1 0x0806124d in mini_method_compile (method=0x8ecbce8, opts=64055807, domain=0x25ee0, run_cctors=, compile_aot=, parts=0) at mini.c:3208 #2 0x08062b19 in mono_jit_compile_method (method=0x8ecbce8) at mini.c:3847 #3 0x0818ef88 in ves_icall_System_Delegate_CreateDelegate_internal (type=0xc6960, target=0x1f27b0, info=0x2e0a0) at icall.c:5988 #4 0xb6c9ae43 in (wrapper managed-to-native) System.Delegate:CreateDelegate_internal (param0=0xc6960, param1=0x1f27b0, param2=0x2e0a0) at xdb.il:7790 #5 0xb6c9ab34 in System.Delegate:CreateDelegate (type=0xc6960, firstArgument=0x1f27b0, method=0x2e0a0, throwOnBindFailure=true)at /home/jbevain/sources/mcs/class/corlib/System/Delegate.cs:256 #6 0xb6c9a6e6 in System.Delegate:CreateDelegate (type=0xc6960, firstArgument=0x1f27b0, method=0x2e0a0) at /home/jbevain/sources/mcs/class/corlib/System/Delegate.cs:263 #7 0xb6bc152b in System.Reflection.Emit.DynamicMethod:CreateDelegate (this=0x2e0a0, delegateType=0xc6960, target=0x1f27b0) at /home/jbevain/sources/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs:189 #8 0xb6bc14c8 in System.Dynamic.Utils.TypeExtensions:CreateDelegate (methodInfo=0x2e0a0, delegateType=0xc6960, target=0x1f27b0) at xdb.il:44617 #9 0xb6bc13d7 in System.Linq.Expressions.Compiler.LambdaCompiler:CreateDelegate (this=0x1f17e0) at xdb.il:44564 #10 0xb6bcb61f in System.Linq.Expressions.Compiler.LambdaCompiler:Compile (lambda=0x1f0ca0) at xdb.il:34475 #11 0xb6bcb57c in System.Linq.Expressions.Expression`1:Compile (this=0x1f0ca0) #12 0xb6b722ba in System.Dynamic.SmallRuleSet`1:MakeTarget (this=0x1f3c60) #13 0xb6b72235 in System.Dynamic.SmallRuleSet`1:GetTarget (this=0x1f3c60) #14 0xb6b721ea in System.Runtime.CompilerServices.CallSiteOps:SetTarget(site=1120512, rule=2047096) #15 0xb6bc293b in System.Dynamic.UpdateDelegates:UpdateAndExecute3 (site=0xe9940, arg0=0x5ab80, arg1=0x50cf0, arg2=0x111528) #16 0xb6bbe81c in (wrapper static-rgctx-invoke) System.Dynamic.UpdateDelegates:static_rgctx_invoke_object_CallSite_RubyScope_object_MutableString (param0=0x111900, param1=0x5ab80, param2=0x50cf0, param3=0x111528)at xdb.il:43447 #17 0xb6ba3120 in (wrapper dynamic-method) object:IR;#;test.rb;0; (param0=0xe9ab0, param1=0x111d50, param2=0x25aa0) at xdb.il:44669 #18 0xb6bcb2b8 in Microsoft.Scripting.ScriptCode:InvokeTarget (this=0x111d68, code=0x4e700, scope=0x111d50) at xdb.il:34374 #19 0xb6bcb279 in Microsoft.Scripting.ScriptCode:Run (this=0x111d68, scope=0x111d50) at xdb.il:34361 #20 0xb6bcb1f3 in Microsoft.Scripting.ScriptCode:Run (this=0x111d68) at xdb.il:34331 #21 0xb6beac36 in IronRuby.Runtime.RubyContext:ExecuteProgram (this=0x25aa0, program=0xe2eb0) at xdb.il:17847 #22 0xb6beab8d in Microsoft.Scripting.Hosting.ScriptSource:ExecuteProgram (this=0x8b978) at xdb.il:17816 #23 0xb6beab2c in (wrapper remoting-invoke-with-check) Microsoft.Scripting.Hosting.ScriptSource:ExecuteProgram (this=0x8b978) at xdb.il:17807 #24 0xb6beaa4e in Microsoft.Scripting.Hosting.Shell.CommandLine:RunFile (this=0xe2f00, source=0x8b978) at xdb.il:17749 #25 0xb6bea389 in IronRuby.Hosting.RubyCommandLine:RunFile (this=0xe2f00, fileName=0x48fe0) at xdb.il:17406 #26 0xb6bea2d2 in Microsoft.Scripting.Hosting.Shell.CommandLine:Run (this=0xe2f00) at xdb.il:17363 #27 0xb6bea103 in Microsoft.Scripting.Hosting.Shell.CommandLine:Run (this=0xe2f00, engine=0x4e880, console=0xe2ed8, options=0x4b320) at xdb.il:17265 #28 0xb6be5570 in Microsoft.Scripting.Hosting.Shell.ConsoleHost:RunCommandLine(this=0x4bfc8) at xdb.il:16737 #29 0xb6be5370 in Microsoft.Scripting.Hosting.Shell.ConsoleHost:ExecuteInternal(this=0x4bfc8) at xdb.il:16638 #30 0xb6be520e in Microsoft.Scripting.Hosting.Shell.ConsoleHost:Execute (this=0x4bfc8) at xdb.il:16568 #31 0xb780b81b in Microsoft.Scripting.Hosting.Shell.ConsoleHost:Run (this=0x4bfc8, args=0x29f48) at xdb.il:276 #32 0xb780b2ca in RubyConsoleHost:Main (args=0x29f48) at xdb.il:79 #33 0xb780b203 in (wrapper runtime-invoke) RubyConsoleHost:runtime_invoke_int_object (param0=, param1=-1073746312, param2=0, param3=-1216302424) at xdb.il:53 #34 0x0814551e in mono_runtime_exec_main (method=0x82cdde4, args=0x29f48, exc=0x0) at object.c:3335 #35 0x08145c3b in mono_runtime_run_main (method=0x82cdde4, argc=1, argv=0xbffff0d8, exc=0x0) at object.c:3123 #36 0x080b1b0a in mono_main (argc=3, argv=0xbffff0d4) at driver.c:969 #37 0x0805aff1 in main (argc=149723456, argv=0x0) at main.c:34 (gdb) And most importantly, the code that is trying to be emitted by the DynamicMethod is as follows: (gdb) p mono_method_get_header(method)->code $1 = (const unsigned char *) 0x8ec15e0 "\005\002{\001" (gdb) p mono_method_get_header(method)->code_size $2 = 198 (gdb) p mono_disasm_code (0, method, 0x8ec15e0, 0x8ec15e0 + 198) IL_0000: ldarg.3 IL_0001: ldarg.0 IL_0002: ldfld IL_0007: ldc.i4.0 IL_0008: ldelem.ref IL_0009: ceq IL_000b: brfalse IL_00a3 IL_0010: ldarg.2 IL_0011: call IL_0016: ldarg.0 IL_0017: ldfld IL_001c: ldc.i4.1 IL_001d: ldelem.ref IL_001e: castclass IL_0023: ceq IL_0025: brfalse IL_00a3 IL_002a: ldarg.s 4 IL_002c: brfalse IL_00a3 IL_0031: ldarg.s 4 IL_0033: castclass IL_0038: callvirt IL_003d: ldtoken IL_0042: call IL_0047: ceq IL_0049: brfalse IL_00a3 IL_004e: ldarg.0 IL_004f: ldfld IL_0054: ldc.i4.2 IL_0055: ldelem.ref IL_0056: castclass IL_005b: ldfld IL_0060: ldc.i4 189 IL_0065: ceq IL_0067: brfalse IL_009d IL_006c: ldarg.2 IL_006d: ldarg.3 IL_006e: ldarg.0 IL_006f: ldfld IL_0074: ldc.i4.3 IL_0075: ldelem.ref IL_0076: castclass IL_007b: dup IL_007c: stloc.0 IL_007d: ldfld IL_0082: ldloc.0 IL_0083: ldarg.2 IL_0084: call IL_0089: ldarg.s 4 IL_008b: callvirt :Invoke (System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString)> IL_0090: call IL_0095: tail. IL_0097: call IL_009c: ret IL_009d: br IL_00a3 IL_00a2: ret IL_00a3: ldarg.1 IL_00a4: call IL_00a9: brfalse IL_00b0 IL_00ae: ldnull IL_00af: ret IL_00b0: ldarg.1 IL_00b1: castclass IL_00b6: callvirt >:get_Update ()> IL_00bb: ldarg.1 IL_00bc: ldarg.2 IL_00bd: ldarg.3 IL_00be: ldarg.s 4 IL_00c0: callvirt :Invoke (System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyScope,object,IronRuby.Builtins.MutableString)> IL_00c5: ret The issue here is the instruction: IL_00a2: ret With is right after an unconditional branch, thus will be executed, but the IL is still wrong. -- Jb Evain From thibaut.barrere at gmail.com Fri Feb 27 14:54:46 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 27 Feb 2009 20:54:46 +0100 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted In-Reply-To: References: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> Message-ID: <4a68b8cf0902271154n3a1fe830i8f6fc635cb977d85@mail.gmail.com> Hi, > I think it looks very nice. It?s a shame that you have to resort to direct > lambda?s since you can?t pass two lambda?s in, but otherwise it?s a nice > visual representation of the menu, in code. > thanks for the feedback, appreciated! I just realised that I can also use this (without modifying the implementation): item("&PowerBlade").click { MessageBox.Show("Powerblades are amazing...") } instead of item("&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } same effect, slightly more readable though. cheers, and I shall move on to long running operations. -- Thibaut > > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Thursday, February 26, 2009 2:26 PM > *To:* ironruby-core > *Subject:* [Ironruby-core] A tiny DSL to build Windows::Forms menus from > IronRuby - review wanted > > > > Hi, > > > > I started working on UI bits, both for Ivan book and because my customers > are interested (and well - because it's fun, too!). First topic is how to > build menus more easily (next one will be long running operations and how to > sugar them). > > > > I'd be interested to get your opinion on both the DSL syntax (below for > quick read or here on > github) and the implementation > . > > > > form.menu = MainMenu.build do > item("&File") { > item("&New") { > item("Spreadsheet") > item("Document") > } > item "&Quit", lambda { Application.Exit } > } > item("&Tools") { > > item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } > item "&Scissors" > } > end > > > > what do you think ? > > > > cheers, > > > > Thibaut Barr?re > > -- > LoGeek > [blog] http://evolvingworker.com - tools for a better day > [blog] http://blog.logeek.fr - about writing software > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Fri Feb 27 17:45:34 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 27 Feb 2009 23:45:34 +0100 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted In-Reply-To: <4a68b8cf0902271154n3a1fe830i8f6fc635cb977d85@mail.gmail.com> References: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> <4a68b8cf0902271154n3a1fe830i8f6fc635cb977d85@mail.gmail.com> Message-ID: <4a68b8cf0902271445x128de271kf35f1c17b3037090@mail.gmail.com> After chatting with Ivan, I created some code to build Forms too: form = Magic.build do form(:text => "Hello") do flow_layout_panel(:dock => DockStyle.fill) do button(:text => "Click me!", :click => lambda { MessageBox.Show("Hello") }) button(:text => "Quit", :click => lambda { Application.Exit }) end end end * * I use method_missing and transform the method name from flow_layout_panel to FlowLayoutPanel class etc. After using these a bit, I'm pretty sure we'll end up with some community project sharing that kind of stuff, at some point. Nb: I hope it's not OT for the core list - or is it time to create a user group ? cheers, -- Thibaut On Fri, Feb 27, 2009 at 8:54 PM, Thibaut Barr?re wrote: > Hi, > >> I think it looks very nice. It?s a shame that you have to resort to direct >> lambda?s since you can?t pass two lambda?s in, but otherwise it?s a nice >> visual representation of the menu, in code. >> > thanks for the feedback, appreciated! > > I just realised that I can also use this (without modifying the > implementation): > > item("&PowerBlade").click { MessageBox.Show("Powerblades are > amazing...") } > > instead of > > item("&PowerBlade", lambda { MessageBox.Show("Powerblades are > amazing...") } > > same effect, slightly more readable though. > > cheers, and I shall move on to long running operations. > > -- Thibaut > > >> >> >> JD >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re >> *Sent:* Thursday, February 26, 2009 2:26 PM >> *To:* ironruby-core >> *Subject:* [Ironruby-core] A tiny DSL to build Windows::Forms menus from >> IronRuby - review wanted >> >> >> >> Hi, >> >> >> >> I started working on UI bits, both for Ivan book and because my customers >> are interested (and well - because it's fun, too!). First topic is how to >> build menus more easily (next one will be long running operations and how to >> sugar them). >> >> >> >> I'd be interested to get your opinion on both the DSL syntax (below for >> quick read or here on >> github) and the implementation >> . >> >> >> >> form.menu = MainMenu.build do >> item("&File") { >> item("&New") { >> item("Spreadsheet") >> item("Document") >> } >> item "&Quit", lambda { Application.Exit } >> } >> item("&Tools") { >> >> item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } >> item "&Scissors" >> } >> end >> >> >> >> what do you think ? >> >> >> >> cheers, >> >> >> >> Thibaut Barr?re >> >> -- >> LoGeek >> [blog] http://evolvingworker.com - tools for a better day >> [blog] http://blog.logeek.fr - about writing software >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Fri Feb 27 17:48:33 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 27 Feb 2009 14:48:33 -0800 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted In-Reply-To: <4a68b8cf0902271445x128de271kf35f1c17b3037090@mail.gmail.com> References: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> <4a68b8cf0902271154n3a1fe830i8f6fc635cb977d85@mail.gmail.com> <4a68b8cf0902271445x128de271kf35f1c17b3037090@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C58C@NA-EXMSG-C116.redmond.corp.microsoft.com> Awesome stuff! If you make this into its own github project, I can add it to http://github.com/ironruby/ironruby-contrib as a submodule. That'll force me to keep it updated =) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Friday, February 27, 2009 2:46 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted After chatting with Ivan, I created some code to build Forms too: form = Magic.build do form(:text => "Hello") do flow_layout_panel(:dock => DockStyle.fill) do button(:text => "Click me!", :click => lambda { MessageBox.Show("Hello") }) button(:text => "Quit", :click => lambda { Application.Exit }) end end end I use method_missing and transform the method name from flow_layout_panel to FlowLayoutPanel class etc. After using these a bit, I'm pretty sure we'll end up with some community project sharing that kind of stuff, at some point. Nb: I hope it's not OT for the core list - or is it time to create a user group ? cheers, -- Thibaut On Fri, Feb 27, 2009 at 8:54 PM, Thibaut Barr?re > wrote: Hi, I think it looks very nice. It's a shame that you have to resort to direct lambda's since you can't pass two lambda's in, but otherwise it's a nice visual representation of the menu, in code. thanks for the feedback, appreciated! I just realised that I can also use this (without modifying the implementation): item("&PowerBlade").click { MessageBox.Show("Powerblades are amazing...") } instead of item("&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } same effect, slightly more readable though. cheers, and I shall move on to long running operations. -- Thibaut JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Thursday, February 26, 2009 2:26 PM To: ironruby-core Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted Hi, I started working on UI bits, both for Ivan book and because my customers are interested (and well - because it's fun, too!). First topic is how to build menus more easily (next one will be long running operations and how to sugar them). I'd be interested to get your opinion on both the DSL syntax (below for quick read or here on github) and the implementation. form.menu = MainMenu.build do item("&File") { item("&New") { item("Spreadsheet") item("Document") } item "&Quit", lambda { Application.Exit } } item("&Tools") { item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } item "&Scissors" } end what do you think ? cheers, Thibaut Barr?re -- LoGeek [blog] http://evolvingworker.com - tools for a better day [blog] http://blog.logeek.fr - about writing software _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Fri Feb 27 17:53:05 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 27 Feb 2009 14:53:05 -0800 Subject: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" In-Reply-To: <69f7d8470902271147y544f0024me7e62ea713fc1d4@mail.gmail.com> References: <4a68b8cf0902261441n5e673ec0g5c89a8056cfb943a@mail.gmail.com> <69f7d8470902270008p36daf720l1ff47162fd3795a6@mail.gmail.com> <69f7d8470902271147y544f0024me7e62ea713fc1d4@mail.gmail.com> Message-ID: There is a bug in DLR compiler. We are working on a fix. Thanks for great report, Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jb Evain Sent: Friday, February 27, 2009 11:47 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Regression ? "Invalid IL code in (wrapper dynamic-method)" Hey Tomas, On 2/27/09, Tomas Matousek wrote: > Jb, could you try again using the latest source code (after Jim pushes it) and if it fails send me please full stack trace and complete IL of the offending method? Sure. So, after building from source the updated git repo, we have a different error, but similar error. I'm simply executing mono ir.exe test.rb, where test.rb only contains a call to `require "mscorlib"`. The stacktrace looks like this: (gdb) bt #0 mono_method_to_ir (cfg=0x8ec0ac0, method=0x8ecbce8, start_bblock=0x8ec48b4, end_bblock=0x8ec494c, return_var=0x0, dont_inline=0x8ec9a60, inline_args=0x0, inline_offset=0, is_virtual_call=0)at method-to-ir.c:4606 #1 0x0806124d in mini_method_compile (method=0x8ecbce8, opts=64055807, domain=0x25ee0, run_cctors=, compile_aot=, parts=0) at mini.c:3208 #2 0x08062b19 in mono_jit_compile_method (method=0x8ecbce8) at mini.c:3847 #3 0x0818ef88 in ves_icall_System_Delegate_CreateDelegate_internal (type=0xc6960, target=0x1f27b0, info=0x2e0a0) at icall.c:5988 #4 0xb6c9ae43 in (wrapper managed-to-native) System.Delegate:CreateDelegate_internal (param0=0xc6960, param1=0x1f27b0, param2=0x2e0a0) at xdb.il:7790 #5 0xb6c9ab34 in System.Delegate:CreateDelegate (type=0xc6960, firstArgument=0x1f27b0, method=0x2e0a0, throwOnBindFailure=true)at /home/jbevain/sources/mcs/class/corlib/System/Delegate.cs:256 #6 0xb6c9a6e6 in System.Delegate:CreateDelegate (type=0xc6960, firstArgument=0x1f27b0, method=0x2e0a0) at /home/jbevain/sources/mcs/class/corlib/System/Delegate.cs:263 #7 0xb6bc152b in System.Reflection.Emit.DynamicMethod:CreateDelegate (this=0x2e0a0, delegateType=0xc6960, target=0x1f27b0) at /home/jbevain/sources/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs:189 #8 0xb6bc14c8 in System.Dynamic.Utils.TypeExtensions:CreateDelegate (methodInfo=0x2e0a0, delegateType=0xc6960, target=0x1f27b0) at xdb.il:44617 #9 0xb6bc13d7 in System.Linq.Expressions.Compiler.LambdaCompiler:CreateDelegate (this=0x1f17e0) at xdb.il:44564 #10 0xb6bcb61f in System.Linq.Expressions.Compiler.LambdaCompiler:Compile (lambda=0x1f0ca0) at xdb.il:34475 #11 0xb6bcb57c in System.Linq.Expressions.Expression`1:Compile (this=0x1f0ca0) #12 0xb6b722ba in System.Dynamic.SmallRuleSet`1:MakeTarget (this=0x1f3c60) #13 0xb6b72235 in System.Dynamic.SmallRuleSet`1:GetTarget (this=0x1f3c60) #14 0xb6b721ea in System.Runtime.CompilerServices.CallSiteOps:SetTarget(site=1120512, rule=2047096) #15 0xb6bc293b in System.Dynamic.UpdateDelegates:UpdateAndExecute3 (site=0xe9940, arg0=0x5ab80, arg1=0x50cf0, arg2=0x111528) #16 0xb6bbe81c in (wrapper static-rgctx-invoke) System.Dynamic.UpdateDelegates:static_rgctx_invoke_object_CallSite_RubyScope_object_MutableString (param0=0x111900, param1=0x5ab80, param2=0x50cf0, param3=0x111528)at xdb.il:43447 #17 0xb6ba3120 in (wrapper dynamic-method) object:IR;#;test.rb;0; (param0=0xe9ab0, param1=0x111d50, param2=0x25aa0) at xdb.il:44669 #18 0xb6bcb2b8 in Microsoft.Scripting.ScriptCode:InvokeTarget (this=0x111d68, code=0x4e700, scope=0x111d50) at xdb.il:34374 #19 0xb6bcb279 in Microsoft.Scripting.ScriptCode:Run (this=0x111d68, scope=0x111d50) at xdb.il:34361 #20 0xb6bcb1f3 in Microsoft.Scripting.ScriptCode:Run (this=0x111d68) at xdb.il:34331 #21 0xb6beac36 in IronRuby.Runtime.RubyContext:ExecuteProgram (this=0x25aa0, program=0xe2eb0) at xdb.il:17847 #22 0xb6beab8d in Microsoft.Scripting.Hosting.ScriptSource:ExecuteProgram (this=0x8b978) at xdb.il:17816 #23 0xb6beab2c in (wrapper remoting-invoke-with-check) Microsoft.Scripting.Hosting.ScriptSource:ExecuteProgram (this=0x8b978) at xdb.il:17807 #24 0xb6beaa4e in Microsoft.Scripting.Hosting.Shell.CommandLine:RunFile (this=0xe2f00, source=0x8b978) at xdb.il:17749 #25 0xb6bea389 in IronRuby.Hosting.RubyCommandLine:RunFile (this=0xe2f00, fileName=0x48fe0) at xdb.il:17406 #26 0xb6bea2d2 in Microsoft.Scripting.Hosting.Shell.CommandLine:Run (this=0xe2f00) at xdb.il:17363 #27 0xb6bea103 in Microsoft.Scripting.Hosting.Shell.CommandLine:Run (this=0xe2f00, engine=0x4e880, console=0xe2ed8, options=0x4b320) at xdb.il:17265 #28 0xb6be5570 in Microsoft.Scripting.Hosting.Shell.ConsoleHost:RunCommandLine(this=0x4bfc8) at xdb.il:16737 #29 0xb6be5370 in Microsoft.Scripting.Hosting.Shell.ConsoleHost:ExecuteInternal(this=0x4bfc8) at xdb.il:16638 #30 0xb6be520e in Microsoft.Scripting.Hosting.Shell.ConsoleHost:Execute (this=0x4bfc8) at xdb.il:16568 #31 0xb780b81b in Microsoft.Scripting.Hosting.Shell.ConsoleHost:Run (this=0x4bfc8, args=0x29f48) at xdb.il:276 #32 0xb780b2ca in RubyConsoleHost:Main (args=0x29f48) at xdb.il:79 #33 0xb780b203 in (wrapper runtime-invoke) RubyConsoleHost:runtime_invoke_int_object (param0=, param1=-1073746312, param2=0, param3=-1216302424) at xdb.il:53 #34 0x0814551e in mono_runtime_exec_main (method=0x82cdde4, args=0x29f48, exc=0x0) at object.c:3335 #35 0x08145c3b in mono_runtime_run_main (method=0x82cdde4, argc=1, argv=0xbffff0d8, exc=0x0) at object.c:3123 #36 0x080b1b0a in mono_main (argc=3, argv=0xbffff0d4) at driver.c:969 #37 0x0805aff1 in main (argc=149723456, argv=0x0) at main.c:34 (gdb) And most importantly, the code that is trying to be emitted by the DynamicMethod is as follows: (gdb) p mono_method_get_header(method)->code $1 = (const unsigned char *) 0x8ec15e0 "\005\002{\001" (gdb) p mono_method_get_header(method)->code_size $2 = 198 (gdb) p mono_disasm_code (0, method, 0x8ec15e0, 0x8ec15e0 + 198) IL_0000: ldarg.3 IL_0001: ldarg.0 IL_0002: ldfld IL_0007: ldc.i4.0 IL_0008: ldelem.ref IL_0009: ceq IL_000b: brfalse IL_00a3 IL_0010: ldarg.2 IL_0011: call IL_0016: ldarg.0 IL_0017: ldfld IL_001c: ldc.i4.1 IL_001d: ldelem.ref IL_001e: castclass IL_0023: ceq IL_0025: brfalse IL_00a3 IL_002a: ldarg.s 4 IL_002c: brfalse IL_00a3 IL_0031: ldarg.s 4 IL_0033: castclass IL_0038: callvirt IL_003d: ldtoken IL_0042: call IL_0047: ceq IL_0049: brfalse IL_00a3 IL_004e: ldarg.0 IL_004f: ldfld IL_0054: ldc.i4.2 IL_0055: ldelem.ref IL_0056: castclass IL_005b: ldfld IL_0060: ldc.i4 189 IL_0065: ceq IL_0067: brfalse IL_009d IL_006c: ldarg.2 IL_006d: ldarg.3 IL_006e: ldarg.0 IL_006f: ldfld IL_0074: ldc.i4.3 IL_0075: ldelem.ref IL_0076: castclass IL_007b: dup IL_007c: stloc.0 IL_007d: ldfld IL_0082: ldloc.0 IL_0083: ldarg.2 IL_0084: call IL_0089: ldarg.s 4 IL_008b: callvirt :Invoke (System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,IronRuby.Builtins.MutableString)> IL_0090: call IL_0095: tail. IL_0097: call IL_009c: ret IL_009d: br IL_00a3 IL_00a2: ret IL_00a3: ldarg.1 IL_00a4: call IL_00a9: brfalse IL_00b0 IL_00ae: ldnull IL_00af: ret IL_00b0: ldarg.1 IL_00b1: castclass IL_00b6: callvirt >:get_Update ()> IL_00bb: ldarg.1 IL_00bc: ldarg.2 IL_00bd: ldarg.3 IL_00be: ldarg.s 4 IL_00c0: callvirt :Invoke (System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyScope,object,IronRuby.Builtins.MutableString)> IL_00c5: ret The issue here is the instruction: IL_00a2: ret With is right after an unconditional branch, thus will be executed, but the IL is still wrong. -- Jb Evain _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Fri Feb 27 19:39:34 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 27 Feb 2009 16:39:34 -0800 Subject: [Ironruby-core] Code Review: assemblydeps Message-ID: tfpt review "/shelveset:assemblydeps;REDMOND\tomat" Implements loading of assembly dependencies. The approach is similer to IronPython's one: hooking AssemblyResolve event and searching for assemblies in load paths. It has the same deficiencies: if there are multiple versions of assemblies in different paths and multiple dynamic languages are loaded into the AppDomain they might step on each other and load wrong assemblies. Unfortunately we can't do anything about that until CLR4. Tomas -------------- next part -------------- A non-text attachment was scrubbed... Name: assemblydeps.diff Type: application/octet-stream Size: 14013 bytes Desc: assemblydeps.diff URL: From Jimmy.Schementi at microsoft.com Fri Feb 27 20:21:08 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 27 Feb 2009 17:21:08 -0800 Subject: [Ironruby-core] Code Review: assemblydeps In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C68E@NA-EXMSG-C116.redmond.corp.microsoft.com> Does this work at all in Silverlight? > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Tomas Matousek > Sent: Friday, February 27, 2009 4:40 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: assemblydeps > > tfpt review "/shelveset:assemblydeps;REDMOND\tomat" > > Implements loading of assembly dependencies. The approach is similer > to IronPython's one: hooking AssemblyResolve event and searching for > assemblies in load paths. It has the same deficiencies: if there are > multiple versions of assemblies in different paths and multiple dynamic > languages are loaded into the AppDomain they might step on each other > and load wrong assemblies. Unfortunately we can't do anything about > that until CLR4. > > Tomas From Tomas.Matousek at microsoft.com Fri Feb 27 20:28:08 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 27 Feb 2009 17:28:08 -0800 Subject: [Ironruby-core] Code Review: assemblydeps In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C68E@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C68E@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: No, the event subscribing method (AppDomain::add_AssemblyResolve) is SecurityCritical for some reason. Tomas -----Original Message----- From: Jimmy Schementi Sent: Friday, February 27, 2009 5:21 PM To: ironruby-core at rubyforge.org; IronRuby External Code Reviewers Subject: RE: Code Review: assemblydeps Does this work at all in Silverlight? > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Tomas Matousek > Sent: Friday, February 27, 2009 4:40 PM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Code Review: assemblydeps > > tfpt review "/shelveset:assemblydeps;REDMOND\tomat" > > Implements loading of assembly dependencies. The approach is similer > to IronPython's one: hooking AssemblyResolve event and searching for > assemblies in load paths. It has the same deficiencies: if there are > multiple versions of assemblies in different paths and multiple dynamic > languages are loaded into the AppDomain they might step on each other > and load wrong assemblies. Unfortunately we can't do anything about > that until CLR4. > > Tomas From thibaut.barrere at gmail.com Sat Feb 28 05:21:37 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 28 Feb 2009 11:21:37 +0100 Subject: [Ironruby-core] A tiny DSL to build Windows::Forms menus from IronRuby - review wanted In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C58C@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0902261425mc61eb57g6534c463b8f5cdf0@mail.gmail.com> <4a68b8cf0902271154n3a1fe830i8f6fc635cb977d85@mail.gmail.com> <4a68b8cf0902271445x128de271kf35f1c17b3037090@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284BEB61C58C@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0902280221t56f85b7bwbc7473ed54f54215@mail.gmail.com> Hi Jimmy, > Awesome stuff! If you make this into its own github project, I can add it > to http://github.com/ironruby/ironruby-contrib as a submodule. That?ll > force me to keep it updated =) > glad you like it! I'll definitely extract it to a separate github project later on - I'll ping you when I do so. -- Thibaut > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Friday, February 27, 2009 2:46 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] A tiny DSL to build Windows::Forms menus > from IronRuby - review wanted > > > > After chatting with Ivan, I created some code to build Forms too: > > > > > > form *=* Magic*.*build *do* > > > > form(:text *=>* "Hello") *do* > > > > flow_layout_panel(:dock *=>* DockStyle*.*fill) *do* > > > > button(:text *=>* "Click me!", :click *=>* lambda { MessageBox*.*Show("Hello") }) > > > > button(:text *=>* "Quit", :click *=>* lambda { Application*.*Exit }) > > > > *end* > > > > *end* > > > > *end* > > > > > > > > I use method_missing and transform the method name from flow_layout_panel > to FlowLayoutPanel class etc. > > > > After using these a bit, I'm pretty sure we'll end up with some community > project sharing that kind of stuff, at some point. > > > > Nb: I hope it's not OT for the core list - or is it time to create a user > group ? > > > > cheers, > > > > -- Thibaut > > > > On Fri, Feb 27, 2009 at 8:54 PM, Thibaut Barr?re < > thibaut.barrere at gmail.com> wrote: > > Hi, > > I think it looks very nice. It?s a shame that you have to resort to > direct lambda?s since you can?t pass two lambda?s in, but otherwise it?s a > nice visual representation of the menu, in code. > > thanks for the feedback, appreciated! > > > > I just realised that I can also use this (without modifying the > implementation): > > > > item("&PowerBlade").click { MessageBox.Show("Powerblades are > amazing...") } > > > > instead of > > > > item("&PowerBlade", lambda { MessageBox.Show("Powerblades are > amazing...") } > > > > same effect, slightly more readable though. > > > > cheers, and I shall move on to long running operations. > > > > -- Thibaut > > > > > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Thursday, February 26, 2009 2:26 PM > *To:* ironruby-core > *Subject:* [Ironruby-core] A tiny DSL to build Windows::Forms menus from > IronRuby - review wanted > > > > Hi, > > > > I started working on UI bits, both for Ivan book and because my customers > are interested (and well - because it's fun, too!). First topic is how to > build menus more easily (next one will be long running operations and how to > sugar them). > > > > I'd be interested to get your opinion on both the DSL syntax (below for > quick read or here on > github) and the implementation > . > > > > form.menu = MainMenu.build do > item("&File") { > item("&New") { > item("Spreadsheet") > item("Document") > } > item "&Quit", lambda { Application.Exit } > } > item("&Tools") { > > item "&PowerBlade", lambda { MessageBox.Show("Powerblades are amazing...") } > item "&Scissors" > } > end > > > > what do you think ? > > > > cheers, > > > > Thibaut Barr?re > > -- > LoGeek > [blog] http://evolvingworker.com - tools for a better day > [blog] http://blog.logeek.fr - about writing software > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Sat Feb 28 05:29:26 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 28 Feb 2009 11:29:26 +0100 Subject: [Ironruby-core] Recommendations for (IronRuby) gem packaging ? Message-ID: <4a68b8cf0902280229v51dbb1e9u2f2db964658c3430@mail.gmail.com> Hi, I'm thinking about packaging some gems from github. So I'm wondering if it already possible to package a gem so that: 1 - it is marked as compatible *only* with IronRuby ? 2 - it is marked as compatible also with IronRuby (as well as other platforms) ? What would be the platform indication ? I'm also looking for any other useful information from people who tried to package an IronRuby gem. cheers and thanks for any feedback, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From suppakilla at gmail.com Sat Feb 28 06:34:06 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Sat, 28 Feb 2009 12:34:06 +0100 Subject: [Ironruby-core] Recommendations for (IronRuby) gem packaging ? In-Reply-To: <4a68b8cf0902280229v51dbb1e9u2f2db964658c3430@mail.gmail.com> References: <4a68b8cf0902280229v51dbb1e9u2f2db964658c3430@mail.gmail.com> Message-ID: <3bf20550902280334n708ae3f7pa279abb1172d74d3@mail.gmail.com> Hi Thibaut, AFAIK there is no way (yet) to enforce the compatibility of a gem with one or more ruby implementations, e.g. mri, jruby, ironruby, etc. If I'm not going wrong there was a discussion a while back on ruby-talk about the necessity of extending the current gemspec with a new attribute to meet this kind of requirement as the existing "platform" attribute was not intended for something like this and, in fact, it is not quite the same. I was thinking of packaging my ironruby-hpricot as a gem for ironruby (btw the source is hosted on github, see http://github.com/nrk/ironruby-hpricot/ ... never had the chance to announce it :-)) but I guess it is too early as ironruby's internals seem to be still a "moving target" (I had to push a few fixes last week due to changes). On Sat, Feb 28, 2009 at 11:29, Thibaut Barr?re wrote: > Hi, > I'm thinking about packaging some gems from github. > So I'm wondering if it already possible to package a gem so that: > 1 - it is marked as compatible *only* with IronRuby ? > 2 - it is marked as compatible also with IronRuby (as well as other > platforms) ? > What would be the platform indication ? > I'm also looking for any other useful information from people who tried to > package an IronRuby gem. > cheers and thanks for any feedback, > -- Thibaut -- Daniele Alessandri http://www.clorophilla.net/blog/ From thibaut.barrere at gmail.com Sat Feb 28 07:56:28 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 28 Feb 2009 13:56:28 +0100 Subject: [Ironruby-core] Recommendations for (IronRuby) gem packaging ? In-Reply-To: <3bf20550902280334n708ae3f7pa279abb1172d74d3@mail.gmail.com> References: <4a68b8cf0902280229v51dbb1e9u2f2db964658c3430@mail.gmail.com> <3bf20550902280334n708ae3f7pa279abb1172d74d3@mail.gmail.com> Message-ID: <4a68b8cf0902280456h3c1df32dh321a52e289727b13@mail.gmail.com> Hi Daniele, nice to see your work on HPricot - I wasn't aware of that. That will be totally useful :) thanks for your reply - I guess I'll remain in pure code on github until things are sorted out. thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: