From lists at ruby-forum.com Sat Aug 1 12:48:07 2009 From: lists at ruby-forum.com (Shay Friedman) Date: Sat, 1 Aug 2009 18:48:07 +0200 Subject: [Ironruby-core] irake db:create Message-ID: <5ae6b2c4427390f986a6b9c6a708b7fd@ruby-forum.com> [Sorry if it's the third time you receive that, I'm having a hard time with the mailing list...] Hi, I try to run "irake db:create" on my IronRuby on Rails app but it doesn't create the database. I have changed the connection adapter to mssql. Is it a bug or it is not expected to work? By the way, when debugging the code I see that some files are being required but are missing like "rubygems/defaults/operating_system" or "rubygems/defaults/ironruby". I don't know if it's related though. Many thanks, Shay. ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay -- Posted via http://www.ruby-forum.com/. From Jimmy.Schementi at microsoft.com Sat Aug 1 12:49:54 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 1 Aug 2009 16:49:54 +0000 Subject: [Ironruby-core] irake db:create In-Reply-To: References: Message-ID: It's not expected to work, as that hasn't been implemented. Keep in mind the mssql adapter will be going away in favor of the standard sqlserver activerecord adapter, since ironruby supports the Ruby dbi module now. The documentation will be updated to reflect this shortly. Many adapters don't support create because not all databases support it, without shelling out or something like that. ~Jimmy Sent from my phone On Jul 31, 2009, at 10:17 PM, "Shay Friedman" > wrote: Hi, I try to run "irake db:create" on my RoR app but it doesn't create the database. I have changed the connection adapter to mssql. Is it a bug or it is not expected to work? By the way, when debugging the code I see that some files are being required but are missing like "rubygems/defaults/operating_system" or "rubygems/defaults/ironruby". I don't know if it's related though. Many thanks, Shay. ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay _______________________________________________ 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 Sat Aug 1 23:57:58 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sun, 2 Aug 2009 03:57:58 +0000 Subject: [Ironruby-core] [Code Review] SP1 check should show the correct language name Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37BF@tk5ex14mbxc105.redmond.corp.microsoft.com> http://github.com/jschementi/ironruby/commit/f615c36390b7af9d1479c4f54d74927eacbd45d4 Currently running ir.exe when the .NET framework is not installed prompts the user with the error message "IronPython requires .NET ..." This moves the check to where the display name of the console's language is known. Does anything that runs before it depend on something post 2.0 SP1 but pre 3.5 SP1 so it would blow up before hitting this check? If so, is there a better way to get the language's name, maybe from the assembly name? http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1899. From Jimmy.Schementi at microsoft.com Sun Aug 2 00:37:54 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sun, 2 Aug 2009 04:37:54 +0000 Subject: [Ironruby-core] [ANN] IronRuby 0.9 Released! Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37DD@tk5ex14mbxc105.redmond.corp.microsoft.com> IronRuby 0.9 was released earlier today, go grab it at http://ironruby.net/Download. CodePlex Release Page: http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914 Release Notes and Changelist: http://rubyforge.org/frs/shownotes.php?release_id=37484 Announcement: http://blog.jimmy.schementi.com/2009/08/ironruby-09-released.html From ivan at flanders.co.nz Sun Aug 2 04:40:34 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 2 Aug 2009 10:40:34 +0200 Subject: [Ironruby-core] [ANN] IronRuby 0.9 Released! In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37DD@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37DD@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: I've created a mono build package that has been stamped with 0.9. ironruby-0.9.tar.gz ironruby-0.9.tar.bz2 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Sun, Aug 2, 2009 at 6:37 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > IronRuby 0.9 was released earlier today, go grab it at > http://ironruby.net/Download. > > CodePlex Release Page: > http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914 > > Release Notes and Changelist: > http://rubyforge.org/frs/shownotes.php?release_id=37484 > > Announcement: > http://blog.jimmy.schementi.com/2009/08/ironruby-09-released.html > _______________________________________________ > 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 Aug 3 11:10:33 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 3 Aug 2009 17:10:33 +0200 Subject: [Ironruby-core] performance wise we're doing good Message-ID: http://antoniocangiano.com/2009/08/03/performance-of-ironruby-ruby-on-windows/ --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Tue Aug 4 00:38:58 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Mon, 3 Aug 2009 23:38:58 -0500 Subject: [Ironruby-core] Code Review: rake context Message-ID: Patch for context.rb: This should allow those who build with "rake compile" to install gems successfully using igem. Changes the context.rb (line 370) :LibraryPaths from "..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\.." to "..\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\.." http://github.com/panesofglass/ironruby/tree/ This is my first one, so I may be doing this wrong. Just let me know. Cheers, Ryan Riley ryan.riley at panesofglass.org -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Changed-the-LibraryPaths-in-context.rb-to-point-to-..patch Type: application/octet-stream Size: 1727 bytes Desc: not available URL: From jdeville at microsoft.com Tue Aug 4 00:41:52 2009 From: jdeville at microsoft.com (Jim Deville) Date: Tue, 4 Aug 2009 04:41:52 +0000 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: Looks good. I?ll pull it in with the next pull. JD ?there is no try http://blog.jredville.com From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Monday, August 03, 2009 9:39 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: rake context Patch for context.rb: This should allow those who build with "rake compile" to install gems successfully using igem. Changes the context.rb (line 370) :LibraryPaths from "..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\.." to "..\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\.." http://github.com/panesofglass/ironruby/tree/ This is my first one, so I may be doing this wrong. Just let me know. Cheers, Ryan Riley ryan.riley at panesofglass.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Tue Aug 4 19:43:43 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 5 Aug 2009 01:43:43 +0200 Subject: [Ironruby-core] Getting a delegate in IronRuby In-Reply-To: <21192f970908041621teee170ie23ae55308539444@mail.gmail.com> References: <21192f970908031146r6d2e2057r683da4260d62fa7d@mail.gmail.com> <4412df1c0908031852i142ae2eal5213ecc6d167abea@mail.gmail.com> <21192f970908041204yb9c69d8x94a3af5976531e3a@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BCB541@tk5ex14mbxc106.redmond.corp.microsoft.com> <4B342496A3EFEB48839E10BB4BF5964C0168804B@TK5EX14MBXC129.redmond.corp.microsoft.com> <21192f970908041621teee170ie23ae55308539444@mail.gmail.com> Message-ID: Out of curiosity why, for C# to consume? Ruby doesn't have an event syntax, it's an add-on for CLR interop. In Ruby you would probably want to use an observable implementation and you could, if you want to do so, add the add_event_handler and remove_event_handler methods. You probably know this already but ruby has a built-in Observable mixin that implements most of it for you. If you want to mimic .NET events you'll need a custom implementation that notifies the observers and includes the sender. module Observable # # Add +observer+ as an observer on this object. +observer+ will now receive # notifications. +observer+ is interested in the specified +event+ # def add_observer(event, &observer) @observers = [] unless defined? @observers unless observer.respond_to? :call raise NoMethodError, "observer needs to respond to 'update'" end @observers << { :event => event, :observer => observer } end # # Delete +observer+ as an observer on this object. It will no longer receive # notifications of the specified +event+. # def delete_observer(event, &observer) evt = { :event => event, :observer => observer } @observers.delete evt if defined? @observers end # # Delete all observers associated with this object. # def delete_observers @observers.clear if defined? @observers end # # Return the number of observers associated with this object. # def count_observers if defined? @observers @observers.size else 0 end end # # Notifies the registered observers that some interesting # +event+ has occurred. It will notify the interested parties # by calling the block and passing it some context # def notify_observers(event, sender, *args) @observers.select {|evt| evt[:event] == event }.each {|evt| evt[:observer].call sender, *args } unless count_observers.zero? end end --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Wed, Aug 5, 2009 at 1:21 AM, Martin Smith wrote: > Thanks. Part of this question was also about returning and creating > RubyEvent objects. Is there a way to declare an event on the ruby side > without a "RubyEvent" object? > > Thanks, > Martin > > > > On Tue, Aug 4, 2009 at 12:39 PM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > >> BTW: >> >> >> >> Instead of using Reflection >> >> >> >> click_event = button.GetType.get_event("Click") >> on_click = EventHandler.new { |sender, e| puts "Click!" } >> click_event.add_event_handler(button, on_click) >> >> >> >> you can do >> >> >> >> handler = lambda { |sender, e| puts ?Click!? } >> >> button.on_click.add handler >> >> button.on_click.remove handler >> >> >> >> or just >> >> >> >> button.on_click { |sender, e| puts ?Click!? } >> >> >> >> if you don?t need to remove the handler. >> >> >> >> Tomas >> >> >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi >> *Sent:* Tuesday, August 04, 2009 12:15 PM >> >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Getting a delegate in IronRuby >> >> >> >> I believe that commit is the one that didn't get into the binary build of >> 0.9.0, but is (strange enough) tagged with 0.9 in GitHub. Thanks for >> pointing that out though. >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Martin Smith >> *Sent:* Tuesday, August 04, 2009 12:05 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* Re: [Ironruby-core] Getting a delegate in IronRuby >> >> >> >> Thank you all for your suggestions. They've been most helpful. I think >> i've mostly wrapped my head around event handlers. Here's one last >> question. What's the best way to test if a given object is an event? >> Obviously the way below: (object.GetType.get_event("EventName") != nil) is >> one way, but is there a more efficient (more rubonic) way? >> >> I've tried: >> >> button = Button.new >> button.click # => IronRuby.Builtins.RubyEvent >> # I cant test against IronRuby::Builtins::RubyEvent, because it's not >> defined >> button.click.is_a?(System::EventHandler) >> # error, about TypeGroups >> button.click.is_a?(System::EventHandler[]) # false >> >> As an aside, I looked at the changelog for, 0.9.0 and saw this: >> >> 2) Implements TypeGroup#[] overload taking a Fixnum. This is useful when one >> >> needs to select a generic type definition out of a group of types. For example, >> given three classes C: >> >> public class C { >> >> >> public virtual int Arity { get { return 0; } } >> } >> public class C { >> >> public virtual int Arity { get { return 1; } } >> >> >> } >> public class C { >> public virtual int Arity { get { return 2; } } >> } >> >> p C[0] # => C >> >> >> p C[1] # => C[T] >> p C[2] # => C[T, S] >> >> >> However, this fails: >> >> System::EventHandler[0] # invalid value for class: 0 >> >> You guys have been super helpful. It's really great to see such an active >> and great community forming around IronRuby. >> >> Thanks, >> Martin >> >> On Mon, Aug 3, 2009 at 6:52 PM, Ray Vernagus >> wrote: >> >> ** I tried sending this much earlier but my message didn't go through ** >> >> Hi, Martin-- >> >> Here's a short example that might illustrate what you're trying to >> accomplish: >> >> require "System.Windows.Forms" >> include System >> include System::Windows::Forms >> >> button = Button.new >> >> click_event = button.GetType.get_event("Click") >> >> on_click = EventHandler.new { |sender, e| puts "Click!" } >> >> click_event.add_event_handler(button, on_click) >> >> button.perform_click # Click! >> >> click_event.remove_event_handler(button, on_click) >> >> button.perform_click >> >> More canonical examples of using events in IronRuby are found here: >> http://www.ironruby.net/Documentation/.NET/Events >> >> --Ray >> >> On Mon, Aug 3, 2009 at 2:46 PM, Martin Smith >> wrote: >> >> Hello, >> >> I was wondering how I can get a delegate in IronRuby. >> >> One thing I was thinking about doing was trying to attach an event handler >> with an EventInfo and it requires a delegate. It has a method called >> AddEventHandler(object, Delegate), and i wanted to attach an event handler. >> >> But I can't find any way to get a delegate in ruby. How would you guys do >> it? >> >> I know i can also use: >> >> object.send(event_name) { |*e| ...... } >> >> In that case how would i remove that event handler? >> >> Thanks in advance, >> Martin >> >> _______________________________________________ >> 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 Shri.Borde at microsoft.com Wed Aug 5 12:56:50 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 5 Aug 2009 09:56:50 -0700 Subject: [Ironruby-core] IronRuby pair programming Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499EFB9A79@NA-EXMSG-C118.redmond.corp.microsoft.com> When: Thursday, August 06, 2009 10:00 AM-12:00 PM (GMT-08:00) Pacific Time (US & Canada). Note: The GMT offset above does not reflect daylight saving time adjustments. *~*~*~*~*~*~*~*~*~* For this session, participants (Ryan at this point) will drive. So if you have an IronRuby problem of any kind (bug, feature, your own app, brainstorming) you need help with, join us. Process info from http://wiki.github.com/ironruby/ironruby/debugging: Pair debugging with experienced IronRuby developers Some experienced IronRuby developers may be available to debug a problem with you. Watching over their shoulder can help a newcomer to the code base learn debugging tips and techniques. To make this a fruitful exercise, please follow the following guidelines: ? Ensure that you can build and successfully run all of the RubySpec tests. ? Try to restrict the problems to pure Ruby code which is known to work with MRI. Ensuring a clean working baseline functionality in MRI ensures that the problem truly in IronRuby. Without a known clean MRI baseline, the problem can be in a component other than IronRuby which you are as well-equipped to diagnose as anyone else. ? Set up a clean repro. Spend time ensuring that it is not a configuration issue, and that the problem can be easily reproduced on other machines. Document detailed information about your platform, version of IronRuby, and the steps to repro the problem. ? Do basic debugging by yourself beforehand. This will ensure that you get the most out of the session and can keep up with what?s going on over Live Meeting. ? Set up Live Meeting on your machine, which will allow you to watch the debugging session. ? The Live Meeting invite will be sent by email just before the scheduled hour. ? The email invite will also contain a toll-free number to dial in to. If you cannot call in, add the experienced developer as a friend/buddy in some Chat program so that you can ask questions during the debugging session. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/calendar Size: 3768 bytes Desc: not available URL: From Shri.Borde at microsoft.com Wed Aug 5 15:32:14 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 5 Aug 2009 12:32:14 -0700 Subject: [Ironruby-core] Code Review: excel In-Reply-To: References: Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499EFB9CC3@NA-EXMSG-C118.redmond.corp.microsoft.com> Looks good! -----Original Message----- From: Jim Deville Sent: Wednesday, August 05, 2009 12:10 PM To: IronRuby External Code Reviewers Cc: ironruby-core at rubyforge.org Subject: Code Review: excel tfpt review "/shelveset:excel;REDMOND\jdeville" Comment : Makes the com interop specs skip word and excel specific tests if word/excel is not installed From jdeville at microsoft.com Wed Aug 5 16:50:14 2009 From: jdeville at microsoft.com (Jim Deville) Date: Wed, 5 Aug 2009 20:50:14 +0000 Subject: [Ironruby-core] [Code Review] SP1 check should show the correct language name In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37BF@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37BF@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: Looks good. And it doesn't blow up. JD ...there is no try http://blog.jredville.com > -----Original Message----- > From: Jimmy Schementi > Sent: Saturday, August 01, 2009 8:58 PM > To: ironruby-core at rubyforge.org > Cc: IronRuby External Code Reviewers > Subject: [Code Review] SP1 check should show the correct language name > > http://github.com/jschementi/ironruby/commit/f615c36390b7af9d1479c4f54 > d74927eacbd45d4 > > Currently running ir.exe when the .NET framework is not installed prompts > the user with the error message "IronPython requires .NET ..." This moves > the check to where the display name of the console's language is known. > Does anything that runs before it depend on something post 2.0 SP1 but pre > 3.5 SP1 so it would blow up before hitting this check? If so, is there a better > way to get the language's name, maybe from the assembly name? > > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1899. From ryan.riley at panesofglass.org Wed Aug 5 23:33:22 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Wed, 5 Aug 2009 22:33:22 -0500 Subject: [Ironruby-core] Dev.bat and GEM_PATH Message-ID: Should Dev.bat be setting the GEM_PATH like this: %MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\lib\ruby\gems\1.8 or like this: %MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\redist_libs\ruby\gems\1.8? Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Aug 6 00:44:46 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 Aug 2009 04:44:46 +0000 Subject: [Ironruby-core] Dev.bat and GEM_PATH In-Reply-To: References: Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD5DC@tk5ex14mbxc106.redmond.corp.microsoft.com> It uses ruby-1.8.6p287 so we can install gems, and even check them in, but not compromise the integrity of anything under redist_libs: it?s the cleanroom copy of the Ruby libraries. If you diff them your only see these changes: certain words filtered out that Microsoft does not allow in source code, bugs in the standard libs (using + instead of ^ with hashes) and certain library files removed that IronRuby won?t support (eg. Tk). From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Wednesday, August 05, 2009 8:33 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Dev.bat and GEM_PATH Should Dev.bat be setting the GEM_PATH like this: %MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\lib\ruby\gems\1.8 or like this: %MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\redist_libs\ruby\gems\1.8? Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Thu Aug 6 00:50:47 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Wed, 5 Aug 2009 23:50:47 -0500 Subject: [Ironruby-core] Dev.bat and GEM_PATH In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD5DC@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD5DC@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: Install gems using the gem command? igem seems to install into the ..\redist_libs\ironruby folder. At least, I think that's where they are going. Just trying to make sure I understand what's happening. Thanks! R2 On Wed, Aug 5, 2009 at 11:44 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > It uses ruby-1.8.6p287 so we can install gems, and even check them in, but > not compromise the integrity of anything under redist_libs: it?s the > cleanroom copy of the Ruby libraries. If you diff them your only see these > changes: certain words filtered out that Microsoft does not allow in source > code, bugs in the standard libs (using + instead of ^ with hashes) and > certain library files removed that IronRuby won?t support (eg. Tk). > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Aug 6 01:13:12 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 Aug 2009 05:13:12 +0000 Subject: [Ironruby-core] Dev.bat and GEM_PATH In-Reply-To: References: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD5DC@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD692@tk5ex14mbxc106.redmond.corp.microsoft.com> Sorry, my answer was partly wrong: ?igem install? will still install into redist_libs/ironruby/gems. Gems will be loadable from IronRuby if they are in both locations, so it shouldn?t stop stuff from working. If you don?t like this behavior, and want all your IronRuby gems in one place, the either unset GEM_PATH or set GEM_HOME to be the same as GEM_PATH, depending on where you want gems to be installed and loaded from. I think setting GEM_PATH to point at ruby-1.8.6p287 only helps people who have a Microsoft TFS enlistment to the IronRuby sources, as there is a full MRI installation at Merlin\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287. If that?s the case, then we should fix this. Anyone else have insight into why we have two copies of the libraries checked in, and gems are split up between them? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Wednesday, August 05, 2009 9:51 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Dev.bat and GEM_PATH Install gems using the gem command? igem seems to install into the ..\redist_libs\ironruby folder. At least, I think that's where they are going. Just trying to make sure I understand what's happening. Thanks! R2 On Wed, Aug 5, 2009 at 11:44 PM, Jimmy Schementi > wrote: It uses ruby-1.8.6p287 so we can install gems, and even check them in, but not compromise the integrity of anything under redist_libs: it?s the cleanroom copy of the Ruby libraries. If you diff them your only see these changes: certain words filtered out that Microsoft does not allow in source code, bugs in the standard libs (using + instead of ^ with hashes) and certain library files removed that IronRuby won?t support (eg. Tk). -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Aug 6 04:37:26 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 6 Aug 2009 08:37:26 +0000 Subject: [Ironruby-core] Declined: IronRuby pair programming Message-ID: A non-text attachment was scrubbed... Name: not available Type: text/calendar Size: 1226 bytes Desc: not available URL: From Jimmy.Schementi at microsoft.com Thu Aug 6 16:41:16 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 Aug 2009 20:41:16 +0000 Subject: [Ironruby-core] [Code Review] SP1 check should show the correct language name In-Reply-To: References: <0047ECBFA2E0DF4A834AA369282A5AFC19BB37BF@tk5ex14mbxc105.redmond.corp.microsoft.com>, Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BCE39A@tk5ex14mbxc106.redmond.corp.microsoft.com> Great. It's now in http://github.com/jschementi/ironruby/tree/master ________________________________________ From: Jim Deville Sent: Wednesday, August 05, 2009 1:50 PM To: Jimmy Schementi; ironruby-core at rubyforge.org Cc: IronRuby External Code Reviewers Subject: RE: [Code Review] SP1 check should show the correct language name Looks good. And it doesn't blow up. JD ?there is no try http://blog.jredville.com > -----Original Message----- > From: Jimmy Schementi > Sent: Saturday, August 01, 2009 8:58 PM > To: ironruby-core at rubyforge.org > Cc: IronRuby External Code Reviewers > Subject: [Code Review] SP1 check should show the correct language name > > http://github.com/jschementi/ironruby/commit/f615c36390b7af9d1479c4f54 > d74927eacbd45d4 > > Currently running ir.exe when the .NET framework is not installed prompts > the user with the error message "IronPython requires .NET ..." This moves > the check to where the display name of the console's language is known. > Does anything that runs before it depend on something post 2.0 SP1 but pre > 3.5 SP1 so it would blow up before hitting this check? If so, is there a better > way to get the language's name, maybe from the assembly name? > > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1899. From ryan.riley at panesofglass.org Thu Aug 6 17:15:27 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 6 Aug 2009 16:15:27 -0500 Subject: [Ironruby-core] Problems running irtests.bat Message-ID: During our pair programming session today, Shri, Kevin, and I walked through some issues running RubySpecs from irtests and rake test:spec_a. The issue appears to have something to do with the path, as we tried numerous usages of system with various commands. We finally solved it by adding mspec_path = "#{root}\\..\\External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\ bin" and including mspec_path at the beginning of mspec_base = "#{mspec_path}\\mspec ci -fd", effectively hard-coding the path. I believe Kevin also had this problem, so if anyone else is having the problem, you can try that. After making those changes, everything ran fine for me. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Thu Aug 6 17:24:54 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 6 Aug 2009 14:24:54 -0700 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: References: Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> To add to that, running ?mspec ci ?fd :lang? worked from the command line. When irtests.rb tried to call system() with that exact same command line (we verified that it was the exact same value), system() failed returning false. Doing system(?where mspec?) from within irtests.rb did show the correct version of (mspec and) mspec.bat, which implies that the value of PATH of the ?rake? process was also correct. Ryan, one thought just occurred to me. What happens if you do ?mspec_base = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) is trying to run the ?mspec? Ruby file. In either case, using the full path sounds like a good idea anyway. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 06, 2009 2:15 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Problems running irtests.bat During our pair programming session today, Shri, Kevin, and I walked through some issues running RubySpecs from irtests and rake test:spec_a. The issue appears to have something to do with the path, as we tried numerous usages of system with various commands. We finally solved it by adding mspec_path = "#{root}\\..\\External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and including mspec_path at the beginning of mspec_base = "#{mspec_path}\\mspec ci -fd", effectively hard-coding the path. I believe Kevin also had this problem, so if anyone else is having the problem, you can try that. After making those changes, everything ran fine for me. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Thu Aug 6 17:44:12 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 6 Aug 2009 16:44:12 -0500 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: That's a good point, and I forgot to add the ".bat" to mspec in my original email. And of course, that fixes the problem. :) I removed the full path and just added ".bat" and I can run the tests just fine. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde wrote: > To add to that, running ?mspec ci ?fd :lang? worked from the command > line. When irtests.rb tried to call system() with that exact same command > line (we verified that it was the exact same value), system() failed > returning false. Doing system(?where mspec?) from within irtests.rb did show > the correct version of (mspec and) mspec.bat, which implies that the value > of PATH of the ?rake? process was also correct. > > > > Ryan, one thought just occurred to me. What happens if you do ?mspec_base > = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) > is trying to run the ?mspec? Ruby file. > > > > In either case, using the full path sounds like a good idea anyway. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Thursday, August 06, 2009 2:15 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Problems running irtests.bat > > > > During our pair programming session today, Shri, Kevin, and I walked > through some issues running RubySpecs from irtests and rake test:spec_a. > The issue appears to have something to do with the path, as we tried > numerous usages of system with various commands. We finally solved it by > adding mspec_path = "#{root}\\..\\ > External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and > including mspec_path at the beginning of mspec_base = > "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. > > > > I believe Kevin also had this problem, so if anyone else is having the > problem, you can try that. After making those changes, everything ran fine > for me. > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > _______________________________________________ > 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 Aug 6 18:08:12 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 7 Aug 2009 00:08:12 +0200 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: for mono I use mspec-ci and that works..but after it runs the 3rd set of ruby specs it won't continue to the rubygems tests. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Thu, Aug 6, 2009 at 11:44 PM, Ryan Riley wrote: > That's a good point, and I forgot to add the ".bat" to mspec in my original > email. And of course, that fixes the problem. :) I removed the full path and > just added ".bat" and I can run the tests just fine. > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > > On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde wrote: > >> To add to that, running ?mspec ci ?fd :lang? worked from the command >> line. When irtests.rb tried to call system() with that exact same command >> line (we verified that it was the exact same value), system() failed >> returning false. Doing system(?where mspec?) from within irtests.rb did show >> the correct version of (mspec and) mspec.bat, which implies that the value >> of PATH of the ?rake? process was also correct. >> >> >> >> Ryan, one thought just occurred to me. What happens if you do ?mspec_base >> = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci >> ?fd?) is trying to run the ?mspec? Ruby file. >> >> >> >> In either case, using the full path sounds like a good idea anyway. >> >> >> >> *From:* ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley >> *Sent:* Thursday, August 06, 2009 2:15 PM >> *To:* ironruby-core at rubyforge.org >> *Subject:* [Ironruby-core] Problems running irtests.bat >> >> >> >> During our pair programming session today, Shri, Kevin, and I walked >> through some issues running RubySpecs from irtests and rake test:spec_a. >> The issue appears to have something to do with the path, as we tried >> numerous usages of system with various commands. We finally solved it by >> adding mspec_path = "#{root}\\..\\ >> External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and >> including mspec_path at the beginning of mspec_base = >> "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. >> >> >> >> I believe Kevin also had this problem, so if anyone else is having the >> problem, you can try that. After making those changes, everything ran fine >> for me. >> >> >> Ryan Riley >> ryan.riley at panesofglass.org >> http://panesofglass.org/ >> http://wizardsofsmart.net/ >> >> _______________________________________________ >> 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 Thu Aug 6 18:21:42 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 6 Aug 2009 15:21:42 -0700 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> What does happen after the 3rd set of ruby specs? Does irtests.rb exit or does it hang? Are results printed out from the 3rd set of ruby specs? You could try all the individual test tasks by themselves to isolate problems. ?rake ?T? will show you all the available test tasks. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Thursday, August 06, 2009 3:08 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Problems running irtests.bat for mono I use mspec-ci and that works.. but after it runs the 3rd set of ruby specs it won't continue to the rubygems tests. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Thu, Aug 6, 2009 at 11:44 PM, Ryan Riley > wrote: That's a good point, and I forgot to add the ".bat" to mspec in my original email. And of course, that fixes the problem. :) I removed the full path and just added ".bat" and I can run the tests just fine. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde > wrote: To add to that, running ?mspec ci ?fd :lang? worked from the command line. When irtests.rb tried to call system() with that exact same command line (we verified that it was the exact same value), system() failed returning false. Doing system(?where mspec?) from within irtests.rb did show the correct version of (mspec and) mspec.bat, which implies that the value of PATH of the ?rake? process was also correct. Ryan, one thought just occurred to me. What happens if you do ?mspec_base = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) is trying to run the ?mspec? Ruby file. In either case, using the full path sounds like a good idea anyway. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 06, 2009 2:15 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Problems running irtests.bat During our pair programming session today, Shri, Kevin, and I walked through some issues running RubySpecs from irtests and rake test:spec_a. The issue appears to have something to do with the path, as we tried numerous usages of system with various commands. We finally solved it by adding mspec_path = "#{root}\\..\\External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and including mspec_path at the beginning of mspec_base = "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. I believe Kevin also had this problem, so if anyone else is having the problem, you can try that. After making those changes, everything ran fine for me. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ _______________________________________________ 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 Aug 6 18:33:22 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 7 Aug 2009 00:33:22 +0200 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: It just doesn't fall through reallyso it doesn't really hang but rather stalls or hibernates or something. I think the process just doesn't exit after printing everything but it's also not doing any work anymore. The specs execute completely. Apart from the smoke tests and legacy tests i can run all the tests in 2 blocks. I can run the specs and then I can run the rubygems, rake and yaml tests but I have to choose which bit I want to run --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Fri, Aug 7, 2009 at 12:21 AM, Shri Borde wrote: > What does happen after the 3rd set of ruby specs? Does irtests.rb exit or > does it hang? Are results printed out from the 3rd set of ruby specs? > > > > You could try all the individual test tasks by themselves to isolate > problems. ?rake ?T? will show you all the available test tasks. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Thursday, August 06, 2009 3:08 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Problems running irtests.bat > > > > for mono I use mspec-ci and that works.. > > but after it runs the 3rd set of ruby specs it won't continue to the > rubygems tests. > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > > On Thu, Aug 6, 2009 at 11:44 PM, Ryan Riley > wrote: > > That's a good point, and I forgot to add the ".bat" to mspec in my original > email. And of course, that fixes the problem. :) I removed the full path and > just added ".bat" and I can run the tests just fine. > > > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde > wrote: > > To add to that, running ?mspec ci ?fd :lang? worked from the command > line. When irtests.rb tried to call system() with that exact same command > line (we verified that it was the exact same value), system() failed > returning false. Doing system(?where mspec?) from within irtests.rb did show > the correct version of (mspec and) mspec.bat, which implies that the value > of PATH of the ?rake? process was also correct. > > > > Ryan, one thought just occurred to me. What happens if you do ?mspec_base > = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) > is trying to run the ?mspec? Ruby file. > > > > In either case, using the full path sounds like a good idea anyway. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Thursday, August 06, 2009 2:15 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Problems running irtests.bat > > > > During our pair programming session today, Shri, Kevin, and I walked > through some issues running RubySpecs from irtests and rake test:spec_a. The > issue appears to have something to do with the path, as we tried numerous > usages of system with various commands. We finally solved it by adding > mspec_path = "#{root}\\..\\ > External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and > including mspec_path at the beginning of mspec_base = > "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. > > > > I believe Kevin also had this problem, so if anyone else is having the > problem, you can try that. After making those changes, everything ran fine > for me. > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > > _______________________________________________ > 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 ryan.riley at panesofglass.org Thu Aug 6 18:38:20 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 6 Aug 2009 17:38:20 -0500 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: Everything now passes except the RakeTests. I'll respond with those results below. The 3rd set prints out, and the test run doesn't hang. On Thu, Aug 6, 2009 at 5:21 PM, Shri Borde wrote: > What does happen after the 3rd set of ruby specs? Does irtests.rb exit or > does it hang? Are results printed out from the 3rd set of ruby specs? > > > > You could try all the individual test tasks by themselves to isolate > problems. ?rake ?T? will show you all the available test tasks. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Thursday, August 06, 2009 3:08 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Problems running irtests.bat > > > > for mono I use mspec-ci and that works.. > > but after it runs the 3rd set of ruby specs it won't continue to the > rubygems tests. > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > > On Thu, Aug 6, 2009 at 11:44 PM, Ryan Riley > wrote: > > That's a good point, and I forgot to add the ".bat" to mspec in my original > email. And of course, that fixes the problem. :) I removed the full path and > just added ".bat" and I can run the tests just fine. > > > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde > wrote: > > To add to that, running ?mspec ci ?fd :lang? worked from the command > line. When irtests.rb tried to call system() with that exact same command > line (we verified that it was the exact same value), system() failed > returning false. Doing system(?where mspec?) from within irtests.rb did show > the correct version of (mspec and) mspec.bat, which implies that the value > of PATH of the ?rake? process was also correct. > > > > Ryan, one thought just occurred to me. What happens if you do ?mspec_base > = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) > is trying to run the ?mspec? Ruby file. > > > > In either case, using the full path sounds like a good idea anyway. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Thursday, August 06, 2009 2:15 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Problems running irtests.bat > > > > During our pair programming session today, Shri, Kevin, and I walked > through some issues running RubySpecs from irtests and rake test:spec_a. The > issue appears to have something to do with the path, as we tried numerous > usages of system with various commands. We finally solved it by adding > mspec_path = "#{root}\\..\\ > External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and > including mspec_path at the beginning of mspec_base = > "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. > > > > I believe Kevin also had this problem, so if anyone else is having the > problem, you can try that. After making those changes, everything ran fine > for me. > > > Ryan Riley > ryan.riley at panesofglass.org > http://panesofglass.org/ > http://wizardsofsmart.net/ > > > _______________________________________________ > 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 ryan.riley at panesofglass.org Thu Aug 6 18:42:20 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 6 Aug 2009 17:42:20 -0500 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: Oops! Not to me; sorry 'bout that. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Thu Aug 6 18:49:18 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 6 Aug 2009 15:49:18 -0700 Subject: [Ironruby-core] Problems running irtests.bat In-Reply-To: References: <9A92D7D99FC1564D8C8F18008B08098F499F07CF8D@NA-EXMSG-C118.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F07D051@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F07D0BE@NA-EXMSG-C118.redmond.corp.microsoft.com> Could you check which processes are lying around? Do you run irtests.rb using MRI or ir.exe? You should be able to run it with MRI. That way, you can check if there is a ruby.exe process lying around (which would be irtests.rb), or an ir.exe process (for the actual test tasks spawned by irtests.rb). If its an ir.exe process, it would be helpful if you could attach with a debugger, and see what its blocked on. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Thursday, August 06, 2009 3:33 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Problems running irtests.bat It just doesn't fall through really so it doesn't really hang but rather stalls or hibernates or something. I think the process just doesn't exit after printing everything but it's also not doing any work anymore. The specs execute completely. Apart from the smoke tests and legacy tests i can run all the tests in 2 blocks. I can run the specs and then I can run the rubygems, rake and yaml tests but I have to choose which bit I want to run --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Fri, Aug 7, 2009 at 12:21 AM, Shri Borde > wrote: What does happen after the 3rd set of ruby specs? Does irtests.rb exit or does it hang? Are results printed out from the 3rd set of ruby specs? You could try all the individual test tasks by themselves to isolate problems. ?rake ?T? will show you all the available test tasks. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Thursday, August 06, 2009 3:08 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Problems running irtests.bat for mono I use mspec-ci and that works.. but after it runs the 3rd set of ruby specs it won't continue to the rubygems tests. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Thu, Aug 6, 2009 at 11:44 PM, Ryan Riley > wrote: That's a good point, and I forgot to add the ".bat" to mspec in my original email. And of course, that fixes the problem. :) I removed the full path and just added ".bat" and I can run the tests just fine. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ On Thu, Aug 6, 2009 at 4:24 PM, Shri Borde > wrote: To add to that, running ?mspec ci ?fd :lang? worked from the command line. When irtests.rb tried to call system() with that exact same command line (we verified that it was the exact same value), system() failed returning false. Doing system(?where mspec?) from within irtests.rb did show the correct version of (mspec and) mspec.bat, which implies that the value of PATH of the ?rake? process was also correct. Ryan, one thought just occurred to me. What happens if you do ?mspec_base = "mspec.bat ci -fd"??? ie. add ?.bat?. I wonder if system(?mspec ci ?fd?) is trying to run the ?mspec? Ruby file. In either case, using the full path sounds like a good idea anyway. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 06, 2009 2:15 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Problems running irtests.bat During our pair programming session today, Shri, Kevin, and I walked through some issues running RubySpecs from irtests and rake test:spec_a. The issue appears to have something to do with the path, as we tried numerous usages of system with various commands. We finally solved it by adding mspec_path = "#{root}\\..\\External.LCA_RESTRICTED\\Languages\\IronRuby\\mspec\\mspec\\bin" and including mspec_path at the beginning of mspec_base = "#{mspec_path}\\mspec.bat ci -fd", effectively hard-coding the path. I believe Kevin also had this problem, so if anyone else is having the problem, you can try that. After making those changes, everything ran fine for me. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ _______________________________________________ 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 lists at ruby-forum.com Tue Aug 11 11:34:26 2009 From: lists at ruby-forum.com (Shay Friedman) Date: Tue, 11 Aug 2009 17:34:26 +0200 Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight Message-ID: Hi there, I've got a question about the plans for V1 for ASP.Net and Silverlight. Regarding ASP.Net - I know that there is an ASP.NET dynamic language support project on codeplex, but it says that the IronRuby support is coming. Is there a source code somewhere? Regarding Silverlight - I remember Jimmy told that agDLR would be going away in the future. Is it going to happen soon? Thanks! Shay. ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay -- Posted via http://www.ruby-forum.com/. From Jimmy.Schementi at microsoft.com Tue Aug 11 13:05:14 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 11 Aug 2009 17:05:14 +0000 Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight In-Reply-To: References: Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1A82@tk5ex14mbxc106.redmond.corp.microsoft.com> ASP.NET - We're working on open-sourcing the IronPython asp.net integration. We have a prototype of Ruby support, and will eventually extend it to fully support Ruby. It's currently not planned for the 1.0 release. Silverlight - AgDLR/sdlsdk/whatever else I called it is no longer the place for Silverlight integration with Ruby and Python; the respective language source trees have the latest source and the language releases have binaries for use in Silverlight. Take a look at http://sdlsdk.codeplex.com and http://github.com/jschementi/agdlr, they both have notices that the sites are no longer in use, so agdlr and sdlsdk have already gone-away. For v1 we'll also support putting code in tags work, but I'll bring that up on another thread shortly. Does that answer your questions Shay? ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] on behalf of Shay Friedman [lists at ruby-forum.com] Sent: Tuesday, August 11, 2009 8:34 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight Hi there, I've got a question about the plans for V1 for ASP.Net and Silverlight. Regarding ASP.Net - I know that there is an ASP.NET dynamic language support project on codeplex, but it says that the IronRuby support is coming. Is there a source code somewhere? Regarding Silverlight - I remember Jimmy told that agDLR would be going away in the future. Is it going to happen soon? Thanks! Shay. ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From shay.friedman at gmail.com Tue Aug 11 13:16:40 2009 From: shay.friedman at gmail.com (Shay Friedman) Date: Tue, 11 Aug 2009 20:16:40 +0300 Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1A82@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1A82@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: Thanks a lot Jimmy! I guess I'll stick with ASP.Net MVC for now :) ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay On 8/11/09, Jimmy Schementi wrote: > ASP.NET - We're working on open-sourcing the IronPython asp.net integration. > We have a prototype of Ruby support, and will eventually extend it to fully > support Ruby. It's currently not planned for the 1.0 release. > > Silverlight - AgDLR/sdlsdk/whatever else I called it is no longer the place > for Silverlight integration with Ruby and Python; the respective language > source trees have the latest source and the language releases have binaries > for use in Silverlight. Take a look at http://sdlsdk.codeplex.com and > http://github.com/jschementi/agdlr, they both have notices that the sites > are no longer in use, so agdlr and sdlsdk have already gone-away. For v1 > we'll also support putting code in tags work, but I'll bring that > up on another thread shortly. > > Does that answer your questions Shay? > ________________________________________ > From: ironruby-core-bounces at rubyforge.org > [ironruby-core-bounces at rubyforge.org] on behalf of Shay Friedman > [lists at ruby-forum.com] > Sent: Tuesday, August 11, 2009 8:34 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight > > Hi there, > > I've got a question about the plans for V1 for ASP.Net and Silverlight. > > Regarding ASP.Net - I know that there is an ASP.NET dynamic language > support project on codeplex, but it says that the IronRuby support is > coming. Is there a source code somewhere? > > Regarding Silverlight - I remember Jimmy told that agDLR would be going > away in the future. Is it going to happen soon? > > Thanks! > Shay. > > ---------------------------- > Shay Friedman > http://www.IronShay.com > Follow me: http://twitter.com/ironshay > -- > 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 ivan at flanders.co.nz Tue Aug 11 16:09:21 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 11 Aug 2009 22:09:21 +0200 Subject: [Ironruby-core] ActiveRecord update In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F16687F@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <9A92D7D99FC1564D8C8F18008B08098F499CAF073E@NA-EXMSG-C118.redmond.corp.microsoft.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BD1676@tk5ex14mbxc106.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F16687F@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: ironruby-dbi should be working but I made a change to how it deals with the params and I think that there are perhaps some changes required to the sqlserver-adapter. I haven't had time to look into/test this stuff yet. But skimming the sqlserver adapter code on github makes me think that the only thing required would be to provide a different connection string to the sqlserver adapter. They don't use parameters so the change I made to dbi doesn't make any difference to them. ironruby-dbi is passing all the dbi baseline tests so I'm hoping that would be enough to get it to work. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Tue, Aug 11, 2009 at 9:30 PM, Shri Borde wrote: > Yup, moving over to sqlserver_adapter.rb+DBI+ADO sounds good. > sqlserver_adapter.rb comes packaged as a gem, so its easy to get to. It does > need the simple patch at http://gist.github.com/166062 to use Integrated > security, and to get it ready for ironruby-dbi. *Ray*, has this patch been > accepted? > > > > Running tests using the instructions at > http://github.com/rails-sqlserver/2000-2005-adapter/blob/f994f7d469ad0125533516fba4ba29a089e5de22/RUNNING_UNIT_TESTSgive a pass rate of 75% with both IronRuby and MRI. The MRI pass rate is low > presumably because the sqlserver_adapter project does their testing mainly > using ODBC. Once Ivan?s ironruby-dbi is working, we can plugh that in, and > try to pull up the pass rate even further. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Jimmy Schementi > *Sent:* Tuesday, August 11, 2009 11:52 AM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] ActiveRecord update > > > > Shri, the documentation for running Rails and running the tests still > points to the mssql-adapter. Want me to move everything over the to the ADO > driver for now, since that's got the best pass rate? > ------------------------------ > > *From:* ironruby-core-bounces at rubyforge.org [ > ironruby-core-bounces at rubyforge.org] on behalf of Shri Borde [ > Shri.Borde at microsoft.com] > *Sent:* Thursday, July 16, 2009 12:45 PM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] ActiveRecord update > > I have been working on trying to improve the ActiveRecord test pass rate > from the low 10% it was it. The summary is that the language support is > solid so that we can get to within 99% of MRI behavior, but there are a > number of caveats about the database support. Below I describe the various > stacks possible for using ActiveRecord with IronRuby: > > > > ? mssql_adapter.rb ( > http://github.com/jschementi/activerecord-mssql-adapter/) ? This is the > ActiveRecord adapter that has been used so far to demo IronRuby using Rails. > It directly uses ADO.Net. The basics work but it has a pass rate of about > 10% because it does not have all the fixes from sqlserver_adapter described > below. > > ? sqlserver_adapter ( > http://github.com/rails-sqlserver/2000-2005-adapter/) ? This is the > adapter that you would need for using SQL Server with MRI. It uses the DBI > module (http://ruby-dbi.rubyforge.org/). The DBI module in turn depends on > a lower level adapter, which can be one of three types: > > o ODBC ? This is the preferred way for using MRI+Rails. There is no > equivalent for IronRuby > > o ADO ? There is a driver at > http://www.koders.com/ruby/fid94AB2E1BC823281569CACF9FDAF4093C2ABC7EAA.aspx. > This is the one I used. The good news is that IronRuby gets to within 99% of > MRI pass rate! The bad news is that the MRI pass rate is only 66%. The could > be my machine configuration, issues with the ADO driver, issues with the > tests not being SQLServer-friendly, etc. It seems that the ADO driver is not > supported. For example, it relies on an older version of DBI (that also > ships with the MRI 1.8.7 installer) that you can get from > http://rubyforge.org/frs/download.php/41304/dbi-0.2.2.zip. So it?s the > best solution for now, but may not be in the future. > > o ADO.Net ? Ivan has a driver at > http://github.com/casualjim/ironruby-dbi/ which also gives a pass rate of > about 10%. This could potentially be a good story in the future since Ivan > is looking to improve it. > > ? IRDb (http://github.com/rvernagus/activerecord-irdb-adapter) ? > This uses ADO.Net I believe. I don?t think Ray has tried running tests with > this. > > > > Ray and Ivan have helped me a lot over the past few weeks. Thanks guys! I > have documented most of the steps to running the tests using mssql_adapter > at the bottom of > http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#framework-tests. > If anyone is interested in pushing on any of the approaches above, let me > know and I can help you get setup up. Also, I am sure that Ray and Ivan > would appreciate any help with > http://github.com/rvernagus/activerecord-irdb-adapter and > http://github.com/casualjim/ironruby-dbi/. > > > > Thanks, > > Shri > > > > _______________________________________________ > 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 Tue Aug 11 16:25:02 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Tue, 11 Aug 2009 13:25:02 -0700 Subject: [Ironruby-core] ActiveRecord update In-Reply-To: References: <9A92D7D99FC1564D8C8F18008B08098F499CAF073E@NA-EXMSG-C118.redmond.corp.microsoft.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BD1676@tk5ex14mbxc106.redmond.corp.microsoft.com> <9A92D7D99FC1564D8C8F18008B08098F499F16687F@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F166919@NA-EXMSG-C118.redmond.corp.microsoft.com> I can try out ironruby-dbi later this week and let you know how things go? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, August 11, 2009 1:09 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] ActiveRecord update ironruby-dbi should be working but I made a change to how it deals with the params and I think that there are perhaps some changes required to the sqlserver-adapter. I haven't had time to look into/test this stuff yet. But skimming the sqlserver adapter code on github makes me think that the only thing required would be to provide a different connection string to the sqlserver adapter. They don't use parameters so the change I made to dbi doesn't make any difference to them. ironruby-dbi is passing all the dbi baseline tests so I'm hoping that would be enough to get it to work. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Tue, Aug 11, 2009 at 9:30 PM, Shri Borde > wrote: Yup, moving over to sqlserver_adapter.rb+DBI+ADO sounds good. sqlserver_adapter.rb comes packaged as a gem, so its easy to get to. It does need the simple patch at http://gist.github.com/166062 to use Integrated security, and to get it ready for ironruby-dbi. Ray, has this patch been accepted? Running tests using the instructions at http://github.com/rails-sqlserver/2000-2005-adapter/blob/f994f7d469ad0125533516fba4ba29a089e5de22/RUNNING_UNIT_TESTS give a pass rate of 75% with both IronRuby and MRI. The MRI pass rate is low presumably because the sqlserver_adapter project does their testing mainly using ODBC. Once Ivan?s ironruby-dbi is working, we can plugh that in, and try to pull up the pass rate even further. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Tuesday, August 11, 2009 11:52 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] ActiveRecord update Shri, the documentation for running Rails and running the tests still points to the mssql-adapter. Want me to move everything over the to the ADO driver for now, since that's got the best pass rate? ________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] on behalf of Shri Borde [Shri.Borde at microsoft.com] Sent: Thursday, July 16, 2009 12:45 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] ActiveRecord update I have been working on trying to improve the ActiveRecord test pass rate from the low 10% it was it. The summary is that the language support is solid so that we can get to within 99% of MRI behavior, but there are a number of caveats about the database support. Below I describe the various stacks possible for using ActiveRecord with IronRuby: ? mssql_adapter.rb (http://github.com/jschementi/activerecord-mssql-adapter/) ? This is the ActiveRecord adapter that has been used so far to demo IronRuby using Rails. It directly uses ADO.Net. The basics work but it has a pass rate of about 10% because it does not have all the fixes from sqlserver_adapter described below. ? sqlserver_adapter (http://github.com/rails-sqlserver/2000-2005-adapter/) ? This is the adapter that you would need for using SQL Server with MRI. It uses the DBI module (http://ruby-dbi.rubyforge.org/). The DBI module in turn depends on a lower level adapter, which can be one of three types: o ODBC ? This is the preferred way for using MRI+Rails. There is no equivalent for IronRuby o ADO ? There is a driver at http://www.koders.com/ruby/fid94AB2E1BC823281569CACF9FDAF4093C2ABC7EAA.aspx. This is the one I used. The good news is that IronRuby gets to within 99% of MRI pass rate! The bad news is that the MRI pass rate is only 66%. The could be my machine configuration, issues with the ADO driver, issues with the tests not being SQLServer-friendly, etc. It seems that the ADO driver is not supported. For example, it relies on an older version of DBI (that also ships with the MRI 1.8.7 installer) that you can get from http://rubyforge.org/frs/download.php/41304/dbi-0.2.2.zip. So it?s the best solution for now, but may not be in the future. o ADO.Net ? Ivan has a driver at http://github.com/casualjim/ironruby-dbi/ which also gives a pass rate of about 10%. This could potentially be a good story in the future since Ivan is looking to improve it. ? IRDb (http://github.com/rvernagus/activerecord-irdb-adapter) ? This uses ADO.Net I believe. I don?t think Ray has tried running tests with this. Ray and Ivan have helped me a lot over the past few weeks. Thanks guys! I have documented most of the steps to running the tests using mssql_adapter at the bottom of http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#framework-tests. If anyone is interested in pushing on any of the approaches above, let me know and I can help you get setup up. Also, I am sure that Ray and Ivan would appreciate any help with http://github.com/rvernagus/activerecord-irdb-adapter and http://github.com/casualjim/ironruby-dbi/. Thanks, Shri _______________________________________________ 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 Tue Aug 11 17:31:42 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Tue, 11 Aug 2009 14:31:42 -0700 Subject: [Ironruby-core] Cucumber status In-Reply-To: <398d3e0e0906200703u3826a99ftd039de931e0aa201@mail.gmail.com> References: <476923c8e320b7c7651a849948217ecd@ruby-forum.com> <903f202085dd1b97b4572b129eee7fb3@ruby-forum.com> <710DF26F214D2B4BB94287123FFE980A2E207FEF11@NA-EXMSG-C104.redmond.corp.microsoft.com> <398d3e0e0906200703u3826a99ftd039de931e0aa201@mail.gmail.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F252CEE@NA-EXMSG-C118.redmond.corp.microsoft.com> The 0.9.0 release has no known issues with Cucumber. A comment in http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/ mentions a EncoderFallbackException issue, but Tomas checked and it was because the user was using a non-standard character for ?-? (hyphen). If you are interested in using Cucumber, please do try it out and open bugs on http://ironruby.codeplex.com/ for any issues you see so that they can be fixed for the next release. Shri From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Saturday, June 20, 2009 7:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber status Shri, I am very interested in using cucumber for my .Net projects, so I'm willing to give it a go at porting win32console. To that end, I've created a git repo for it on GitHub: http://github.com/hotgazpacho/ironruby-win32console Any guidance anyone can offer would be appreciated. Thanks! -- Will Green http://willgreen.mp/ On Mon, Jun 8, 2009 at 2:46 PM, Shri Borde > wrote: With a build from the latest sources, the Cucumber C# example from http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net is working. Also, only two of the Cucumber tests fail. One seems to be a test issue, and the other is because of http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=22984. Please try out Cucumber and let us know what your experience is. One usability issue is that Cucumber uses the win32console gem to color-code the results it prints to the console, so that failures are in red, etc. However, the win32console is a native gem and does not work with IronRuby, and so you do not get colored output. It should be quite easy to implement the win32console library in pure Ruby code (but marked with platform="ironruby" as mentioned at http://ironruby.net/Documentation/Real_Ruby_Applications/RubyGems) using the System.Console functionality. Anyone interested in doing this? Shri _______________________________________________ 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 shay.friedman at gmail.com Wed Aug 12 00:38:12 2009 From: shay.friedman at gmail.com (Shay Friedman) Date: Wed, 12 Aug 2009 07:38:12 +0300 Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight In-Reply-To: References: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1A82@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: Talking about ASP.Net MVC - Are we planning to ship IronRubyMVC dlls with the IronRuby installation? Thanks! Shay. ---------------------------- Shay Friedman http://www.IronShay.com Follow me: http://twitter.com/ironshay On 8/11/09, Shay Friedman wrote: > Thanks a lot Jimmy! > > I guess I'll stick with ASP.Net MVC for now :) > > ---------------------------- > Shay Friedman > http://www.IronShay.com > Follow me: http://twitter.com/ironshay > > On 8/11/09, Jimmy Schementi wrote: >> ASP.NET - We're working on open-sourcing the IronPython asp.net >> integration. >> We have a prototype of Ruby support, and will eventually extend it to >> fully >> support Ruby. It's currently not planned for the 1.0 release. >> >> Silverlight - AgDLR/sdlsdk/whatever else I called it is no longer the >> place >> for Silverlight integration with Ruby and Python; the respective language >> source trees have the latest source and the language releases have >> binaries >> for use in Silverlight. Take a look at http://sdlsdk.codeplex.com and >> http://github.com/jschementi/agdlr, they both have notices that the sites >> are no longer in use, so agdlr and sdlsdk have already gone-away. For v1 >> we'll also support putting code in tags work, but I'll bring >> that >> up on another thread shortly. >> >> Does that answer your questions Shay? >> ________________________________________ >> From: ironruby-core-bounces at rubyforge.org >> [ironruby-core-bounces at rubyforge.org] on behalf of Shay Friedman >> [lists at ruby-forum.com] >> Sent: Tuesday, August 11, 2009 8:34 AM >> To: ironruby-core at rubyforge.org >> Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight >> >> Hi there, >> >> I've got a question about the plans for V1 for ASP.Net and Silverlight. >> >> Regarding ASP.Net - I know that there is an ASP.NET dynamic language >> support project on codeplex, but it says that the IronRuby support is >> coming. Is there a source code somewhere? >> >> Regarding Silverlight - I remember Jimmy told that agDLR would be going >> away in the future. Is it going to happen soon? >> >> Thanks! >> Shay. >> >> ---------------------------- >> Shay Friedman >> http://www.IronShay.com >> Follow me: http://twitter.com/ironshay >> -- >> 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 Jimmy.Schementi at microsoft.com Wed Aug 12 12:07:07 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 12 Aug 2009 16:07:07 +0000 Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight In-Reply-To: References: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1A82@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <699F4457-B8DE-47D7-8775-8A0B3B46889A@microsoft.com> Not planning on doing that; the release contents are pretty much final. It makes sense for any .net library integration binaries to be it's own seperate package. The only exception in Silverlight since you need special language binaries. ~Jimmy Sent from my phone On Aug 11, 2009, at 9:39 PM, "Shay Friedman" wrote: > Talking about ASP.Net MVC - Are we planning to ship IronRubyMVC dlls > with the IronRuby installation? > > Thanks! > Shay. > > ---------------------------- > Shay Friedman > http://www.IronShay.com > Follow me: http://twitter.com/ironshay > > On 8/11/09, Shay Friedman wrote: >> Thanks a lot Jimmy! >> >> I guess I'll stick with ASP.Net MVC for now :) >> >> ---------------------------- >> Shay Friedman >> http://www.IronShay.com >> Follow me: http://twitter.com/ironshay >> >> On 8/11/09, Jimmy Schementi wrote: >>> ASP.NET - We're working on open-sourcing the IronPython asp.net >>> integration. >>> We have a prototype of Ruby support, and will eventually extend it >>> to >>> fully >>> support Ruby. It's currently not planned for the 1.0 release. >>> >>> Silverlight - AgDLR/sdlsdk/whatever else I called it is no longer >>> the >>> place >>> for Silverlight integration with Ruby and Python; the respective >>> language >>> source trees have the latest source and the language releases have >>> binaries >>> for use in Silverlight. Take a look at http://sdlsdk.codeplex.com >>> and >>> http://github.com/jschementi/agdlr, they both have notices that >>> the sites >>> are no longer in use, so agdlr and sdlsdk have already gone-away. >>> For v1 >>> we'll also support putting code in tags work, but I'll >>> bring >>> that >>> up on another thread shortly. >>> >>> Does that answer your questions Shay? >>> ________________________________________ >>> From: ironruby-core-bounces at rubyforge.org >>> [ironruby-core-bounces at rubyforge.org] on behalf of Shay Friedman >>> [lists at ruby-forum.com] >>> Sent: Tuesday, August 11, 2009 8:34 AM >>> To: ironruby-core at rubyforge.org >>> Subject: [Ironruby-core] IronRuby with ASP.Net and Silverlight >>> >>> Hi there, >>> >>> I've got a question about the plans for V1 for ASP.Net and >>> Silverlight. >>> >>> Regarding ASP.Net - I know that there is an ASP.NET dynamic language >>> support project on codeplex, but it says that the IronRuby support >>> is >>> coming. Is there a source code somewhere? >>> >>> Regarding Silverlight - I remember Jimmy told that agDLR would be >>> going >>> away in the future. Is it going to happen soon? >>> >>> Thanks! >>> Shay. >>> >>> ---------------------------- >>> Shay Friedman >>> http://www.IronShay.com >>> Follow me: http://twitter.com/ironshay >>> -- >>> 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 > From xerxesb at gmail.com Thu Aug 13 00:31:03 2009 From: xerxesb at gmail.com (Xerxes Battiwalla) Date: Thu, 13 Aug 2009 14:31:03 +1000 Subject: [Ironruby-core] Cucumber status In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F252CEE@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <476923c8e320b7c7651a849948217ecd@ruby-forum.com> <903f202085dd1b97b4572b129eee7fb3@ruby-forum.com> <710DF26F214D2B4BB94287123FFE980A2E207FEF11@NA-EXMSG-C104.redmond.corp.microsoft.com> <398d3e0e0906200703u3826a99ftd039de931e0aa201@mail.gmail.com> <9A92D7D99FC1564D8C8F18008B08098F499F252CEE@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: Hi Shri, I think i might have uncovered a bug in IronRuby not playing friendly with Cucumber? I've documented details on my website ([plug] http://www.xerxesb.com/2009/ironruby-0-9-cucumber-and-the-never-ending-story/ [/plug]), but the gist of it is an error citing "wrong number of arguments (1 for 0) (ArgumentError)". The exact same code works under MRI 1.8.6. Is this something you've seen, or should I log it in codeplex? Thanks, Xerxes On Wed, Aug 12, 2009 at 7:31 AM, Shri Borde wrote: > The 0.9.0 release has no known issues with Cucumber. A comment in > http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/ mentions a > EncoderFallbackException issue, but Tomas checked and it was because the > user was using a non-standard character for ?-? (hyphen). If you are > interested in using Cucumber, please do try it out and open bugs on > http://ironruby.codeplex.com/ for any issues you see so that they can be > fixed for the next release. > > > > Shri > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green > Sent: Saturday, June 20, 2009 7:03 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber status > > > > Shri, > > > > I am very?interested?in using cucumber for my .Net projects, so I'm willing > to give it a go at porting win32console. To that end, I've created a git > repo for it on GitHub:?http://github.com/hotgazpacho/ironruby-win32console > > > > Any guidance anyone can offer would be appreciated. Thanks! > > -- > Will Green > http://willgreen.mp/ > > On Mon, Jun 8, 2009 at 2:46 PM, Shri Borde wrote: > > With a build from the latest sources, the Cucumber C# example from > http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net is working. > Also, only two of the Cucumber tests fail. One seems to be a test issue, and > the other is because of > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=22984. Please > try out Cucumber and let us know what your experience is. > > One usability issue is that Cucumber uses the win32console gem to color-code > the results it prints to the console, so that failures are in red, etc. > However, the win32console is a native gem and does not work with IronRuby, > and so you do not get colored output. It should be quite easy to implement > the win32console library in pure Ruby code (but marked with > platform="ironruby" as mentioned at > http://ironruby.net/Documentation/Real_Ruby_Applications/RubyGems) using the > System.Console functionality. Anyone interested in doing this? > > Shri > _______________________________________________ > 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 Shri.Borde at microsoft.com Thu Aug 13 12:32:43 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 13 Aug 2009 09:32:43 -0700 Subject: [Ironruby-core] Cucumber status In-Reply-To: References: <476923c8e320b7c7651a849948217ecd@ruby-forum.com> <903f202085dd1b97b4572b129eee7fb3@ruby-forum.com> <710DF26F214D2B4BB94287123FFE980A2E207FEF11@NA-EXMSG-C104.redmond.corp.microsoft.com> <398d3e0e0906200703u3826a99ftd039de931e0aa201@mail.gmail.com> <9A92D7D99FC1564D8C8F18008B08098F499F252CEE@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F253A4E@NA-EXMSG-C118.redmond.corp.microsoft.com> Does look like a bug. Please do open a bug. Will take a look today -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Xerxes Battiwalla Sent: Wednesday, August 12, 2009 9:31 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber status Hi Shri, I think i might have uncovered a bug in IronRuby not playing friendly with Cucumber? I've documented details on my website ([plug] http://www.xerxesb.com/2009/ironruby-0-9-cucumber-and-the-never-ending-story/ [/plug]), but the gist of it is an error citing "wrong number of arguments (1 for 0) (ArgumentError)". The exact same code works under MRI 1.8.6. Is this something you've seen, or should I log it in codeplex? Thanks, Xerxes On Wed, Aug 12, 2009 at 7:31 AM, Shri Borde wrote: > The 0.9.0 release has no known issues with Cucumber. A comment in > http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/ mentions a > EncoderFallbackException issue, but Tomas checked and it was because the > user was using a non-standard character for "-" (hyphen). If you are > interested in using Cucumber, please do try it out and open bugs on > http://ironruby.codeplex.com/ for any issues you see so that they can be > fixed for the next release. > > > > Shri > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green > Sent: Saturday, June 20, 2009 7:03 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber status > > > > Shri, > > > > I am very?interested?in using cucumber for my .Net projects, so I'm willing > to give it a go at porting win32console. To that end, I've created a git > repo for it on GitHub:?http://github.com/hotgazpacho/ironruby-win32console > > > > Any guidance anyone can offer would be appreciated. Thanks! > > -- > Will Green > http://willgreen.mp/ > > On Mon, Jun 8, 2009 at 2:46 PM, Shri Borde wrote: > > With a build from the latest sources, the Cucumber C# example from > http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net is working. > Also, only two of the Cucumber tests fail. One seems to be a test issue, and > the other is because of > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=22984. Please > try out Cucumber and let us know what your experience is. > > One usability issue is that Cucumber uses the win32console gem to color-code > the results it prints to the console, so that failures are in red, etc. > However, the win32console is a native gem and does not work with IronRuby, > and so you do not get colored output. It should be quite easy to implement > the win32console library in pure Ruby code (but marked with > platform="ironruby" as mentioned at > http://ironruby.net/Documentation/Real_Ruby_Applications/RubyGems) using the > System.Console functionality. Anyone interested in doing this? > > Shri > _______________________________________________ > 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 ryan.riley at panesofglass.org Thu Aug 13 13:33:26 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 12:33:26 -0500 Subject: [Ironruby-core] KernelOps.Sleep Message-ID: I just got the latest from ironruby/ironruby, but I get a build error in Initializers.Generated.cs: "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Ruby.sln" (default target) (1) -> "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\IronRuby.Libraries.csproj" (default target) (11) -> (CoreCompile target) -> Initializers.Generated.cs(2940,17): error CS0407: 'double IronRuby.Builtins.KernelOps.Sleep(object, double)' has the wrong return type Initializers.Generated.cs(3192,17): error CS0407: 'double IronRuby.Builtins.KernelOps.Sleep(object, double)' has the wrong return type In the Sleep method, the return value is a double; however, Initializers expects the method to return an int. Should the return value be cast or converted to an int again (that seems to be part of the latest change)? R^2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Thu Aug 13 14:38:39 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 13 Aug 2009 11:38:39 -0700 Subject: [Ironruby-core] KernelOps.Sleep In-Reply-To: References: Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F253BFA@NA-EXMSG-C118.redmond.corp.microsoft.com> I had pushed a commit where the return type was changed to int in both KernelOps.cs and Initializers.Generated.cs. Have you pulled from my fork? Maybe you got into a bad state when you later pulled from irmain (which uses int in both files) and resolved merge conflicts differently in the two files. Use gitk to see if you have http://github.com/shri/ironruby/commit/a3da993f39235b9d7f712d8d16d7d8bb3bb62079 which will let you determine whether you should go with int or double. Or just do a clean pull from irmain if you don?t want to worry about it. Jim has pulled my changes and will be pushing them to irmain in a day or two anyway? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 13, 2009 10:33 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] KernelOps.Sleep I just got the latest from ironruby/ironruby, but I get a build error in Initializers.Generated.cs: "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Ruby.sln" (default target) (1) -> "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\IronRuby.Libraries.csproj" (default target) (11) -> (CoreCompile target) -> Initializers.Generated.cs(2940,17): error CS0407: 'double IronRuby.Builtins.KernelOps.Sleep(object, double)' has the wrong return type Initializers.Generated.cs(3192,17): error CS0407: 'double IronRuby.Builtins.KernelOps.Sleep(object, double)' has the wrong return type In the Sleep method, the return value is a double; however, Initializers expects the method to return an int. Should the return value be cast or converted to an int again (that seems to be part of the latest change)? R^2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Aug 13 15:24:29 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 13 Aug 2009 19:24:29 +0000 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: Ryan, I need you to update your clone to the latest push. Thanks, JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Monday, August 03, 2009 9:42 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Code Review: rake context Looks good. I?ll pull it in with the next pull. JD ?there is no try http://blog.jredville.com From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Monday, August 03, 2009 9:39 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Code Review: rake context Patch for context.rb: This should allow those who build with "rake compile" to install gems successfully using igem. Changes the context.rb (line 370) :LibraryPaths from "..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\.." to "..\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\.." http://github.com/panesofglass/ironruby/tree/ This is my first one, so I may be doing this wrong. Just let me know. Cheers, Ryan Riley ryan.riley at panesofglass.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Thu Aug 13 15:35:17 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 14:35:17 -0500 Subject: [Ironruby-core] KernelOps.Sleep In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F253BFA@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <9A92D7D99FC1564D8C8F18008B08098F499F253BFA@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: I got it worked out. I went with the return value of int. I had pulled from yours and was trying to get back in sync with irmain. Looks like it's working now. On Thu, Aug 13, 2009 at 1:38 PM, Shri Borde wrote: > I had pushed a commit where the return type was changed to int in both > KernelOps.cs and Initializers.Generated.cs. Have you pulled from my fork? > Maybe you got into a bad state when you later pulled from irmain (which uses > int in both files) and resolved merge conflicts differently in the two > files. Use gitk to see if you have > http://github.com/shri/ironruby/commit/a3da993f39235b9d7f712d8d16d7d8bb3bb62079which will let you determine whether you should go with int or double. Or > just do a clean pull from irmain if you don?t want to worry about it. Jim > has pulled my changes and will be pushing them to irmain in a day or two > anyway? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Thursday, August 13, 2009 10:33 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] KernelOps.Sleep > > > > I just got the latest from ironruby/ironruby, but I get a build error in > Initializers.Generated.cs: > > > > "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Ruby.sln" > (default target) (1) -> > > "C:\Users\rriley1\dev\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\IronRuby.Libraries.csproj" > (default > > target) (11) -> > > (CoreCompile target) -> > > Initializers.Generated.cs(2940,17): error CS0407: 'double > IronRuby.Builtins.KernelOps.Sleep(object, double)' has the > > wrong return type > > Initializers.Generated.cs(3192,17): error CS0407: 'double > IronRuby.Builtins.KernelOps.Sleep(object, double)' has the > > wrong return type > > > > In the Sleep method, the return value is a double; however, Initializers > expects the method to return an int. Should the return value be cast or > converted to an int again (that seems to be part of the latest change)? > > > > R^2 > > _______________________________________________ > 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 ryan.riley at panesofglass.org Thu Aug 13 15:36:53 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 14:36:53 -0500 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: Doing so now. Ryan Riley ryan.riley at panesofglass.org http://panesofglass.org/ http://wizardsofsmart.net/ On Thu, Aug 13, 2009 at 2:24 PM, Jim Deville wrote: > Ryan, > > I need you to update your clone to the latest push. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Thu Aug 13 15:44:29 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 14:44:29 -0500 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: Done. On Thu, Aug 13, 2009 at 2:24 PM, Jim Deville wrote: > Ryan, > > I need you to update your clone to the latest push. > > > > Thanks, > > JD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdeville at microsoft.com Thu Aug 13 15:56:05 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 13 Aug 2009 19:56:05 +0000 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: I think I see what is going on now. Did you commit and push this patch? Or did you just make it and then send the patch file? If the latter, go ahead and commit it to your repo, then push it, and I?ll pull that in to get your changes. Thanks, JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 13, 2009 12:44 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Code Review: rake context Done. On Thu, Aug 13, 2009 at 2:24 PM, Jim Deville > wrote: Ryan, I need you to update your clone to the latest push. Thanks, JD -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.riley at panesofglass.org Thu Aug 13 16:10:06 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 15:10:06 -0500 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: I originally committed and pushed the patch. I am still getting used to git and the commit process. I'm cleaning up my local repo atm, but I can commit it again and push if you like. I should be able to get it in within the hour. On Thu, Aug 13, 2009 at 2:56 PM, Jim Deville wrote: > I think I see what is going on now. Did you commit and push this patch? Or > did you just make it and then send the patch file? > > > > If the latter, go ahead and commit it to your repo, then push it, and I?ll > pull that in to get your changes. > > > > Thanks, > > JD > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ryan Riley > *Sent:* Thursday, August 13, 2009 12:44 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Code Review: rake context > > > > Done. > > On Thu, Aug 13, 2009 at 2:24 PM, Jim Deville > wrote: > > Ryan, > > I need you to update your clone to the latest push. > > > > Thanks, > > JD > > _______________________________________________ > 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 Aug 13 16:12:09 2009 From: jdeville at microsoft.com (Jim Deville) Date: Thu, 13 Aug 2009 20:12:09 +0000 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: Sounds good. Let me know when it?s pushed. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 13, 2009 1:10 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Code Review: rake context I originally committed and pushed the patch. I am still getting used to git and the commit process. I'm cleaning up my local repo atm, but I can commit it again and push if you like. I should be able to get it in within the hour. On Thu, Aug 13, 2009 at 2:56 PM, Jim Deville > wrote: I think I see what is going on now. Did you commit and push this patch? Or did you just make it and then send the patch file? If the latter, go ahead and commit it to your repo, then push it, and I?ll pull that in to get your changes. Thanks, JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ryan Riley Sent: Thursday, August 13, 2009 12:44 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Code Review: rake context Done. On Thu, Aug 13, 2009 at 2:24 PM, Jim Deville > wrote: Ryan, I need you to update your clone to the latest push. Thanks, JD _______________________________________________ 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 ryan.riley at panesofglass.org Thu Aug 13 16:28:04 2009 From: ryan.riley at panesofglass.org (Ryan Riley) Date: Thu, 13 Aug 2009 15:28:04 -0500 Subject: [Ironruby-core] Code Review: rake context In-Reply-To: References: Message-ID: It's pushed. commit 2588ce562a4244a02c61db932d3a5dc20c50c126 Files changed: Merlin/Main/Languages/Ruby/context.rb Ryan Riley On Thu, Aug 13, 2009 at 3:12 PM, Jim Deville wrote: > Sounds good. Let me know when it?s pushed. > > JD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Fri Aug 14 06:21:18 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 14 Aug 2009 12:21:18 +0200 Subject: [Ironruby-core] IronRubyMvc Problem with new Dlls In-Reply-To: References: Message-ID: which ironruby mvc version are you using?The one I have in my github account should work with ironruby 0.9 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Fri, Aug 14, 2009 at 9:42 AM, Shay Friedman wrote: > Hi, > > I've pulled the code of the IronRubyMvc project and compiled - the sample > project worked well. > I noticed that the IronRubyMvc project references were using the IronRuby > 0.4 version. I replaced that to the 0.9 version that I had. After that, the > sample project doesn't load anymore and fails with the next error: > > Server Error in '/' Application.Method not found: 'Void > Microsoft.Scripting.Runtime.Scope.SetVariable(Microsoft.Scripting.SymbolId, > System.Object)'.Line 537: internal void SetGlobalConstant(string/*!*/ > name, object value) { > Line 538: _globalScope.SetVariable(SymbolTable.StringToId(name), value); > Line 539: } > In Merlin\Main\Languages\Ruby\Ruby\Runtime\RubyContext.cs > > Is it something on my end or does the project need some modifications to > work with the new version? > > Thanks! > Shay. > > ---------------------------- > Shay Friedman > http://www.IronShay.com > Follow me: http://twitter.com/ironshay > > _______________________________________________ > 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 Aug 14 12:26:52 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 14 Aug 2009 18:26:52 +0200 Subject: [Ironruby-core] IronRubyMvc Problem with new Dlls In-Reply-To: References: Message-ID: I'm currently tracking releases.. don't have the time to track HEAD anymore sorry Did you recompile ironrubymvc with the new references? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Fri, Aug 14, 2009 at 6:12 PM, Shay Friedman wrote: > Hi Ivan, > > I downloaded your fork and it worked. But... > I've just pulled the latest code from the IronRuby repository. When > changing the references in the IronRubyMvc project to the latest ones, I get > a new exception... > > The exception now is: > *Could not load type 'Microsoft.Scripting.Runtime.IConvertibleMetaObject' > from assembly 'Microsoft.Scripting, Version=0.9.6.20, Culture=neutral, > PublicKeyToken=null'.* > > In the IronRubyMvc project, it fails in the next method: > > private void RequireControllerFile() > { > // > RequireRubyFile(PathProvider.MapPath("~/Controllers/controller.rb")); > Engine.CreateScriptSource( > new > AssemblyStreamContentProvider("System.Web.Mvc.IronRuby.Controllers.controller.rb", > typeof > (IRubyEngine).Assembly), null, Encoding.ASCII).Execute( > CurrentScope); > } > > In the IronRuby code, it fails on RubyBinder.cs in the method: > > public override bool CanConvertFrom(Type/*!*/ fromType, Type/*!*/ toType, > bool toNotNullable, NarrowingLevel level) { > return Converter.CanConvertFrom(null, fromType, toType, > toNotNullable, level, false, false); > } > > Maybe some modifications are needed in order to make this work again. > > I'd be glad to help, just point me where to start from. > > Thanks, > Shay. > > > On Fri, Aug 14, 2009 at 5:00 PM, Shay Friedman wrote: > >> I pulled from jimmy's clone. I will pull from your fork now and try again. >> >> Thanks! >> Shay. >> >> >> On Fri, Aug 14, 2009 at 1:21 PM, Ivan Porto Carrero wrote: >> >>> which ironruby mvc version are you using?The one I have in my github >>> account should work with ironruby 0.9 >>> >>> >>> --- >>> Met vriendelijke groeten - Best regards - Salutations >>> Ivan Porto Carrero >>> Blog: http://flanders.co.nz >>> Twitter: http://twitter.com/casualjim >>> Author of IronRuby in Action (http://manning.com/carrero) >>> >>> >>> >>> On Fri, Aug 14, 2009 at 9:42 AM, Shay Friedman wrote: >>> >>>> Hi, >>>> >>>> I've pulled the code of the IronRubyMvc project and compiled - the >>>> sample project worked well. >>>> I noticed that the IronRubyMvc project references were using the >>>> IronRuby 0.4 version. I replaced that to the 0.9 version that I had. After >>>> that, the sample project doesn't load anymore and fails with the next error: >>>> >>>> Server Error in '/' Application.Method not found: 'Void >>>> Microsoft.Scripting.Runtime.Scope.SetVariable(Microsoft.Scripting.SymbolId, >>>> System.Object)'.Line 537: internal void SetGlobalConstant(string/*!*/ >>>> name, object value) { >>>> Line 538: _globalScope.SetVariable(SymbolTable.StringToId(name), value); >>>> >>>> Line 539: } >>>> In Merlin\Main\Languages\Ruby\Ruby\Runtime\RubyContext.cs >>>> >>>> Is it something on my end or does the project need some modifications to >>>> work with the new version? >>>> >>>> Thanks! >>>> Shay. >>>> >>>> ---------------------------- >>>> Shay Friedman >>>> http://www.IronShay.com >>>> Follow me: http://twitter.com/ironshay >>>> >>>> _______________________________________________ >>>> 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 Fri Aug 14 13:02:45 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Fri, 14 Aug 2009 19:02:45 +0200 Subject: [Ironruby-core] IronRubyMvc Problem with new Dlls In-Reply-To: References: Message-ID: I can't reproduce the error you're getting. in the ironruby git repository folder I did git pull rake compile copied the debug assemblies into the ironrubymvc/dependencies folder Then hit F5 in visual studio on the ironrubymvc website and it shows me the first page. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Fri, Aug 14, 2009 at 6:44 PM, Shay Friedman wrote: > Yupe. > > > > On Fri, Aug 14, 2009 at 7:26 PM, Ivan Porto Carrero wrote: > >> I'm currently tracking releases.. don't have the time to track HEAD >> anymore sorry >> Did you recompile ironrubymvc with the new references? >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero >> GSM: +32.486.787.582 >> Blog: http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> >> >> >> On Fri, Aug 14, 2009 at 6:12 PM, Shay Friedman wrote: >> >>> Hi Ivan, >>> >>> I downloaded your fork and it worked. But... >>> I've just pulled the latest code from the IronRuby repository. When >>> changing the references in the IronRubyMvc project to the latest ones, I get >>> a new exception... >>> >>> The exception now is: >>> *Could not load type >>> 'Microsoft.Scripting.Runtime.IConvertibleMetaObject' from assembly >>> 'Microsoft.Scripting, Version=0.9.6.20, Culture=neutral, >>> PublicKeyToken=null'.* >>> >>> In the IronRubyMvc project, it fails in the next method: >>> >>> private void RequireControllerFile() >>> { >>> // >>> RequireRubyFile(PathProvider.MapPath("~/Controllers/controller.rb")); >>> Engine.CreateScriptSource( >>> new >>> AssemblyStreamContentProvider("System.Web.Mvc.IronRuby.Controllers.controller.rb", >>> typeof >>> (IRubyEngine).Assembly), null, Encoding.ASCII).Execute( >>> CurrentScope); >>> } >>> >>> In the IronRuby code, it fails on RubyBinder.cs in the method: >>> >>> public override bool CanConvertFrom(Type/*!*/ fromType, Type/*!*/ >>> toType, bool toNotNullable, NarrowingLevel level) { >>> return Converter.CanConvertFrom(null, fromType, toType, >>> toNotNullable, level, false, false); >>> } >>> >>> Maybe some modifications are needed in order to make this work again. >>> >>> I'd be glad to help, just point me where to start from. >>> >>> Thanks, >>> Shay. >>> >>> >>> On Fri, Aug 14, 2009 at 5:00 PM, Shay Friedman wrote: >>> >>>> I pulled from jimmy's clone. I will pull from your fork now and try >>>> again. >>>> >>>> Thanks! >>>> Shay. >>>> >>>> >>>> On Fri, Aug 14, 2009 at 1:21 PM, Ivan Porto Carrero < >>>> ivan at flanders.co.nz> wrote: >>>> >>>>> which ironruby mvc version are you using?The one I have in my github >>>>> account should work with ironruby 0.9 >>>>> >>>>> >>>>> --- >>>>> Met vriendelijke groeten - Best regards - Salutations >>>>> Ivan Porto Carrero >>>>> Blog: http://flanders.co.nz >>>>> Twitter: http://twitter.com/casualjim >>>>> Author of IronRuby in Action (http://manning.com/carrero) >>>>> >>>>> >>>>> >>>>> On Fri, Aug 14, 2009 at 9:42 AM, Shay Friedman < >>>>> shay.friedman at gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I've pulled the code of the IronRubyMvc project and compiled - the >>>>>> sample project worked well. >>>>>> I noticed that the IronRubyMvc project references were using the >>>>>> IronRuby 0.4 version. I replaced that to the 0.9 version that I had. After >>>>>> that, the sample project doesn't load anymore and fails with the next error: >>>>>> >>>>>> Server Error in '/' Application.Method not found: 'Void >>>>>> Microsoft.Scripting.Runtime.Scope.SetVariable(Microsoft.Scripting.SymbolId, >>>>>> System.Object)'.Line 537: internal void SetGlobalConstant(string/*!*/ >>>>>> name, object value) { >>>>>> Line 538: _globalScope.SetVariable(SymbolTable.StringToId(name), >>>>>> value); >>>>>> Line 539: } >>>>>> In Merlin\Main\Languages\Ruby\Ruby\Runtime\RubyContext.cs >>>>>> >>>>>> Is it something on my end or does the project need some modifications >>>>>> to work with the new version? >>>>>> >>>>>> Thanks! >>>>>> Shay. >>>>>> >>>>>> ---------------------------- >>>>>> Shay Friedman >>>>>> http://www.IronShay.com >>>>>> Follow me: http://twitter.com/ironshay >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >> >> > > _______________________________________________ > 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 Aug 14 20:16:58 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 15 Aug 2009 00:16:58 +0000 Subject: [Ironruby-core] IronRuby.Rack and IIS 6 In-Reply-To: <000069B1866D8743AA20087BC03D5E2502F69EFB@EXCHANGE2.nobts_web.edu> References: <000069B1866D8743AA20087BC03D5E2502F69EF6@EXCHANGE2.nobts_web.edu> <000069B1866D8743AA20087BC03D5E2502F69EF9@EXCHANGE2.nobts_web.edu> <000069B1866D8743AA20087BC03D5E2502F69EFB@EXCHANGE2.nobts_web.edu> Message-ID: Thanks for doing this investigation! I'll document these web.config changes for IIS 6 so your efforts can benefit others. ~Jimmy Sent from my phone On Aug 14, 2009, at 3:22 PM, "Web Administrator" wrote: > OK. I rearranged the LibraryPaths option in web.config and that > seems to have dealt with the issue. IronRuby.Rack is now serving up > the example app using this web.config on IIS 6: > > > > > > >
type="Microsoft.Scripting.Hosting.Configuration.Section, > Microsoft.Scripting, Version=0.9.5.1, Culture=neutral, > PublicKeyToken=null" requirePermission="false"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > From: Web Administrator > Sent: Fri 8/14/2009 5:02 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] IronRuby.Rack and IIS 6 > > Ok. The web.config has to be done up differently for IIS 6 versus > IIS 7 with relation to the HttpHandlers. I've fixed that and am now > getting a more particular error message regarding not being able to > load thread.so > > web.config and Error trace: http://gist.github.com/168133 > > Error Trace: > > [LoadError: no such file to load -- thread.so] > Microsoft.Scripting.Interpreter.ThrowInstruction.Run > (InterpretedFrame frame) in C:\Documents and Settings\webadmin\My > Documents\Development\ironruby\Merlin\Main\Runtime > \Microsoft.Scripting\Interpreter\Instruction.cs:760 > Microsoft.Scripting.Interpreter.Interpreter.RunInstructions > (InterpretedFrame frame) in C:\Documents and Settings\webadmin\My > Documents\Development\ironruby\Merlin\Main\Runtime > \Microsoft.Scripting\Interpreter\Interpreter.cs:233 > Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) in C:\Documents and Settings\webadmin\My Documents\Development > \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Interpreter > \Interpreter.cs:94 > Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) > in C:\Documents and Settings\webadmin\My Documents\Development > \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Interpreter > \LightLambda.Generated.cs:93 > IronRuby.Runtime.RubyScriptCode.Run(Scope scope, Boolean > bindGlobals) in C:\Documents and Settings\webadmin\My Documents > \Development\ironruby\Merlin\Main\Languages\Ruby\Ruby\Runtime > \RubyScriptCode.cs:107 > IronRuby.Runtime.RubyScriptCode.Run(Scope scope) in C:\Documents > and Settings\webadmin\My Documents\Development\ironruby\Merlin\Main > \Languages\Ruby\Ruby\Runtime\RubyScriptCode.cs:79 > Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) in C:\Documents and Settings\webadmin\My Documents > \Development\ironruby\Merlin\Main\Runtime\Microsoft.Scripting > \SourceUnit.cs:232 > Microsoft.Scripting.SourceUnit.Execute(Scope scope) in C: > \Documents and Settings\webadmin\My Documents\Development\ironruby > \Merlin\Main\Runtime\Microsoft.Scripting\SourceUnit.cs:217 > Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope > scope) in C:\Documents and Settings\webadmin\My Documents\Development > \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Hosting > \ScriptSource.cs:133 > IronRuby.Rack.RubyEngine.Execute(String code, ScriptScope aScope) > in C:\Documents and Settings\webadmin\My Documents\Development > \ironruby\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:53 > IronRuby.Rack.RubyEngine.Execute(String code) in C:\Documents and > Settings\webadmin\My Documents\Development\ironruby\Merlin\Main\Hosts > \IronRuby.Rack\RubyEngine.cs:48 > IronRuby.Rack.Utils.ReportError(HttpContext context, Exception e) > in C:\Documents and Settings\webadmin\My Documents\Development > \ironruby\Merlin\Main\Hosts\IronRuby.Rack\Utils.cs:52 > IronRuby.Rack.HttpHandlerFactory.GetHandler(HttpContext context, > String requestType, String url, String pathTranslated) in C: > \Documents and Settings\webadmin\My Documents\Development\ironruby > \Merlin\Main\Hosts\IronRuby.Rack\HttpHandlerFactory.cs:48 > System.Web.HttpApplication.MapHttpHandler(HttpContext context, > String requestType, VirtualPath path, String pathTranslated, Boolean > useAppConfig) +193 > > System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute( > ) +93 > System.Web.HttpApplication.ExecuteStep(IExecutionStep step, > Boolean& completedSynchronously) +155 > > > -----Original Message----- > From: Web Administrator > Sent: Fri 8/14/2009 3:55 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IronRuby.Rack and IIS 6 > > I am trying to get IronRuby.Rack working with an IIS 6 install on > Windows Server 2003. > > I successfully compiled the necessary DLLs and put them into a bin/ > folder alongside the files from IronRuby.Rack.Example which I simply > copied over to my IIS machine and assigned appropriate permissions. > > I went through everything I can think of in terms of setting ASP.NET > to 2.0.x and setting up a wildcard handler that points to the aspnet > DLL. But everything I've done yields an ugly Directory Listing Not > Allowed error. > > I don't have access to any servers that can use IIS 7, so I'm stuck. > Any ideas as far as what may be going wrong. > > > Thanks, > James Thompson > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From webadmin at nobts.edu Sat Aug 15 00:17:31 2009 From: webadmin at nobts.edu (Web Administrator) Date: Fri, 14 Aug 2009 23:17:31 -0500 Subject: [Ironruby-core] IronRuby.Rack and IIS 6 In-Reply-To: References: <000069B1866D8743AA20087BC03D5E2502F69EF6@EXCHANGE2.nobts_web.edu> <000069B1866D8743AA20087BC03D5E2502F69EF9@EXCHANGE2.nobts_web.edu> <000069B1866D8743AA20087BC03D5E2502F69EFB@EXCHANGE2.nobts_web.edu> Message-ID: I plan to write up a fully illustrated how-to Monday or Tuesday for getting things working on IIS6. I'll post the link to the list when it goes up. Sent from my iPhone On Aug 14, 2009, at 7:12 PM, "Jimmy Schementi" wrote: > Thanks for doing this investigation! I'll document these web.config > changes for IIS 6 so your efforts can benefit others. > > ~Jimmy > Sent from my phone > > On Aug 14, 2009, at 3:22 PM, "Web Administrator" > wrote: > >> OK. I rearranged the LibraryPaths option in web.config and that >> seems to have dealt with the issue. IronRuby.Rack is now serving up >> the example app using this web.config on IIS 6: >> >> >> >> >> >> >>
> type="Microsoft.Scripting.Hosting.Configuration.Section, >> Microsoft.Scripting, Version=0.9.5.1, Culture=neutral, >> PublicKeyToken=null" requirePermission="false"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -----Original Message----- >> From: Web Administrator >> Sent: Fri 8/14/2009 5:02 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] IronRuby.Rack and IIS 6 >> >> Ok. The web.config has to be done up differently for IIS 6 versus >> IIS 7 with relation to the HttpHandlers. I've fixed that and am now >> getting a more particular error message regarding not being able to >> load thread.so >> >> web.config and Error trace: http://gist.github.com/168133 >> >> Error Trace: >> >> [LoadError: no such file to load -- thread.so] >> Microsoft.Scripting.Interpreter.ThrowInstruction.Run >> (InterpretedFrame frame) in C:\Documents and Settings\webadmin\My >> Documents\Development\ironruby\Merlin\Main\Runtime >> \Microsoft.Scripting\Interpreter\Instruction.cs:760 >> Microsoft.Scripting.Interpreter.Interpreter.RunInstructions >> (InterpretedFrame frame) in C:\Documents and Settings\webadmin\My >> Documents\Development\ironruby\Merlin\Main\Runtime >> \Microsoft.Scripting\Interpreter\Interpreter.cs:233 >> Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame >> frame) in C:\Documents and Settings\webadmin\My Documents\Development >> \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Interpreter >> \Interpreter.cs:94 >> Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) >> in C:\Documents and Settings\webadmin\My Documents\Development >> \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Interpreter >> \LightLambda.Generated.cs:93 >> IronRuby.Runtime.RubyScriptCode.Run(Scope scope, Boolean >> bindGlobals) in C:\Documents and Settings\webadmin\My Documents >> \Development\ironruby\Merlin\Main\Languages\Ruby\Ruby\Runtime >> \RubyScriptCode.cs:107 >> IronRuby.Runtime.RubyScriptCode.Run(Scope scope) in C:\Documents >> and Settings\webadmin\My Documents\Development\ironruby\Merlin\Main >> \Languages\Ruby\Ruby\Runtime\RubyScriptCode.cs:79 >> Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink >> errorSink) in C:\Documents and Settings\webadmin\My Documents >> \Development\ironruby\Merlin\Main\Runtime\Microsoft.Scripting >> \SourceUnit.cs:232 >> Microsoft.Scripting.SourceUnit.Execute(Scope scope) in C: >> \Documents and Settings\webadmin\My Documents\Development\ironruby >> \Merlin\Main\Runtime\Microsoft.Scripting\SourceUnit.cs:217 >> Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope >> scope) in C:\Documents and Settings\webadmin\My Documents\Development >> \ironruby\Merlin\Main\Runtime\Microsoft.Scripting\Hosting >> \ScriptSource.cs:133 >> IronRuby.Rack.RubyEngine.Execute(String code, ScriptScope aScope) >> in C:\Documents and Settings\webadmin\My Documents\Development >> \ironruby\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:53 >> IronRuby.Rack.RubyEngine.Execute(String code) in C:\Documents and >> Settings\webadmin\My Documents\Development\ironruby\Merlin\Main\Hosts >> \IronRuby.Rack\RubyEngine.cs:48 >> IronRuby.Rack.Utils.ReportError(HttpContext context, Exception e) >> in C:\Documents and Settings\webadmin\My Documents\Development >> \ironruby\Merlin\Main\Hosts\IronRuby.Rack\Utils.cs:52 >> IronRuby.Rack.HttpHandlerFactory.GetHandler(HttpContext context, >> String requestType, String url, String pathTranslated) in C: >> \Documents and Settings\webadmin\My Documents\Development\ironruby >> \Merlin\Main\Hosts\IronRuby.Rack\HttpHandlerFactory.cs:48 >> System.Web.HttpApplication.MapHttpHandler(HttpContext context, >> String requestType, VirtualPath path, String pathTranslated, Boolean >> useAppConfig) +193 >> >> System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute( >> ) +93 >> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, >> Boolean& completedSynchronously) +155 >> >> >> -----Original Message----- >> From: Web Administrator >> Sent: Fri 8/14/2009 3:55 PM >> To: ironruby-core at rubyforge.org >> Subject: [Ironruby-core] IronRuby.Rack and IIS 6 >> >> I am trying to get IronRuby.Rack working with an IIS 6 install on >> Windows Server 2003. >> >> I successfully compiled the necessary DLLs and put them into a bin/ >> folder alongside the files from IronRuby.Rack.Example which I simply >> copied over to my IIS machine and assigned appropriate permissions. >> >> I went through everything I can think of in terms of setting ASP.NET >> to 2.0.x and setting up a wildcard handler that points to the aspnet >> DLL. But everything I've done yields an ugly Directory Listing Not >> Allowed error. >> >> I don't have access to any servers that can use IIS 7, so I'm stuck. >> Any ideas as far as what may be going wrong. >> >> >> Thanks, >> James Thompson >> >> >> >> _______________________________________________ >> 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 Aug 16 20:17:14 2009 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Mon, 17 Aug 2009 02:17:14 +0200 Subject: [Ironruby-core] Feedback In-Reply-To: <7c1b59c00908161354j612aafc1g781dd9af57a56bf7@mail.gmail.com> References: <7c1b59c00908161354j612aafc1g781dd9af57a56bf7@mail.gmail.com> Message-ID: <43d756720908161717l218669c7td1c9c9edec5d0b3d@mail.gmail.com> On Sun, Aug 16, 2009 at 10:54 PM, Orion Edwards wrote: > I've previously (with IronRuby versions 0.5,0.6 and earlier nightlies) tried > to do various tasks using IronRuby, for 3 reasons: > 1. Because ruby is a great language and I want to use it. > 2. I believe IronRuby is especially valuable for fitting in with all the > .NET 'business code' around, and I hope any feedback I can provide might be > useful to you? > 3. To promote IronRuby amongst my company and local community > However, I'd always come up against unfixable blockers, and had to abandon > the effort. > With 0.9 however, I've actually succeeded, and have built an > automated-integration-testing setup (testing production code on dedicated > machines) using IronRuby. > I'd like to offer some feedback based on this: > * First of all, congratulations on all the progress! Being able to actually > use IronRuby on a real project has been really satisfying.?You guys are > awesome! > * ?The main issue I now have with IronRuby at the moment is startup time. > It takes around 4 seconds warm-starting iirb on my core2quad with 4 gigs of > RAM, and far far longer (some 30-odd seconds) cold starting on a lesser > machine. I've ngen'ed all the IronRuby dll's on both machines. > Anything you could do to reduce this time would make a huge impact (really, > I'd be over the moon), and I'd gladly trade off a bit of runtime speed if it > was needed. > * ?It also feels like parsing files (require 'blah.rb', or requiring lots of > files) is a slow operation. I don't have any objective data to back this up, > but it seems to fit, given that warm-starting just ir.exe takes approx 0.5 > seconds instead of 4 > * ?On the plus side, being able to just distribute the 5 core dll's and omit > the ruby standard library if needed is really great. One of the best things > about IronRuby thus far has been that all I need to do to deploy it is copy > a few files and presto. > * ?I'm primarily using it for scripting rather than any actual computation > so I'm not compute-bound, but my impression has been that the current > runtime-performance of IronRuby is great (the problem is "solved" as far as > I'm concerned) > As an aside: the win32 console is atrocious?(which negatively impacts irb > greatly). Please could someone at microsoft take a mac, run terminal.app, > and go and beat the windows team over the head with it. You could substitute > any linux distro for the mac if you don't have one. To be clear, I don't > mean powershell vs cmd.exe, I mean the actual display/renderer, which looks > like it hasn't changed since windows 3.1, and can't even copy/paste a > multi-line block of text properly! rofl. I think the windows team surely would have liked to make it better but I am sure they weren't given the time. someone should beat the responsible manager over the head with it ;) > Thanks for all the hard work, keep it up! > Orion > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > From jdeville at microsoft.com Sun Aug 16 23:44:54 2009 From: jdeville at microsoft.com (Jim Deville) Date: Mon, 17 Aug 2009 03:44:54 +0000 Subject: [Ironruby-core] Feedback In-Reply-To: <43d756720908161717l218669c7td1c9c9edec5d0b3d@mail.gmail.com> References: <7c1b59c00908161354j612aafc1g781dd9af57a56bf7@mail.gmail.com> <43d756720908161717l218669c7td1c9c9edec5d0b3d@mail.gmail.com> Message-ID: This doesn't solve the problem in any way, but Console2 (on SourceForge gives you tabs and proper(-ish) cut and paste. I, too, long for the day when conhost.exe is a real console. If I ever get asked, I will pass this request on ;) JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Sunday, August 16, 2009 5:17 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Feedback On Sun, Aug 16, 2009 at 10:54 PM, Orion Edwards wrote: > I've previously (with IronRuby versions 0.5,0.6 and earlier nightlies) > tried to do various tasks using IronRuby, for 3 reasons: > 1. Because ruby is a great language and I want to use it. > 2. I believe IronRuby is especially valuable for fitting in with all > the .NET 'business code' around, and I hope any feedback I can provide > might be useful to you? > 3. To promote IronRuby amongst my company and local community However, > I'd always come up against unfixable blockers, and had to abandon the > effort. > With 0.9 however, I've actually succeeded, and have built an > automated-integration-testing setup (testing production code on > dedicated > machines) using IronRuby. > I'd like to offer some feedback based on this: > * First of all, congratulations on all the progress! Being able to > actually use IronRuby on a real project has been really satisfying. > You guys are awesome! > * The main issue I now have with IronRuby at the moment is startup time. > It takes around 4 seconds warm-starting iirb on my core2quad with 4 > gigs of RAM, and far far longer (some 30-odd seconds) cold starting on > a lesser machine. I've ngen'ed all the IronRuby dll's on both machines. > Anything you could do to reduce this time would make a huge impact > (really, I'd be over the moon), and I'd gladly trade off a bit of > runtime speed if it was needed. > * It also feels like parsing files (require 'blah.rb', or requiring > lots of > files) is a slow operation. I don't have any objective data to back > this up, but it seems to fit, given that warm-starting just ir.exe > takes approx 0.5 seconds instead of 4 > * On the plus side, being able to just distribute the 5 core dll's > and omit the ruby standard library if needed is really great. One of > the best things about IronRuby thus far has been that all I need to do > to deploy it is copy a few files and presto. > * I'm primarily using it for scripting rather than any actual > computation so I'm not compute-bound, but my impression has been that > the current runtime-performance of IronRuby is great (the problem is > "solved" as far as I'm concerned) As an aside: the win32 console is > atrocious (which negatively impacts irb greatly). Please could someone > at microsoft take a mac, run terminal.app, and go and beat the windows > team over the head with it. You could substitute any linux distro for > the mac if you don't have one. To be clear, I don't mean powershell vs > cmd.exe, I mean the actual display/renderer, which looks like it > hasn't changed since windows 3.1, and can't even copy/paste a > multi-line block of text properly! rofl. I think the windows team surely would have liked to make it better but I am sure they weren't given the time. someone should beat the responsible manager over the head with it ;) > Thanks for all the hard work, keep it up! > Orion > > > _______________________________________________ > 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 suppakilla at gmail.com Mon Aug 17 09:32:08 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Mon, 17 Aug 2009 15:32:08 +0200 Subject: [Ironruby-core] Some deleted tag files have appeared again in the Git repository Message-ID: <3bf20550908170632l67252d50med70aac5925994a2@mail.gmail.com> Hi, I'm guessing this is not intentional, but I just noticed that a bunch of tag files deleted with the commit 6f32be3294cbd4a814066d08a30b51f4f6ea5c3a were recreated with the commit c36ca6b5e0c96bb9f567f1d43db896124157887b, while the rest of the changes in the source code that made possible to clear the very same tags are still there. What happened? Thanks, Daniele -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN From Shri.Borde at microsoft.com Mon Aug 17 14:26:42 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 17 Aug 2009 11:26:42 -0700 Subject: [Ironruby-core] Some deleted tag files have appeared again in the Git repository In-Reply-To: <3bf20550908170632l67252d50med70aac5925994a2@mail.gmail.com> References: <3bf20550908170632l67252d50med70aac5925994a2@mail.gmail.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F49A240CF24@NA-EXMSG-C118.redmond.corp.microsoft.com> The file probably got recreated during merge conflict resolution. Jim is OOF today. He can look into it when he gets back. Also, Jim is going to pull newer versions of the specs, and will be regenerating the tag files soon anyway (as needs to be done after every pull from the RubySpec repo). Thanks for the watchful eye! -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Monday, August 17, 2009 6:32 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Some deleted tag files have appeared again in the Git repository Hi, I'm guessing this is not intentional, but I just noticed that a bunch of tag files deleted with the commit 6f32be3294cbd4a814066d08a30b51f4f6ea5c3a were recreated with the commit c36ca6b5e0c96bb9f567f1d43db896124157887b, while the rest of the changes in the source code that made possible to clear the very same tags are still there. What happened? Thanks, Daniele -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From suppakilla at gmail.com Tue Aug 18 10:04:09 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Tue, 18 Aug 2009 16:04:09 +0200 Subject: [Ironruby-core] A couple of doubts (related to Time) Message-ID: <3bf20550908180704n49bb3e55h633fb1ecf502736f@mail.gmail.com> Hi, I encountered a few bugs in IronRuby while running the specs for rufus-scheduler (http://github.com/jmettraux/rufus-scheduler/). I'm fixing some of them right now, but in the meanwhile I bumped into a couple of issues running the rubyspecs for the Time class: * Time.at creates a dup time object with the value given by time See http://gist.github.com/169660 . The implementation of DateTime.Create(object, DateTime) returns a new DateTime created from self, but the two instances on the "ruby side" have the same object_id. I investigated a little bit more and noticed that there is only one DateTime element in the associated _valueTypeInstanceData of the current RubyContext. Well, no wonder: DateTime is a ValueType, the two values shares the same hashcode and _valueTypeInstanceData is a Dictionary. Honestly I don't think this poses any real problems, but still it is a different behaviour from the MRI. Thoughts? * Time.at converts to time object There was a bug in Time#at which got already fixed on my local repository, even so this spec is still failing. This time the problem is related to the rubyspecs: if you take a look at the the localtime method in rubyspec\core\time\fixtures\methods.rb (it returns the current local time from the OS), you can note that it works only for POSIX-systems. I can't think of a good and clean way to get this fixed, hope to hear Jim's thoughts about this one. Thanks, Daniele -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN From suppakilla at gmail.com Tue Aug 18 10:07:43 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Tue, 18 Aug 2009 16:07:43 +0200 Subject: [Ironruby-core] Some deleted tag files have appeared again in the Git repository In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F49A240CF24@NA-EXMSG-C118.redmond.corp.microsoft.com> References: <3bf20550908170632l67252d50med70aac5925994a2@mail.gmail.com> <9A92D7D99FC1564D8C8F18008B08098F49A240CF24@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <3bf20550908180707u1bb4f14bv5f3eed42220e6556@mail.gmail.com> Oh, I see. Thanks :-) On Mon, Aug 17, 2009 at 20:26, Shri Borde wrote: > The file probably got recreated during merge conflict resolution. Jim is OOF today. He can look into it when he gets back. Also, Jim is going to pull newer versions of the specs, and will be regenerating the tag files soon anyway (as needs to be done after every pull from the RubySpec repo). Thanks for the watchful eye! > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Monday, August 17, 2009 6:32 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Some deleted tag files have appeared again in the Git repository > > Hi, > > I'm guessing this is not intentional, but I just noticed that a bunch > of tag files deleted with the commit > 6f32be3294cbd4a814066d08a30b51f4f6ea5c3a were recreated with the > commit c36ca6b5e0c96bb9f567f1d43db896124157887b, while the rest of the > changes in the source code that made possible to clear the very same > tags are still there. What happened? > > Thanks, > Daniele > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > http://twitter.com/JoL1hAHN > _______________________________________________ > 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/ http://twitter.com/JoL1hAHN From jirapong.nanta at gmail.com Wed Aug 19 02:02:49 2009 From: jirapong.nanta at gmail.com (jirapong.nanta at gmail.com) Date: Wed, 19 Aug 2009 13:02:49 +0700 Subject: [Ironruby-core] A couple of doubts (related to Time) In-Reply-To: <3bf20550908180704n49bb3e55h633fb1ecf502736f@mail.gmail.com> References: <3bf20550908180704n49bb3e55h633fb1ecf502736f@mail.gmail.com> Message-ID: Hello Daniele, About the DateTime in ironruby, you might encountered same problem with me. The implementation in IronRuby use .NET DateTime struct which unable to maintain reference id. I was introduce RubyDateTime class to solve this problem, but unfortunately i didn't have time to finish it yet. My todo list: RubyDateTime.cs - Replace DateTime in the codebase - Converter.IsIntegral might need to be - override Equals, HashCode, and ToString (remember this is immutable DateTime) - Constructor as a DateTime - Make it Serializable - see msdn.com any other interfaces/attributes to propagate to - define implicit operator converting from and to DateTime so that Ruby code can pass a Ruby Time object to a CLR method that expects DateTime. - change comment "?Encapsulates DateTime and supports mutating of instances (whereas DateTime is immutable)? - Time#utc spec should be "modifies the receiver" - fix for rfc2822 spec You can find more info at - http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1021 Bests, -Jirapong On Aug 18, 2009, at 9:04 PM, Daniele Alessandri wrote: > Hi, > I encountered a few bugs in IronRuby while running the specs for > rufus-scheduler (http://github.com/jmettraux/rufus-scheduler/). I'm > fixing some of them right now, but in the meanwhile I bumped into a > couple of issues running the rubyspecs for the Time class: > > * Time.at creates a dup time object with the value given by time > See http://gist.github.com/169660 . The implementation of > DateTime.Create(object, DateTime) returns a new DateTime created from > self, but the two instances on the "ruby side" have the same > object_id. I investigated a little bit more and noticed that there is > only one DateTime element in the associated _valueTypeInstanceData of > the current RubyContext. Well, no wonder: DateTime is a ValueType, the > two values shares the same hashcode and _valueTypeInstanceData is a > Dictionary. Honestly I don't think this > poses any real problems, but still it is a different behaviour from > the MRI. Thoughts? > > * Time.at converts to time object > There was a bug in Time#at which got already fixed on my local > repository, even so this spec is still failing. This time the problem > is related to the rubyspecs: if you take a look at the the localtime > method in rubyspec\core\time\fixtures\methods.rb (it returns the > current local time from the OS), you can note that it works only for > POSIX-systems. I can't think of a good and clean way to get this > fixed, hope to hear Jim's thoughts about this one. > > Thanks, > Daniele > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > http://twitter.com/JoL1hAHN > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From ivan at flanders.co.nz Wed Aug 19 02:10:49 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 19 Aug 2009 08:10:49 +0200 Subject: [Ironruby-core] IronRubyMvc Filters and View Helpers In-Reply-To: References: Message-ID: regarding helpers. You need to open up a class and add your methods there. module System::Web::Mvc::IronRuby::Helpers class RubyHtmlHelper def menu_link(text, url, key, route_value_key=:controller) if key.to_s.underscore == view_context.route_data.values[route_value_key].underscore "
  • #{text}
  • " else "
  • #{text}
  • " end end def login_menu_link(login_text="Log in", logout_text="Log out", login_action=:log_on, logout_action=:log_off, controller=:account) text, act = view_context.controller.is_authenticated? ? [logout_text, logout_action] : [login_text, login_action] menu_link text, "/#{controller}/#{act}", controller end def format_chat_body(chat_body) encode(chat_body).gsub("\n", "
    ") end end end You can define filters in multiple ways, and the way you've chosen is only there for working with legacy filters (legacy as in written in C# :)). for example to implement the AuthorizationFilter you can do so by implementing the following class class RubyAuthorizationFilter < AuthorizationFilter def on_authorization(context) # put authorization logic here end end and then in the controller you do filter RubyAuthorizationFilter or you could do it in a more rubyesque way authorized_action :index do |context| # add authorization logic here end from then on that controller requires authorization to get to its actions. The latter uses the built in AuthorizationFilter too but tucks it away. If you're curious as to how this works: http://github.com/casualjim/ironrubymvc/blob/79efbd0f5baf52d3fbfe8f21a0349d6343dc994b/IronRubyMvc/Controllers/controller.rb#L173 Hope this helps --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Wed, Aug 19, 2009 at 7:36 AM, Shay Friedman wrote: > Hi guys, > > I'm playing with IronRubyMvc, which is just great BTW, and I have two > issues I'm struggling with - filters and view helpers. > > About filters, I understand that this is done with the filter method which > receives the method name and filter class. How can I use for example, the > built-in Authorize filter and give it its initial values (like allowed roles > or users)? because I need to pass on the name of the class and not an > instance, I couldn't figure out how to pass the values as well. > > Regarding custom view helpers, is it possible to add those using rb files? > I've tried to add an rb file to the Helpers folder but it doesn't seem to be > read from anywhere (I had also added some syntax mistakes and never got an > exception about them). > > Once again, the IronRubyMvc framework is awesome! > > Thanks! > Shay. > > ---------------------------- > Shay Friedman > http://www.IronShay.com > Follow me: http://twitter.com/ironshay > > _______________________________________________ > 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 Thu Aug 20 07:01:03 2009 From: lists at ruby-forum.com (Qwerty Qwerty) Date: Thu, 20 Aug 2009 13:01:03 +0200 Subject: [Ironruby-core] Watir under IronRuby Error Message-ID: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> Hi all, I am trying to get my Watir scripts running under IronRuby, but am encountering the following error: :0:in `require': no such file to load -- dl (LoadError) from C:/ironruby-0.9.0/lib/ruby/1.8/dl/import.rb:3 from ./watir/winClicker.rb:53 from ./watir.rb:42 Any help gratefully appreciated! -- Posted via http://www.ruby-forum.com/. From ivan at flanders.co.nz Thu Aug 20 07:13:06 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 20 Aug 2009 13:13:06 +0200 Subject: [Ironruby-core] Watir under IronRuby Error In-Reply-To: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> References: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> Message-ID: Doesn't watir use C-based extensions. In that case they have to be ported to .NET in order to use it. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Thu, Aug 20, 2009 at 1:01 PM, Qwerty Qwerty wrote: > Hi all, > > I am trying to get my Watir scripts running under IronRuby, but am > encountering the following error: > > :0:in `require': no such file to load -- dl (LoadError) > from C:/ironruby-0.9.0/lib/ruby/1.8/dl/import.rb:3 > from ./watir/winClicker.rb:53 > from ./watir.rb:42 > > Any help gratefully appreciated! > -- > 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 lists at ruby-forum.com Thu Aug 20 11:48:48 2009 From: lists at ruby-forum.com (Maxim Maslov) Date: Thu, 20 Aug 2009 17:48:48 +0200 Subject: [Ironruby-core] Time.now and System::Text::EncoderFallbackException Message-ID: Hi all, I've got a strange problem with Time.now (and System.DateTime.Now, of course) when the current culture is set to 'ru-RU', 'pl-PL' or some other cultures: V:\PROGS\Ruby\Migrate\ClearQuest>D:\Progs\Ruby\IronRuby-0.9.0\bin\ir.exe IronRuby 0.9.0.0 on .NET 2.0.50727.3082 Copyright (c) Microsoft Corporation. All rights reserved. >>> include System::Globalization => Object >>> include System::Threading => Object >>> Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture('ru- RU') => ru-RU >>> Time.now => mscorlib:0:in `GetBytes': Value does not fall within the expected range. (Sys tem::Text::EncoderFallbackException) from mscorlib:0:in `GetBytes' from :0 Can anybody help? Thanks, Maxim Maslov -- Posted via http://www.ruby-forum.com/. From Tomas.Matousek at microsoft.com Thu Aug 20 12:28:57 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 20 Aug 2009 16:28:57 +0000 Subject: [Ironruby-core] Time.now and System::Text::EncoderFallbackException In-Reply-To: References: Message-ID: <4B342496A3EFEB48839E10BB4BF5964C02480509@TK5EX14MBXC131.redmond.corp.microsoft.com> DataTime.inspect is supposed to use invariant culture for formatting the time. I think I've fixed this recently. Can you try the latest build? >>> Time.now => Thu Aug 20 09:19:50 -07:00 2009 As a workaround you can do Time.now.ToString('hh mm ss, MMM yyyy') for example. Note that MRI 1.8 doesn't support encoded strings well. We are trying to make them work but we haven't fixed all Ruby string manipulating methods yet. Everything should just work if you use CLR strings. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Maxim Maslov Sent: Thursday, August 20, 2009 8:49 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Time.now and System::Text::EncoderFallbackException Hi all, I've got a strange problem with Time.now (and System.DateTime.Now, of course) when the current culture is set to 'ru-RU', 'pl-PL' or some other cultures: V:\PROGS\Ruby\Migrate\ClearQuest>D:\Progs\Ruby\IronRuby-0.9.0\bin\ir.exe IronRuby 0.9.0.0 on .NET 2.0.50727.3082 Copyright (c) Microsoft Corporation. All rights reserved. >>> include System::Globalization => Object >>> include System::Threading => Object >>> Thread.CurrentThread.CurrentCulture = >>> CultureInfo.CreateSpecificCulture('ru- RU') => ru-RU >>> Time.now => mscorlib:0:in `GetBytes': Value does not fall within the expected range. (Sys tem::Text::EncoderFallbackException) from mscorlib:0:in `GetBytes' from :0 Can anybody help? Thanks, Maxim Maslov -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Jimmy.Schementi at microsoft.com Thu Aug 20 14:42:25 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 20 Aug 2009 18:42:25 +0000 Subject: [Ironruby-core] Watir under IronRuby Error In-Reply-To: References: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> Message-ID: I think it only uses dl/import for FireWatir (it uses a firefox hash plugin to communicate); IE support should just depend on win32ole. Anyone want to dig into what watir is using dl/import for? ~Jimmy Sent from my phone On Aug 20, 2009, at 4:14 AM, "Ivan Porto Carrero" > wrote: Doesn't watir use C-based extensions. In that case they have to be ported to .NET in order to use it. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Thu, Aug 20, 2009 at 1:01 PM, Qwerty Qwerty <lists at ruby-forum.com> wrote: Hi all, I am trying to get my Watir scripts running under IronRuby, but am encountering the following error: :0:in `require': no such file to load -- dl (LoadError) from C:/ironruby-0.9.0/lib/ruby/1.8/dl/import.rb:3 from ./watir/winClicker.rb:53 from ./watir.rb:42 Any help gratefully appreciated! -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From suppakilla at gmail.com Sun Aug 23 09:15:59 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Sun, 23 Aug 2009 15:15:59 +0200 Subject: [Ironruby-core] Core Review: Time and IO#open fixes Message-ID: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> Hi, here are some fixes for bugs I encountered while testing Ruote (http://github.com/jmettraux/ruote/) with IronRuby. As a side note, Ruote and its test suite depend on about 13 external libraries, and the fact that the number of failing tests is pretty much similar as if the suite was executed under MRI 1.8.6 on Windows is impressive to me. There is still a bunch of issues though, I will write a report later this week. * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 Miscellaneous fixes to Time: o The local time in Time.at must be computed on the result of the addition of seconds to the UTC value of epoch o Wrong bitmask in TimeOps.Load(RubyContext,object,MutableString) used to extract minutes and seconds from the binary data representing a ruby-marshalled instance of DateTime. o Time.local/Time.utc: . Added support for string and float arguments . The month argument is parsed as a number or a three-letter English name when it is string. . Added overloads to accepts 10 int/float arguments (C-style gmtime values, Time#to_a) * http://github.com/nrk/ironruby/commit/87d97c2cea0d917d72c5cd513b793bea3a502d3f Fixed a NullReferenceException in RubyIOOps.Open() raised when IO#open receives nil as the block parameter. irb(main):001:0> File.open("test.txt", &(nil)) => # irb(main):002:0> File.open("test.txt", &(Proc.new { |f| puts f.path })) test.txt => nil See the attached diff. -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN -------------- next part -------------- diff --git a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt index 3ad8a21..22df910 100644 --- a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt +++ b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt @@ -1,8 +1,4 @@ fails:Time.local creates a time based on given values, interpreted in the local time zone fails:Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone -fails:Time.local handles string-like second argument -fails:Time.local handles string arguments -fails:Time.local handles float arguments fails:Time.local should accept various year ranges fails:Time.local throws ArgumentError for out of range values -fails:Time.local throws ArgumentError for invalid number of arguments diff --git a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt index e8e7bdd..c6fa1a0 100644 --- a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt +++ b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt @@ -1,9 +1,5 @@ fails:Time.utc creates a time based on given values, interpreted as UTC (GMT) fails:Time.utc creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT) -fails:Time.utc handles string-like second argument -fails:Time.utc handles string arguments -fails:Time.utc handles float arguments fails:Time.utc should accept various year ranges fails:Time.utc throws ArgumentError for out of range values -fails:Time.utc throws ArgumentError for invalid number of arguments fails:Time#utc returns the utc representation of time diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs index c10de39..0fcaae4 100644 --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs @@ -132,32 +132,31 @@ namespace IronRuby.Builtins { block.Yield(io, out result); io.Close(); return result; } } #region open [RubyMethod("open", RubyMethodAttributes.PublicSingleton)] public static RuleGenerator/*!*/ Open() { return new RuleGenerator((metaBuilder, args, name) => { var targetClass = (RubyClass)args.Target; targetClass.BuildObjectConstructionNoFlow(metaBuilder, args, name); // TODO: initialize yields the block? - // TODO: null block check - if (args.Signature.HasBlock) { + if (args.Signature.HasBlock && args.GetBlock() != null) { // ignore flow builder set up so far, we need one that creates a BlockParam for library calls: metaBuilder.ControlFlowBuilder = null; if (metaBuilder.BfcVariable == null) { metaBuilder.BfcVariable = metaBuilder.GetTemporary(typeof(BlockParam), "#bfc"); } metaBuilder.Result = Ast.Call(new Func(InvokeOpenBlock).Method, Ast.Constant(new UnaryOpStorage(args.RubyContext)), metaBuilder.BfcVariable, metaBuilder.Result ); RubyMethodGroupInfo.RuleControlFlowBuilder(metaBuilder, args); } else { diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs index 18e1d84..9075317 100644 --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs @@ -44,52 +44,129 @@ namespace IronRuby.Builtins { private static long microsecondsToTicks(long microseconds) { return microseconds * 10; } private static long secondsToTicks(long seconds) { return seconds * 10000000; } [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, DateTime other) { return new DateTime(other.Ticks, other.Kind); } [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, double seconds) { - return epoch.ToLocalTime().AddSeconds(seconds); + return epoch.AddSeconds(seconds).ToLocalTime(); } [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, long seconds, long microseconds) { - long ticks = epoch.ToLocalTime().Ticks + secondsToTicks(seconds) + microsecondsToTicks(microseconds); - return new DateTime(ticks); + long ticks = epoch.Ticks + secondsToTicks(seconds) + microsecondsToTicks(microseconds); + return new DateTime(ticks).ToLocalTime(); } #endregion [RubyMethod("now", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateTime(object/*!*/ self) { return DateTime.Now; } [RubyMethod("today", RubyMethodAttributes.PublicSingleton)] public static DateTime Today(object self) { return DateTime.Today; } + + #region helpers for local, mktime, utc, gmt + + private static int GetComponent(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object[]/*!*/ components, int index, int defValue, bool isMonth) { + + if (index >= components.Length || components[index] == null) { + return defValue; + } + + if (components[index] is int) { + return (int)components[index]; + } + + if (components[index] is double) { + return (int)(double)components[index]; + } + + if (!isMonth) { + IntegerValue componentValue = components[index] is MutableString + ? Protocols.ConvertToInteger(conversionStorage, components[index]) + : Protocols.CastToInteger(conversionStorage, components[index]); + + return componentValue.Fixnum; + } + else { + // month is treated in a different way + + DateTime parsed; + MutableString month = components[index] is MutableString + ? components[index] as MutableString + : Protocols.CastToString(stringCast, components[index]); + + if (DateTime.TryParseExact(month.ToString(), "%M", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsed)) { + return parsed.Month; + } + if (DateTime.TryParseExact(month.ToString(), "MMM", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsed)) { + return parsed.Month; + } + + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + } + + private static DateTime CreateTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, DateTimeKind kind, object[]/*!*/ components) { + + if (components.Length == 10) { + return new DateTime( + GetComponent(conversionStorage, stringCast, components, 5, 0, false), + GetComponent(conversionStorage, stringCast, components, 4, 0, true), + GetComponent(conversionStorage, stringCast, components, 3, 0, false), + GetComponent(conversionStorage, stringCast, components, 2, 1, false), + GetComponent(conversionStorage, stringCast, components, 1, 1, false), + GetComponent(conversionStorage, stringCast, components, 0, 0, false), + kind + ); + } + else { + if (components.Length > 7 || components.Length == 0) { + throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); + } + + return new DateTime( + GetComponent(conversionStorage, stringCast, components, 0, 0, false), + GetComponent(conversionStorage, stringCast, components, 1, 1, true), + GetComponent(conversionStorage, stringCast, components, 2, 1, false), + GetComponent(conversionStorage, stringCast, components, 3, 0, false), + GetComponent(conversionStorage, stringCast, components, 4, 0, false), + GetComponent(conversionStorage, stringCast, components, 5, 0, false), kind).AddTicks( + GetComponent(conversionStorage, stringCast, components, 6, 0, false) * 10 + ); + } + } + + #endregion + #region local, mktime [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year) { return new DateTime(year, 1, 1); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month) { return new DateTime(year, month, 1); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] @@ -107,56 +184,57 @@ namespace IronRuby.Builtins { [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute) { return new DateTime(year, month, day, hour, minute, 0); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) { return new DateTime(year, month, day, hour, minute, second); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int microsecond) { - return new DateTime(year, month, day, hour, minute, second).AddTicks(microsecond*10); + return new DateTime(year, month, day, hour, minute, second).AddTicks(microsecond * 10); } - private static int GetComponent(ConversionStorage/*!*/ conversionStorage, object[] components, int index, int defValue) { - if (index >= components.Length || components[index] == null) { - return defValue; - } - return Protocols.CastToFixnum(conversionStorage, components[index]); + [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateLocalTime(object/*!*/ self, int second, int minute, int hour, int day, int month, int year, + object wday, object yday, object isdst, object zone) { + + // wday, yday, isdst and zone are ignored + return new DateTime(year, month, day, hour, minute, second); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] - public static DateTime CreateLocalTime(ConversionStorage/*!*/ conversionStorage, object/*!*/ self, [NotNull]params object[]/*!*/ components) { + public static DateTime CreateLocalTime(object/*!*/ self, double second, double minute, double hour, double day, double month, double year, + object wday, object yday, object isdst, object zone) { - if (components.Length > 7 || components.Length == 0) { - throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); - } - - return new DateTime(Protocols.CastToFixnum(conversionStorage, components[0]), - GetComponent(conversionStorage, components, 1, 1), - GetComponent(conversionStorage, components, 2, 1), - GetComponent(conversionStorage, components, 3, 0), - GetComponent(conversionStorage, components, 4, 0), - GetComponent(conversionStorage, components, 5, 0), - GetComponent(conversionStorage, components, 6, 0) - ); + // wday, yday, isdst and zone are ignored + return new DateTime((int)year, (int)month, (int)day, (int)hour, (int)minute, (int)second); + } + + [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateLocalTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, [NotNull]params object[]/*!*/ components) { + + return CreateTime(conversionStorage, stringCast, self, DateTimeKind.Local, components); } #endregion #region utc, gm [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year) { return new DateTime(year, 1, 1, 0, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month) { @@ -183,45 +261,52 @@ namespace IronRuby.Builtins { [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) { return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int microsecond) { return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc).AddTicks(microsecond * 10); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] - public static DateTime CreateGmtTime(ConversionStorage/*!*/ conversionStorage, RubyContext/*!*/ context, object/*!*/ self, - [NotNull]params object[]/*!*/ components) { + public static DateTime CreateGmtTime(object/*!*/ self, int second, int minute, int hour, int day, int month, int year, + object wday, object yday, object isdst, object zone) { - if (components.Length > 7 || components.Length == 0) { - throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); - } - return new DateTime( - Protocols.CastToFixnum(conversionStorage, components[0]), - GetComponent(conversionStorage, components, 1, 1), - GetComponent(conversionStorage, components, 2, 1), - GetComponent(conversionStorage, components, 3, 0), - GetComponent(conversionStorage, components, 4, 0), - GetComponent(conversionStorage, components, 5, 0), DateTimeKind.Utc).AddTicks( - GetComponent(conversionStorage, components, 6, 0) * 10 - ); + // wday, yday, isdst and zone are ignored + return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); + } + + [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateGmtTime(object/*!*/ self, double second, double minute, double hour, double day, double month, double year, + object wday, object yday, object isdst, object zone) { + + // wday, yday, isdst and zone are ignored + return new DateTime((int)year, (int)month, (int)day, (int)hour, (int)minute, (int)second, DateTimeKind.Utc); + } + + [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateGmtTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, [NotNull]params object[]/*!*/ components) { + + return CreateTime(conversionStorage, stringCast, self, DateTimeKind.Utc, components); } #endregion #endregion "Singleton Methods" #region _dump, _load [RubyMethod("_dump")] public static MutableString/*!*/ Dump(RubyContext/*!*/ context, DateTime self, [Optional]int depth) { if (self.Year < 1900) { throw RubyExceptions.CreateTypeError("unable to marshal time"); } uint dword1 = 0x80000000; @@ -255,32 +340,32 @@ namespace IronRuby.Builtins { [RubyMethod("_load", RubyMethodAttributes.PublicSingleton)] public static DateTime Load(RubyContext/*!*/ context, object/*!*/ self, [NotNull]MutableString time) { byte[] data = time.ConvertToBytes(); if (data.Length != 8 || (data[3] & 0x80) != 0x80) { throw RubyExceptions.CreateTypeError("marshaled time format differ"); } bool isUtc = (data[3] & 0x40) != 0; uint dword1 = GetUint(data, 0); int year = 1900 + (int)((dword1 >> 14) & 0xffff); int month = 1 + (int)((dword1 >> 10) & 0x0f); int day = (int)((dword1 >> 5) & 0x01f); int hour = (int)(dword1 & 0x01f); uint dword2 = GetUint(data, 4); - int minute = (int)((dword2 >> 26) & 0x2f); - int second = (int)((dword2 >> 20) & 0x2f); + int minute = (int)((dword2 >> 26) & 0x3f); + int second = (int)((dword2 >> 20) & 0x3f); int usec = (int)(dword2 & 0xfffff); try { DateTime result = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); result = result.AddTicks(usec * 10L); if (!isUtc) { result = result.ToLocalTime(); } return result; } catch (ArgumentOutOfRangeException) { throw RubyExceptions.CreateTypeError("marshaled time format differ"); } } #endregion _dump, _load diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs index 25951a0..7052a2f 100644 --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs @@ -6052,72 +6052,80 @@ namespace IronRuby.Builtins { module.DefineLibraryMethod("at", 0x61, new System.Func(IronRuby.Builtins.TimeOps.Create), new System.Func(IronRuby.Builtins.TimeOps.Create), new System.Func(IronRuby.Builtins.TimeOps.Create) ); module.DefineLibraryMethod("gm", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), - new System.Func, IronRuby.Runtime.RubyContext, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) ); module.DefineLibraryMethod("local", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), - new System.Func, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) ); module.DefineLibraryMethod("mktime", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), - new System.Func, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) ); module.DefineLibraryMethod("now", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateTime) ); module.DefineLibraryMethod("today", 0x61, new System.Func(IronRuby.Builtins.TimeOps.Today) ); module.DefineLibraryMethod("utc", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), - new System.Func, IronRuby.Runtime.RubyContext, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) ); } private static void LoadTrueClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) { module.DefineLibraryMethod("&", 0x51, new System.Func(IronRuby.Builtins.TrueClass.And), new System.Func(IronRuby.Builtins.TrueClass.And) ); module.DefineLibraryMethod("^", 0x51, new System.Func(IronRuby.Builtins.TrueClass.Xor), new System.Func(IronRuby.Builtins.TrueClass.Xor) ); From ivan at flanders.co.nz Sun Aug 23 10:09:45 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 23 Aug 2009 16:09:45 +0200 Subject: [Ironruby-core] IronRubyMvc Filters and View Helpers In-Reply-To: References: Message-ID: You should be able to put the helper files you create in the helpers, that folder is added to the load path so it should work.ASP.NET MVC uses extension methods for its helper classes, when I was implementing that stuff for IronRubyMvc extension methods weren't supported yet. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Sun, Aug 23, 2009 at 5:43 AM, Shay Friedman wrote: > Hi Ivan, > > Is it possible to put the RubyHtmlHelper code in a file under the Helpers > directory? > > Another MVC question - I tried to use alias_action but couldn't get it to > work. I also tested it on the sample Mvc project (HomeController uses it - > alias action :my_method, :index_again) without success as well. > > Thanks for the help! > Shay. > > > On Wed, Aug 19, 2009 at 9:10 AM, Ivan Porto Carrero wrote: > >> regarding helpers. You need to open up a class and add your methods there. >> >> module System::Web::Mvc::IronRuby::Helpers >> >> class RubyHtmlHelper >> >> def menu_link(text, url, key, route_value_key=:controller) >> if key.to_s.underscore == >> view_context.route_data.values[route_value_key].underscore >> "
  • #{text}
  • " >> else >> "
  • #{text}
  • " >> end >> end >> >> def login_menu_link(login_text="Log in", logout_text="Log out", >> login_action=:log_on, logout_action=:log_off, controller=:account) >> text, act = view_context.controller.is_authenticated? ? >> [logout_text, logout_action] : [login_text, login_action] >> menu_link text, "/#{controller}/#{act}", controller >> end >> >> def format_chat_body(chat_body) >> encode(chat_body).gsub("\n", "
    ") >> end >> >> end >> >> end >> >> You can define filters in multiple ways, and the way you've chosen is only >> there for working with legacy filters (legacy as in written in C# :)). >> >> for example to implement the AuthorizationFilter you can do so by >> implementing the following class >> >> class RubyAuthorizationFilter < AuthorizationFilter >> >> def on_authorization(context) >> # put authorization logic here >> end >> >> end >> >> and then in the controller you do >> >> filter RubyAuthorizationFilter >> >> or you could do it in a more rubyesque way >> >> authorized_action :index do |context| >> # add authorization logic here >> end >> >> from then on that controller requires authorization to get to its >> actions. The latter uses the built in AuthorizationFilter too but tucks it >> away. >> >> If you're curious as to how this works: >> http://github.com/casualjim/ironrubymvc/blob/79efbd0f5baf52d3fbfe8f21a0349d6343dc994b/IronRubyMvc/Controllers/controller.rb#L173 >> >> Hope this helps >> >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero >> Blog: http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> >> >> >> On Wed, Aug 19, 2009 at 7:36 AM, Shay Friedman wrote: >> >>> Hi guys, >>> >>> I'm playing with IronRubyMvc, which is just great BTW, and I have two >>> issues I'm struggling with - filters and view helpers. >>> >>> About filters, I understand that this is done with the filter method >>> which receives the method name and filter class. How can I use for example, >>> the built-in Authorize filter and give it its initial values (like allowed >>> roles or users)? because I need to pass on the name of the class and not an >>> instance, I couldn't figure out how to pass the values as well. >>> >>> Regarding custom view helpers, is it possible to add those using rb >>> files? I've tried to add an rb file to the Helpers folder but it doesn't >>> seem to be read from anywhere (I had also added some syntax mistakes and >>> never got an exception about them). >>> >>> Once again, the IronRubyMvc framework is awesome! >>> >>> Thanks! >>> Shay. >>> >>> ---------------------------- >>> Shay Friedman >>> http://www.IronShay.com >>> Follow me: http://twitter.com/ironshay >>> >>> _______________________________________________ >>> 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 suppakilla at gmail.com Sun Aug 23 16:19:42 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Sun, 23 Aug 2009 22:19:42 +0200 Subject: [Ironruby-core] Core Review: Time and IO#open fixes In-Reply-To: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> References: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> Message-ID: <3bf20550908231319v8580165q9e0577ccdbf937de@mail.gmail.com> On Sun, Aug 23, 2009 at 15:15, Daniele Alessandri wrote: [...] > * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 > Miscellaneous fixes to Time: [...] Just noticed the wrong link :-/ Here is the correct one: http://github.com/nrk/ironruby/commit/fb55ffcfb7193eba537eb4aba98c3d55871006d6 -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN From Tomas.Matousek at microsoft.com Sun Aug 23 17:51:25 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 23 Aug 2009 21:51:25 +0000 Subject: [Ironruby-core] Core Review: Time and IO#open fixes In-Reply-To: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> References: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C02482A08@TK5EX14MBXC131.redmond.corp.microsoft.com> The IO#open block fix is almost correct yet it should rather be fixed in the RuleControlFlowBuilder. Since "args.GetBlock() != null" is a dynamic condition (the call-site doesn't statically encode the value of the block) a rule test also needs to be added for nullity of the block. Otherwise call-site caching would be broken. I'll take a look at it. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Sunday, August 23, 2009 6:16 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Core Review: Time and IO#open fixes Hi, here are some fixes for bugs I encountered while testing Ruote (http://github.com/jmettraux/ruote/) with IronRuby. As a side note, Ruote and its test suite depend on about 13 external libraries, and the fact that the number of failing tests is pretty much similar as if the suite was executed under MRI 1.8.6 on Windows is impressive to me. There is still a bunch of issues though, I will write a report later this week. * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 Miscellaneous fixes to Time: o The local time in Time.at must be computed on the result of the addition of seconds to the UTC value of epoch o Wrong bitmask in TimeOps.Load(RubyContext,object,MutableString) used to extract minutes and seconds from the binary data representing a ruby-marshalled instance of DateTime. o Time.local/Time.utc: . Added support for string and float arguments . The month argument is parsed as a number or a three-letter English name when it is string. . Added overloads to accepts 10 int/float arguments (C-style gmtime values, Time#to_a) * http://github.com/nrk/ironruby/commit/87d97c2cea0d917d72c5cd513b793bea3a502d3f Fixed a NullReferenceException in RubyIOOps.Open() raised when IO#open receives nil as the block parameter. irb(main):001:0> File.open("test.txt", &(nil)) => # irb(main):002:0> File.open("test.txt", &(Proc.new { |f| puts f.path })) test.txt => nil See the attached diff. -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN From Tomas.Matousek at microsoft.com Sun Aug 23 17:58:56 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 23 Aug 2009 21:58:56 +0000 Subject: [Ironruby-core] Core Review: Time and IO#open fixes In-Reply-To: <3bf20550908231319v8580165q9e0577ccdbf937de@mail.gmail.com> References: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> <3bf20550908231319v8580165q9e0577ccdbf937de@mail.gmail.com> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C02482A28@TK5EX14MBXC131.redmond.corp.microsoft.com> What are overloads like this: ...(int second, int minute, int hour, int day, int month, int year, object wday, object yday, object isdst, object zone) good for? It seems that the parameters typed to object are not used. Also when you cast double to int it might overflow. What should happen if a big integer is passed in? This is also suspicious: public static DateTime Create(object/*!*/ self, long seconds, long microseconds) MRI actually uses a default protocol for Fixnum for the parameters: class C def respond_to? name puts name true end def to_int 123 end end Time.at(C.new, 1.2) #=> to_int Time.at(C.new, 1000000000) #=> to_int Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri Sent: Sunday, August 23, 2009 1:20 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Core Review: Time and IO#open fixes On Sun, Aug 23, 2009 at 15:15, Daniele Alessandri wrote: [...] > * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 > Miscellaneous fixes to Time: [...] Just noticed the wrong link :-/ Here is the correct one: http://github.com/nrk/ironruby/commit/fb55ffcfb7193eba537eb4aba98c3d55871006d6 -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From suppakilla at gmail.com Mon Aug 24 03:01:59 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Mon, 24 Aug 2009 09:01:59 +0200 Subject: [Ironruby-core] Core Review: Time and IO#open fixes In-Reply-To: <4B342496A3EFEB48839E10BB4BF5964C02482A28@TK5EX14MBXC131.redmond.corp.microsoft.com> References: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> <3bf20550908231319v8580165q9e0577ccdbf937de@mail.gmail.com> <4B342496A3EFEB48839E10BB4BF5964C02482A28@TK5EX14MBXC131.redmond.corp.microsoft.com> Message-ID: <3bf20550908240001g2a511c82t997dfb8b0bf8c8bd@mail.gmail.com> The int,int,int,int,int,int,object,object,object,object overloads are there just to skip the (relative) complexity of CreateTime when you pass 10 arguments to local/utc and all the relevant arguments are integers, e.g. when you do Time.local(*Time.now.to_a). The last four arguments are typed as object just because in the MRI you can pass whatever you want, they are totally ignored anyways. As for the double variant... well yeah, it might be superfluous and I guess it would be rarely used, so I will remove it. By the way the cast double -> int cast is admittedly wrong, that scenario under the MRI throws a RangeError: irb(main):001:0> Time.local(0,0,0,24,8,1_000_000_000_000_000_000.0,nil,nil,nil,nil) RangeError: float 1e+018 out of range of integer from (irb):1:in `local' from (irb):1 from :0 I was going to use RubyOps.ConvertDoubleToFixnum(double) for that one, but I noticed that when it catches an overflow the message for RangeError is a little bit different (Fixnum instead of integer) and I was wondering if this difference was intentional or what. But then, I blatantly forgot to check it out and ask on the list... :-) As for Create(object,long,long) I can fix it while I am at it, I just committed the same change introduced in Create(object,double) but had not investigated other issues. Thanks, Daniele On Sun, Aug 23, 2009 at 23:58, Tomas Matousek wrote: > What are overloads like this: > ...(int second, int minute, int hour, int day, int month, int year, ?object wday, object yday, object isdst, object zone) > good for? > > It seems that the parameters typed to object are not used. Also when you cast double to int it might overflow. What should happen if a big integer is passed in? > > This is also suspicious: > > public static DateTime Create(object/*!*/ self, long seconds, long microseconds) > > MRI actually uses a default protocol for Fixnum for the parameters: > > class C > ?def respond_to? name > ? ?puts name > ? ?true > ?end > > ?def to_int > ? 123 > ?end > end > > Time.at(C.new, 1.2) ? ? ? ? ? ? ? ? ?#=> to_int > Time.at(C.new, 1000000000) #=> to_int > > Tomas > > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri > Sent: Sunday, August 23, 2009 1:20 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Core Review: Time and IO#open fixes > > On Sun, Aug 23, 2009 at 15:15, Daniele Alessandri wrote: > > [...] >> * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 >> Miscellaneous fixes to Time: > [...] > > Just noticed the wrong link :-/ Here is the correct one: > http://github.com/nrk/ironruby/commit/fb55ffcfb7193eba537eb4aba98c3d55871006d6 > > -- > Daniele Alessandri > http://www.clorophilla.net/blog/ > http://twitter.com/JoL1hAHN > _______________________________________________ > 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/ http://twitter.com/JoL1hAHN From ivan at flanders.co.nz Mon Aug 24 07:47:12 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 24 Aug 2009 13:47:12 +0200 Subject: [Ironruby-core] [0.9] Erb and unicode. EncoderFallbackException. In-Reply-To: <7b9c628e0908240358o78f113a1ha214f6d38e9deb56@mail.gmail.com> References: <7b9c628e0908240358o78f113a1ha214f6d38e9deb56@mail.gmail.com> Message-ID: As a long shot you can try to use $KCODE="UTF8" but I cannot guarantee it will work --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) 2009/8/24 mlkjih mlkjih > What can I do? > >>> ERB.new("???") > => mscorlib:0:in `GetBytes': Value does not fall within the expected range. > (System::Text::EncoderFallbackException) > from :0 > > > _______________________________________________ > 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 Aug 24 13:05:28 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 24 Aug 2009 17:05:28 +0000 Subject: [Ironruby-core] Code Review: NilBlocks In-Reply-To: <4B342496A3EFEB48839E10BB4BF5964C02482FE9@TK5EX14MBXC131.redmond.corp.microsoft.com> References: <4B342496A3EFEB48839E10BB4BF5964C02482FE9@TK5EX14MBXC131.redmond.corp.microsoft.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BDE741@tk5ex14mbxc106.redmond.corp.microsoft.com> Looks good > -----Original Message----- > From: Tomas Matousek > Sent: Monday, August 24, 2009 9:31 AM > To: IronRuby External Code Reviewers > Cc: ironruby-core at rubyforge.org > Subject: Code Review: NilBlocks > > tfpt review "/shelveset:NilBlocks;REDMOND\tomat" > Comment : > Fixes nil blocks handling. > > Tomas From lists at ruby-forum.com Mon Aug 24 14:17:31 2009 From: lists at ruby-forum.com (Marco Mastrodonato) Date: Mon, 24 Aug 2009 20:17:31 +0200 Subject: [Ironruby-core] Why IronRuby is so slower tha IronPython? Message-ID: <1b11551b409a0168c718485d6eea3269@ruby-forum.com> http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/?lang=en Does anyone have any idea? -- Posted via http://www.ruby-forum.com/. From Tomas.Matousek at microsoft.com Mon Aug 24 14:29:48 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 24 Aug 2009 18:29:48 +0000 Subject: [Ironruby-core] Why IronRuby is so slower tha IronPython? In-Reply-To: <1b11551b409a0168c718485d6eea3269@ruby-forum.com> References: <1b11551b409a0168c718485d6eea3269@ruby-forum.com> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C024830E3@TK5EX14MBXC131.redmond.corp.microsoft.com> Because Ruby is in general slower than Python? Even JRuby is almost 3x slower than IronPython. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Marco Mastrodonato Sent: Monday, August 24, 2009 11:18 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Why IronRuby is so slower tha IronPython? http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/?lang=en Does anyone have any idea? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From suppakilla at gmail.com Mon Aug 24 16:32:13 2009 From: suppakilla at gmail.com (Daniele Alessandri) Date: Mon, 24 Aug 2009 22:32:13 +0200 Subject: [Ironruby-core] Core Review: Time and IO#open fixes In-Reply-To: <3bf20550908240001g2a511c82t997dfb8b0bf8c8bd@mail.gmail.com> References: <3bf20550908230615g5b1fea3u7b71ecc8d0c56cdc@mail.gmail.com> <3bf20550908231319v8580165q9e0577ccdbf937de@mail.gmail.com> <4B342496A3EFEB48839E10BB4BF5964C02482A28@TK5EX14MBXC131.redmond.corp.microsoft.com> <3bf20550908240001g2a511c82t997dfb8b0bf8c8bd@mail.gmail.com> Message-ID: <3bf20550908241332i5d501d8dl12874d5b151d4e07@mail.gmail.com> Hi, with this commit I think that things are definitely better than before: http://github.com/nrk/ironruby/commit/e880c0cffa337bffa31ed317ca673f8be7dd5795 It also fixes Time to behave just like MRI under circumstances similar to the following ones: irb(main):001:0> Time.local(2009,12,31,23,59,60) => Fri Jan 01 00:00:00 +0100 2010 irb(main):002:0> Time.local(2009,9,31,23,59,60) => Fri Oct 02 00:00:00 +0200 2009 irb(main):003:0> Time.local(2009,0,0) ArgumentError: argument out of range from (irb):3:in `local' from (irb):3 irb(main):004:0> Time.local(20009) ArgumentError: time out of range from (irb):4:in `local' from (irb):4 The attached diff includes this commit and the previous one. Thanks, Daniele On Mon, Aug 24, 2009 at 09:01, Daniele Alessandri wrote: > The int,int,int,int,int,int,object,object,object,object overloads are > there just to skip the (relative) complexity of CreateTime when you > pass 10 arguments to local/utc and all the relevant arguments are > integers, e.g. when you do Time.local(*Time.now.to_a). The last four > arguments are typed as object just because in the MRI you can pass > whatever you want, they are totally ignored anyways. As for the double > variant... well yeah, it might be superfluous and I guess it would be > rarely used, so I will remove it. > > By the way the cast double -> int cast is admittedly wrong, that > scenario under the MRI throws a RangeError: > > irb(main):001:0> > Time.local(0,0,0,24,8,1_000_000_000_000_000_000.0,nil,nil,nil,nil) > RangeError: float 1e+018 out of range of integer > ? ? ? ?from (irb):1:in `local' > ? ? ? ?from (irb):1 > ? ? ? ?from :0 > > I was going to use RubyOps.ConvertDoubleToFixnum(double) for that one, > but I noticed that when it catches an overflow the message for > RangeError is a little bit different (Fixnum instead of integer) and I > was wondering if this difference was intentional or what. But then, I > blatantly forgot to check it out and ask on the list... :-) > > As for Create(object,long,long) I can fix it while I am at it, I just > committed the same change introduced in Create(object,double) but had > not investigated other issues. > > Thanks, > Daniele > > > On Sun, Aug 23, 2009 at 23:58, Tomas > Matousek wrote: >> What are overloads like this: >> ...(int second, int minute, int hour, int day, int month, int year, ?object wday, object yday, object isdst, object zone) >> good for? >> >> It seems that the parameters typed to object are not used. Also when you cast double to int it might overflow. What should happen if a big integer is passed in? >> >> This is also suspicious: >> >> public static DateTime Create(object/*!*/ self, long seconds, long microseconds) >> >> MRI actually uses a default protocol for Fixnum for the parameters: >> >> class C >> ?def respond_to? name >> ? ?puts name >> ? ?true >> ?end >> >> ?def to_int >> ? 123 >> ?end >> end >> >> Time.at(C.new, 1.2) ? ? ? ? ? ? ? ? ?#=> to_int >> Time.at(C.new, 1000000000) #=> to_int >> >> Tomas >> >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri >> Sent: Sunday, August 23, 2009 1:20 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] Core Review: Time and IO#open fixes >> >> On Sun, Aug 23, 2009 at 15:15, Daniele Alessandri wrote: >> >> [...] >>> * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4 >>> Miscellaneous fixes to Time: >> [...] >> >> Just noticed the wrong link :-/ Here is the correct one: >> http://github.com/nrk/ironruby/commit/fb55ffcfb7193eba537eb4aba98c3d55871006d6 >> >> -- >> Daniele Alessandri >> http://www.clorophilla.net/blog/ >> http://twitter.com/JoL1hAHN >> _______________________________________________ >> 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/ > http://twitter.com/JoL1hAHN > -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN -------------- next part -------------- diff --git a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt index 3ad8a21..22df910 100644 --- a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt +++ b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/local_tags.txt @@ -1,8 +1,4 @@ fails:Time.local creates a time based on given values, interpreted in the local time zone fails:Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone -fails:Time.local handles string-like second argument -fails:Time.local handles string arguments -fails:Time.local handles float arguments fails:Time.local should accept various year ranges fails:Time.local throws ArgumentError for out of range values -fails:Time.local throws ArgumentError for invalid number of arguments diff --git a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt index e8e7bdd..c6fa1a0 100644 --- a/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt +++ b/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/time/utc_tags.txt @@ -1,9 +1,5 @@ fails:Time.utc creates a time based on given values, interpreted as UTC (GMT) fails:Time.utc creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT) -fails:Time.utc handles string-like second argument -fails:Time.utc handles string arguments -fails:Time.utc handles float arguments fails:Time.utc should accept various year ranges fails:Time.utc throws ArgumentError for out of range values -fails:Time.utc throws ArgumentError for invalid number of arguments fails:Time#utc returns the utc representation of time diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs index 18e1d84..529cf04 100644 --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs @@ -27,201 +27,299 @@ namespace IronRuby.Builtins { [RubyClass("Time", Extends = typeof(DateTime), Inherits = typeof(Object)), Includes(typeof(Comparable))] public static class TimeOps { readonly static DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); //January 1, 1970 00:00 UTC [RubyConstructor] public static DateTime Create(RubyClass/*!*/ self) { return DateTime.Now; } // TODO: I removed all of the constructor overloads since Ruby doesn't define any non-default constructors for Time. // In the future, however, we need to fix this problem per RubyForge bug #20035 #region "Singleton Methods" - #region at + #region at private static long microsecondsToTicks(long microseconds) { return microseconds * 10; } private static long secondsToTicks(long seconds) { return seconds * 10000000; } [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, DateTime other) { return new DateTime(other.Ticks, other.Kind); } [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, double seconds) { - return epoch.ToLocalTime().AddSeconds(seconds); + return epoch.AddSeconds(seconds).ToLocalTime(); } - + [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] public static DateTime Create(object/*!*/ self, long seconds, long microseconds) { - long ticks = epoch.ToLocalTime().Ticks + secondsToTicks(seconds) + microsecondsToTicks(microseconds); - return new DateTime(ticks); + long ticks = epoch.Ticks + secondsToTicks(seconds) + microsecondsToTicks(microseconds); + return new DateTime(ticks).ToLocalTime(); } #endregion [RubyMethod("now", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateTime(object/*!*/ self) { return DateTime.Now; } [RubyMethod("today", RubyMethodAttributes.PublicSingleton)] public static DateTime Today(object self) { return DateTime.Today; } + + #region helpers for local, mktime, utc, gmt + + private static int GetComponent(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object[]/*!*/ components, int index, int defValue, bool isMonth) { + + if (index >= components.Length || components[index] == null) { + return defValue; + } + + if (components[index] is int) { + return (int)components[index]; + } + + if (components[index] is double) { + return RubyOps.ConvertDoubleToFixnum((double)components[index]); + } + + if (!isMonth) { + IntegerValue componentValue = components[index] is MutableString + ? Protocols.ConvertToInteger(conversionStorage, components[index]) + : Protocols.CastToInteger(conversionStorage, components[index]); + + if (!componentValue.IsFixnum) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + return componentValue.Fixnum; + } else { + // month is treated in a different way + + DateTime parsed; + MutableString month = components[index] is MutableString + ? components[index] as MutableString + : Protocols.CastToString(stringCast, components[index]); + + if (DateTime.TryParseExact(month.ToString(), "%M", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsed)) { + return parsed.Month; + } + if (DateTime.TryParseExact(month.ToString(), "MMM", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsed)) { + return parsed.Month; + } + + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + } + + private static DateTime CreateTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int microsecond, DateTimeKind kind) { + if (month < 1 || month > 12) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + if (day < 1 || day > 31) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + if (hour < 0 || hour > 23) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + if (minute < 0 || minute > 59) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + if (second < 0 || second > 60) { + throw RubyExceptions.CreateArgumentError("argument out of range"); + } + + try { + return new DateTime(year, month, 1, hour, minute, 0, kind).AddDays(day - 1).AddSeconds(second).AddTicks(microsecond * 10); + } catch (ArgumentOutOfRangeException) { + throw RubyExceptions.CreateArgumentError("time out of range"); + } + } + + private static DateTime CreateTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, DateTimeKind kind, object[]/*!*/ components) { + + if (components.Length == 10) { + return CreateTime(self, + GetComponent(conversionStorage, stringCast, components, 5, 0, false), + GetComponent(conversionStorage, stringCast, components, 4, 0, true), + GetComponent(conversionStorage, stringCast, components, 3, 0, false), + GetComponent(conversionStorage, stringCast, components, 2, 1, false), + GetComponent(conversionStorage, stringCast, components, 1, 1, false), + GetComponent(conversionStorage, stringCast, components, 0, 0, false), + 0, kind + ); + } else { + if (components.Length > 7 || components.Length == 0) { + throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); + } + + return CreateTime(self, + GetComponent(conversionStorage, stringCast, components, 0, 0, false), + GetComponent(conversionStorage, stringCast, components, 1, 1, true), + GetComponent(conversionStorage, stringCast, components, 2, 1, false), + GetComponent(conversionStorage, stringCast, components, 3, 0, false), + GetComponent(conversionStorage, stringCast, components, 4, 0, false), + GetComponent(conversionStorage, stringCast, components, 5, 0, false), + GetComponent(conversionStorage, stringCast, components, 6, 0, false), + kind + ); + } + } + + #endregion + #region local, mktime [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year) { - return new DateTime(year, 1, 1); + return CreateTime(self, year, 1, 1, 0, 0, 0, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month) { - return new DateTime(year, month, 1); + return CreateTime(self, year, month, 1, 0, 0, 0, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day) { - return new DateTime(year, month, day); + return CreateTime(self, year, month, day, 0, 0, 0, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour) { - return new DateTime(year, month, day, hour, 0, 0); + return CreateTime(self, year, month, day, hour, 0, 0, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute) { - return new DateTime(year, month, day, hour, minute, 0); + return CreateTime(self, year, month, day, hour, minute, 0, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) { - return new DateTime(year, month, day, hour, minute, second); + return CreateTime(self, year, month, day, hour, minute, second, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int microsecond) { - return new DateTime(year, month, day, hour, minute, second).AddTicks(microsecond*10); + return CreateTime(self, year, month, day, hour, minute, second, microsecond, DateTimeKind.Local); } - private static int GetComponent(ConversionStorage/*!*/ conversionStorage, object[] components, int index, int defValue) { - if (index >= components.Length || components[index] == null) { - return defValue; - } - return Protocols.CastToFixnum(conversionStorage, components[index]); + [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateLocalTime(object/*!*/ self, int second, int minute, int hour, int day, int month, int year, + object wday, object yday, object isdst, object zone) { + + // wday, yday, isdst and zone are ignored + return CreateTime(self, year, month, day, hour, minute, second, 0, DateTimeKind.Local); } [RubyMethod("local", RubyMethodAttributes.PublicSingleton)] [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)] - public static DateTime CreateLocalTime(ConversionStorage/*!*/ conversionStorage, object/*!*/ self, [NotNull]params object[]/*!*/ components) { + public static DateTime CreateLocalTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, [NotNull]params object[]/*!*/ components) { - if (components.Length > 7 || components.Length == 0) { - throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); - } - - return new DateTime(Protocols.CastToFixnum(conversionStorage, components[0]), - GetComponent(conversionStorage, components, 1, 1), - GetComponent(conversionStorage, components, 2, 1), - GetComponent(conversionStorage, components, 3, 0), - GetComponent(conversionStorage, components, 4, 0), - GetComponent(conversionStorage, components, 5, 0), - GetComponent(conversionStorage, components, 6, 0) - ); + return CreateTime(conversionStorage, stringCast, self, DateTimeKind.Local, components); } #endregion #region utc, gm [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year) { - return new DateTime(year, 1, 1, 0, 0, 0, DateTimeKind.Utc); + return CreateTime(self, year, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month) { - return new DateTime(year, month, 1, 0, 0, 0, DateTimeKind.Utc); + return CreateTime(self, year, month, 1, 0, 0, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day) { - return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc); + return CreateTime(self, year, month, day, 0, 0, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour) { - return new DateTime(year, month, day, hour, 0, 0, DateTimeKind.Utc); + return CreateTime(self, year, month, day, hour, 0, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute) { - return new DateTime(year, month, day, hour, minute, 0, DateTimeKind.Utc); + return CreateTime(self, year, month, day, hour, minute, 0, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) { - return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); + return CreateTime(self, year, month, day, hour, minute, second, 0, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int microsecond) { - return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc).AddTicks(microsecond * 10); + return CreateTime(self, year, month, day, hour, minute, second, microsecond, DateTimeKind.Utc); } [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] - public static DateTime CreateGmtTime(ConversionStorage/*!*/ conversionStorage, RubyContext/*!*/ context, object/*!*/ self, - [NotNull]params object[]/*!*/ components) { + public static DateTime CreateGmtTime(object/*!*/ self, int second, int minute, int hour, int day, int month, int year, + object wday, object yday, object isdst, object zone) { - if (components.Length > 7 || components.Length == 0) { - throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length)); - } - return new DateTime( - Protocols.CastToFixnum(conversionStorage, components[0]), - GetComponent(conversionStorage, components, 1, 1), - GetComponent(conversionStorage, components, 2, 1), - GetComponent(conversionStorage, components, 3, 0), - GetComponent(conversionStorage, components, 4, 0), - GetComponent(conversionStorage, components, 5, 0), DateTimeKind.Utc).AddTicks( - GetComponent(conversionStorage, components, 6, 0) * 10 - ); + // wday, yday, isdst and zone are ignored + return CreateTime(self, year, month, day, hour, minute, second, 0, DateTimeKind.Utc); + } + + [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)] + [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)] + public static DateTime CreateGmtTime(ConversionStorage/*!*/ conversionStorage, ConversionStorage/*!*/ stringCast, + object/*!*/ self, [NotNull]params object[]/*!*/ components) { + + return CreateTime(conversionStorage, stringCast, self, DateTimeKind.Utc, components); } #endregion #endregion "Singleton Methods" #region _dump, _load [RubyMethod("_dump")] public static MutableString/*!*/ Dump(RubyContext/*!*/ context, DateTime self, [Optional]int depth) { if (self.Year < 1900) { throw RubyExceptions.CreateTypeError("unable to marshal time"); } uint dword1 = 0x80000000; @@ -255,32 +353,32 @@ namespace IronRuby.Builtins { [RubyMethod("_load", RubyMethodAttributes.PublicSingleton)] public static DateTime Load(RubyContext/*!*/ context, object/*!*/ self, [NotNull]MutableString time) { byte[] data = time.ConvertToBytes(); if (data.Length != 8 || (data[3] & 0x80) != 0x80) { throw RubyExceptions.CreateTypeError("marshaled time format differ"); } bool isUtc = (data[3] & 0x40) != 0; uint dword1 = GetUint(data, 0); int year = 1900 + (int)((dword1 >> 14) & 0xffff); int month = 1 + (int)((dword1 >> 10) & 0x0f); int day = (int)((dword1 >> 5) & 0x01f); int hour = (int)(dword1 & 0x01f); uint dword2 = GetUint(data, 4); - int minute = (int)((dword2 >> 26) & 0x2f); - int second = (int)((dword2 >> 20) & 0x2f); + int minute = (int)((dword2 >> 26) & 0x3f); + int second = (int)((dword2 >> 20) & 0x3f); int usec = (int)(dword2 & 0xfffff); try { DateTime result = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); result = result.AddTicks(usec * 10L); if (!isUtc) { result = result.ToLocalTime(); } return result; } catch (ArgumentOutOfRangeException) { throw RubyExceptions.CreateTypeError("marshaled time format differ"); } } #endregion _dump, _load @@ -554,31 +652,31 @@ namespace IronRuby.Builtins { [RubyMethod("to_a")] public static RubyArray ToArray(DateTime/*!*/ self) { RubyArray result = new RubyArray(); result.Add(self.Second); result.Add(self.Minute); result.Add(self.Hour); result.Add(self.Day); result.Add(self.Month); result.Add(self.Year); result.Add((int)self.DayOfWeek); result.Add(self.DayOfYear); result.Add(self.IsDaylightSavingTime()); result.Add(GetZone(self)); return result; - } + } [RubyMethod("wday")] public static int DayOfWeek(DateTime/*!*/ self) { return (int)self.DayOfWeek; } [RubyMethod("hash")] public static int GetHash(DateTime/*!*/ self) { return self.GetHashCode(); } [RubyMethod("zone")] public static MutableString/*!*/ GetZone(DateTime/*!*/ self) { // TODO: return MutableString.CreateAscii("UTC"); diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs index 25951a0..353626e 100644 --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs @@ -6052,72 +6052,76 @@ namespace IronRuby.Builtins { module.DefineLibraryMethod("at", 0x61, new System.Func(IronRuby.Builtins.TimeOps.Create), new System.Func(IronRuby.Builtins.TimeOps.Create), new System.Func(IronRuby.Builtins.TimeOps.Create) ); module.DefineLibraryMethod("gm", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), - new System.Func, IronRuby.Runtime.RubyContext, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) ); module.DefineLibraryMethod("local", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), - new System.Func, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) ); module.DefineLibraryMethod("mktime", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), - new System.Func, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateLocalTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateLocalTime) ); module.DefineLibraryMethod("now", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateTime) ); module.DefineLibraryMethod("today", 0x61, new System.Func(IronRuby.Builtins.TimeOps.Today) ); module.DefineLibraryMethod("utc", 0x61, new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), - new System.Func, IronRuby.Runtime.RubyContext, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) + new System.Func(IronRuby.Builtins.TimeOps.CreateGmtTime), + new System.Func, IronRuby.Runtime.ConversionStorage, System.Object, System.Object[], System.DateTime>(IronRuby.Builtins.TimeOps.CreateGmtTime) ); } private static void LoadTrueClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) { module.DefineLibraryMethod("&", 0x51, new System.Func(IronRuby.Builtins.TrueClass.And), new System.Func(IronRuby.Builtins.TrueClass.And) ); module.DefineLibraryMethod("^", 0x51, new System.Func(IronRuby.Builtins.TrueClass.Xor), new System.Func(IronRuby.Builtins.TrueClass.Xor) ); From ivan at flanders.co.nz Wed Aug 26 17:24:47 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 26 Aug 2009 23:24:47 +0200 Subject: [Ironruby-core] resolv.rb won't work Message-ID: Hi The resolv.rb file from the standard library won't work because it expects the win32/resolv library to work, which isn't included. I suppose this thing will return in many places as the way MRI often detects whether it's running on windows is by asking the RUBY_PLATFORM variable and then matching it against /mswin32|mingw|bccwin/ but on mono that also returns i386-mswin32 using rbconfig the host_os info is wrong and using RUBY_PLATFORM it will return something that includes mswin32 even on linux/mac osx. to fix it you have to change the file in lib/ruby/1.8/resolv.rb starting on line 286 replace the if .. then .. else with if ENV['OS'] =~ /win/i DefaultFileName = System::Environment::system_directory + "\\drivers\\etc\\hosts" else DefaultFileName = '/etc/hosts' end Before I push my change I'd like to know if ENV['OS'] also returns a string containing win on windows 9x/Me. And I don't even remember if the hosts path is the same as it is on NT incarnations --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Aug 27 11:47:37 2009 From: lists at ruby-forum.com (Qwerty Qwerty) Date: Thu, 27 Aug 2009 17:47:37 +0200 Subject: [Ironruby-core] Watir under IronRuby Error In-Reply-To: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> References: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> Message-ID: <59fc7689ef9a67e10cd01c3f996b2dcf@ruby-forum.com> Ok, so after hacking watir.rb, I managed to get IE to open and navigate to the URL, but then using the following basic script: require 'watir' # use watir gem test_site = 'http://www.google.com' # set a variable b = Watir::IE.new # open the IE browser b.goto(test_site) # load url, go to site b.text_field(:name, "q").set("pickaxe") # load text "pickaxe" into search field named "q" b.button(:name, "btnG").click # "btnG" is the name of the Search button, click it if b.text.include?("Programming Ruby") puts "Test Passed. Found the test string: 'Programming Ruby'." else puts "Test Failed! Could not find: 'Programming Ruby'" end I now get the following error: ./watir/element.rb:54:in `assert_exists': Unable to locate element, using :name, "q" (Watir::Exception::UnknownObjectException) from ./watir/element.rb:288:in `enabled?' from ./watir/element.rb:60:in `assert_enabled' from ./watir/input_elements.rb:328:in `set' from Simplewatirscript.rb:6 -- Posted via http://www.ruby-forum.com/. From Shri.Borde at microsoft.com Thu Aug 27 14:11:33 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 27 Aug 2009 11:11:33 -0700 Subject: [Ironruby-core] Watir under IronRuby Error In-Reply-To: <59fc7689ef9a67e10cd01c3f996b2dcf@ruby-forum.com> References: <3eb105b1fd81348e268bf08e01d53568@ruby-forum.com> <59fc7689ef9a67e10cd01c3f996b2dcf@ruby-forum.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F4A83B45C33@NA-EXMSG-C118.redmond.corp.microsoft.com> The backtrace indicates that the exception was thrown from "set" which would imply that the call to text_field succeeded. Could you break up the line "b.text_field(:name, "q").set("pickaxe")" into two statements to see narrow down where the problem might be happening? Also, could you run with "ir.exe -D", attach with VS, and get the full call stack for all the exceptions thrown by the problematic statement? There might be other exceptions thrown before Watir::Exception::UnknownObjectException, and the those other exceptions might be more useful to track down the problem. One suspect could be that COM Interop is misbehaving somehow. Also, what was the patch to watir.rb (and what exact version of watir are you using) so we could try to repro the problem? -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Qwerty Qwerty Sent: Thursday, August 27, 2009 8:48 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Watir under IronRuby Error Ok, so after hacking watir.rb, I managed to get IE to open and navigate to the URL, but then using the following basic script: require 'watir' # use watir gem test_site = 'http://www.google.com' # set a variable b = Watir::IE.new # open the IE browser b.goto(test_site) # load url, go to site b.text_field(:name, "q").set("pickaxe") # load text "pickaxe" into search field named "q" b.button(:name, "btnG").click # "btnG" is the name of the Search button, click it if b.text.include?("Programming Ruby") puts "Test Passed. Found the test string: 'Programming Ruby'." else puts "Test Failed! Could not find: 'Programming Ruby'" end I now get the following error: ./watir/element.rb:54:in `assert_exists': Unable to locate element, using :name, "q" (Watir::Exception::UnknownObjectException) from ./watir/element.rb:288:in `enabled?' from ./watir/element.rb:60:in `assert_enabled' from ./watir/input_elements.rb:328:in `set' from Simplewatirscript.rb:6 -- 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 Thu Aug 27 14:28:53 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 27 Aug 2009 20:28:53 +0200 Subject: [Ironruby-core] Threads in IronRuby Message-ID: Hi I just took a look at using xmpp4r with IronRuby. Below you find the contents of my console session (I get the same result on windows). You can probably do the same without having a jabber server running locally :) +ivan at ivan-mbp:~/projects/xmpp_spike (master)? *ir* IronRuby 0.9.0.0 on Mono 2.4.2.3 Copyright (c) Microsoft Corporation. All rights reserved. >>> *csproj = ENV['CS_PROJECT_ROOT']* => "/Users/ivan/projects/cloudslide" >>> *$:.unshift "#{csproj}/vendor/ruby/xmpp4r/lib"* => ["/Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib", "/Users/ivan/projects/cloudslide/infrastructure/ironruby/lib", "/Users/ivan/projects/cloudslide/infrastructure/ironruby/lib/ironruby", "/Users/ivan/projects/cloudslide/infrastructure/ironruby/lib/ruby/site_ruby/1.8/", "/Users/ivan/projects/cloudslide/infrastructure/ironruby/lib/ruby/site_ruby/", "/Users/ivan/projects/cloudslide/infrastructure/ironruby/lib/ruby/1.8/", "."] >>> *include Jabber* :0:in `const_missing': uninitialized constant Object::Jabber (NameError) from :0 >>> *require 'xmpp4r/client'* => true # <= this seems to work :) >>> *include Jabber* => Object >>> *client = Client.new(JID::new('ruby-test at cloudslide.local'))* => #, @stanzacbs=#, @messagecbs=#, @iqcbs=#, @presencecbs=#, @send_lock=IronRuby.StandardLibrary.Threading.RubyMutex, @last_send=Thu Aug 27 18:43:18 +02:00 2009, @exception_block=nil, @tbcbmutex=IronRuby.StandardLibrary.Threading.RubyMutex, @threadblocks=[], @wakeup_thread=nil, @streamid=nil, @streamns="jabber:client", @features_sem=#, @parser_thread=nil, @processing=0, @host=nil, @port=nil, @allow_tls="constant", @tls=false, @ssl_capath=nil, @ssl_verifycb=nil, @features_timeout=10, @keepalive_interval=60, @use_ssl=false, @jid=#> >>> *client.connect 'localhost'* => Hit Ctrl-C here after a few minutes mscorlib:0:in `Wait': Thread was being aborted (System::Threading::ThreadAbortException) from :0:in `wait' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/semaphore.rb:23:in `wait' from :0:in `synchronize' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/stream.rb:331:in `wait' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/stream.rb:397:in `send' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/client.rb:88:in `start' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/connection.rb:78:in `connect' from /Users/ivan/projects/cloudslide/vendor/ruby/xmpp4r/lib/xmpp4r/client.rb:70:in `connect' from :0 from mscorlib:0:in `CallSite.Target' from Microsoft.Scripting.Core:0:in `invoke_object__this___Func`5_object_Proc_object_object' On the server I see the connection coming in. =INFO REPORT==== 2009-08-27 18:52:00 === I(<0.262.0>:ejabberd_listener:116) : (#Port<0.3531>) Accepted connection {{127,0,0,1},61314} -> {{127,0,0,1},5222} Can it be that the Thread implementation is in need of some attention? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Aug 31 01:47:37 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 31 Aug 2009 05:47:37 +0000 Subject: [Ironruby-core] Trying to run _why's Camping framework on IronRack / IIS In-Reply-To: <4B342496A3EFEB48839E10BB4BF5964C0249D081@TK5EX14MBXC129.redmond.corp.microsoft.com> References: <4A975441.40401@monnet-usa.com> <4A9ADB6A.4050805@monnet-usa.com> <4B342496A3EFEB48839E10BB4BF5964C0249D081@TK5EX14MBXC129.redmond.corp.microsoft.com> Message-ID: <178413D7-2FDF-4A1D-BF53-5A2B12FDE4B3@microsoft.com> Ah, gotcha. Thanks for the explanation Tomas. I'll make that change. ~Jimmy Sent from my phone On Aug 30, 2009, at 10:24 PM, "Tomas Matousek" > wrote: The constant is not set when hosting IR and using Engine.Execute() or ScriptScope.Execute(). It is only set by ScriptSource.ExecuteProgram(). The reason is that each call to the former methods creates a new top-level binding and therefore we don?t know which one should be the one that is stored in TOPLEVEL_BINDING. The latter is meant to be used to execute the main top-level code (i.e. the ?program?) and it sets the TOPLEVEL_BINDING up. It also handles SystemExit exception so that ?exit? works according to Ruby?s semantics. IronRack should probably use ExecuteProgram to execute the main request processing script. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Philippe Monnet Sent: Sunday, August 30, 2009 1:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Trying to run _why's Camping framework on IronRack / IIS Today I dug deeper in the issue by breaking down the goes method of Camping in small chunks and evaluating them both in IR and MRI. I found that one thing expected by Camping was the global constant TOPLEVEL_BINDING. Apparently the constant was not defined in IR. A Google search found it in: ironruby/Merlin/Main/Languages/Ruby/Libs/hacks.rb And when I explicitly required it, the constant appeared and Camping worked immediately on IronRack. Could someone explain what the constant is for and why it is located in hacks.rb? Is it ok to I be using hacks.rb? Philippe PS - I am pretty excited to run Camping now! I just had to make a couple changes on top of IronRack to make it work. Philippe Monnet wrote: I have been leveraging IronRack to try to get a sample Camping application up and running. I seem to be able to require the camping library fine but then as try to hit the famous "Camping.goes :Demo" line, IronRuby return an error stating that the constant # is not initialized. So I tried to do the same test using the IR command line executable, but ran into the same issue (note that the same test works fine in IRB). What is strange is that the camping framework is loaded and if I query the constants in the Camping module I get back what I would expect. Is this a module loading issue? How can I troubleshoot this further? Here is the IR's transcript: --------------- >ir IronRuby 0.9.0.0 on .NET 2.0.50727.3082 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' => true >>> gem 'rack' => true >>> require 'rack' => true >>> gem 'camping' => true >>> require 'camping' => ["Camping"] >>> require 'demo' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant #::TOPLEVEL_BINDING (NameError) from C:/Ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping.rb:39:in `goes' from ./demo.rb:3 from :0 from :0:in `require' from custom_require.rb:30:in `require' from dependencies.rb:156:in `require' from dependencies.rb:490:in `new_constants_in' from dependencies.rb:154:in `require' --------------- And the basic 'demo.rb' looks like the following: require 'camping' Camping.goes :Demo module Demo def Demo.create end end module Demo::Models end module Demo::Controllers class Index < R '/' def get render :index end end end module Demo::Views def layout html do body do self << yield end end end def index h1 "#{@input.name}, Welcome to my IronCamping demo!" end end ________________________________ _______________________________________________ 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 Mon Aug 31 23:27:52 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 1 Sep 2009 03:27:52 +0000 Subject: [Ironruby-core] Trying to run _why's Camping framework on IronRack / IIS In-Reply-To: <4A9C8BEB.20903@monnet-usa.com> References: <4A975441.40401@monnet-usa.com> <4A9ADB6A.4050805@monnet-usa.com> <4B342496A3EFEB48839E10BB4BF5964C0249D081@TK5EX14MBXC129.redmond.corp.microsoft.com> <178413D7-2FDF-4A1D-BF53-5A2B12FDE4B3@microsoft.com> <4A9C8BEB.20903@monnet-usa.com> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C024A0EC3@TK5EX14MBXC129.redmond.corp.microsoft.com> Cool! Great repro. This issue is related to bug http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1535 (Range is Enumerable and therefore implements Enumerable#to_a, which should be called by * operator). I?ve amended it and increased its priority to High. The workaround is to call to_ary/to_a explicitly: >>> r = 'a'..'d' => "a".."d" >>> [*(r.respond_to?(:to_ary) ? r.to_ary : r.to_a)].size => 4 Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Philippe Monnet Sent: Monday, August 31, 2009 7:50 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Trying to run _why's Camping framework on IronRack / IIS Now that I can run a minimalistic Camping app, I am moving on to get the Camping Blog app example to work. As I am now testing additional features like Camping session and access to ActiveRecord on SQL Server, I am starting a list of issues I have encountered. These issues seem triggered by differences between the two Ruby implementations. For example, the following code is used in the generation of a Camping session id: - in MRI: irb(main):001:0> [*'a'..'d'] => ["a", "b", "c", "d"] irb(main):002:0> [*'a'..'d'].size => 4 - in IR: >>> [*'a'..'d'] => ["a".."d"] >>> [*'a'..'d'].size => 1 As of tonight I can now establish a session and get the cookies and session state to work right. But forms Once I am done, I will write-up the other findings and work-arounds. Philippe Jimmy Schementi wrote: Ah, gotcha. Thanks for the explanation Tomas. I'll make that change. ~Jimmy Sent from my phone On Aug 30, 2009, at 10:24 PM, "Tomas Matousek" > wrote: The constant is not set when hosting IR and using Engine.Execute() or ScriptScope.Execute(). It is only set by ScriptSource.ExecuteProgram(). The reason is that each call to the former methods creates a new top-level binding and therefore we don?t know which one should be the one that is stored in TOPLEVEL_BINDING. The latter is meant to be used to execute the main top-level code (i.e. the ?program?) and it sets the TOPLEVEL_BINDING up. It also handles SystemExit exception so that ?exit? works according to Ruby?s semantics. IronRack should probably use ExecuteProgram to execute the main request processing script. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Philippe Monnet Sent: Sunday, August 30, 2009 1:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Trying to run _why's Camping framework on IronRack / IIS Today I dug deeper in the issue by breaking down the goes method of Camping in small chunks and evaluating them both in IR and MRI. I found that one thing expected by Camping was the global constant TOPLEVEL_BINDING. Apparently the constant was not defined in IR. A Google search found it in: ironruby/Merlin/Main/Languages/Ruby/Libs/hacks.rb And when I explicitly required it, the constant appeared and Camping worked immediately on IronRack. Could someone explain what the constant is for and why it is located in hacks.rb? Is it ok to I be using hacks.rb? Philippe PS - I am pretty excited to run Camping now! I just had to make a couple changes on top of IronRack to make it work. Philippe Monnet wrote: I have been leveraging IronRack to try to get a sample Camping application up and running. I seem to be able to require the camping library fine but then as try to hit the famous "Camping.goes :Demo" line, IronRuby return an error stating that the constant # is not initialized. So I tried to do the same test using the IR command line executable, but ran into the same issue (note that the same test works fine in IRB). What is strange is that the camping framework is loaded and if I query the constants in the Camping module I get back what I would expect. Is this a module loading issue? How can I troubleshoot this further? Here is the IR's transcript: --------------- >ir IronRuby 0.9.0.0 on .NET 2.0.50727.3082 Copyright (c) Microsoft Corporation. All rights reserved. >>> require 'rubygems' => true >>> gem 'rack' => true >>> require 'rack' => true >>> gem 'camping' => true >>> require 'camping' => ["Camping"] >>> require 'demo' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant #::TOPLEVEL_BINDING (NameError) from C:/Ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping.rb:39:in `goes' from ./demo.rb:3 from :0 from :0:in `require' from custom_require.rb:30:in `require' from dependencies.rb:156:in `require' from dependencies.rb:490:in `new_constants_in' from dependencies.rb:154:in `require' --------------- And the basic 'demo.rb' looks like the following: require 'camping' Camping.goes :Demo module Demo def Demo.create end end module Demo::Models end module Demo::Controllers class Index < R '/' def get render :index end end end module Demo::Views def layout html do body do self << yield end end end def index h1 "#{@input.name}, Welcome to my IronCamping demo!" end end ________________________________ _______________________________________________ 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: