Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/.
If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com> wrote:> If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. > > I assume you''re running with the latest source? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > > Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story > runner) to work with IronRuby? I have not had any luck thus far (I am > extremely new to Ruby), and I would really like to be able to use > Cucumber to write executable feature documentation for my .NET code. > > http://github.com/aslakhellesoy/cucumber/wikis > > I copied it under the "lib" directory, as well as several of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack > overflow. The same thing happens when I try to require some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > > I also tried to get gem working to aide me in this process, but I had > problems with that too. Has anyone got gem working with IronRuby? > > Thanks in advance! > Pat Gannon > -- > 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 >
An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/f55202a9/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.jpg Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/f55202a9/attachment.jpg>
I''ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I''d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B0.F8A84DD0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/befcb829/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/befcb829/attachment-0001.jpg>
An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/c3a6a605/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/c3a6a605/attachment-0001.jpe> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.jpg Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/c3a6a605/attachment-0001.jpg>
An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/a1dccb42/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/a1dccb42/attachment-0001.jpe> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.jpg Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/a1dccb42/attachment-0001.jpg>
The ExtensionAttribute thing is a problem with the export and build scripts. It works in our internal source tree.. (See http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx for an explanation of why it''s there to begin with.) The problem with the Merlin folders seems to come and go. If you can identify what''s causing them to be created now, then that''s at least as useful as an actual diff. Because of the way some of our sources build against both CLR2 and CLR4, we need to run transformations on the "internal source" before we can push it to RubyForge - so the patch probably couldn''t be applied directly anyway. I think all of this stuff is actually in the Rakefile. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Built a release version, and it takes 1.769418 seconds, which is a fair improvement from 2.07 congrats on getting this far! PS: The painful mess that you have to go through regarding Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive with Merlin and Main folders is a bit uncool :-( Is this kind of thing an area you will accept patches for? Orion Edwards wrote: I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B5.86003EF0] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B5.86003EF0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/58bc035d/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/58bc035d/attachment-0001.jpg>
Sorry -the transform script that strips internal layout details from our .csproj files hasn''t been updated to support the ExtensionAttribute project yet. If you do rake compile from the command prompt it will build correctly. I suspect that your problem with ActiveSupport has to do with the fact that we''re not searching your local gems path for IronRuby (it''s based off of the RUBY_ENGINE constant which means that it will look under a different set of paths. Since we haven''t gotten gem install to work correctly yet, we''ve been hacking things to work with an existing MRI installation and pulling gems out of that path instead. If you add these lines to the first file that runs (and before require ''rubygems''), things should just work: RUBY_ENGINE = ''ruby'' Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Built a release version, and it takes 1.769418 seconds, which is a fair improvement from 2.07 congrats on getting this far! PS: The painful mess that you have to go through regarding Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive with Merlin and Main folders is a bit uncool :-( Is this kind of thing an area you will accept patches for? Orion Edwards wrote: I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B8.607502D0] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B8.607502D0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/7c02a296/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/7c02a296/attachment-0001.jpg>
Qualified constants (and method calls) in ''define?'' are actually quite interesting. In: defined? x(f(1))::y(f(2))::D methods f, x, f, y are called (in this order) and if any of them throws an exception the exception is swallowed ($! is not set). It seems that the code should actually do something like: begin x(f(1))::y(f(2)).const_defined?(:D) ? ''constant'' : nil rescue Exception end Also ''defined?'' on a method call: defined? foo(1,2,3).bar(1,2,3) should do: begin foo(1,2,3).instance_methods.include? ''bar'' rescue Exception end Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B7.42B304F0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/1a2c7018/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/1a2c7018/attachment-0001.jpg>
John: The reason for ActiveSupport not being defined may have been due to the search path, but throwing an error on defined? Foo::Foo is a bug in our implementation. The bug is more of the problem in this case. RSpec is trying to use ActiveSupport if it''s already loaded, or load its own copy of the Inflector library. Orion: Were you wanting to patch the ExtensionAttribute thing? Or something with the Merlin and Main folders. The former just needs to be corrected by us (we already have it, it just needs some changes to our scripts), the latter is something we could probably take a patch for. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (IRONRUBY) Sent: Tuesday, October 21, 2008 8:06 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Sorry -the transform script that strips internal layout details from our .csproj files hasn''t been updated to support the ExtensionAttribute project yet. If you do rake compile from the command prompt it will build correctly. I suspect that your problem with ActiveSupport has to do with the fact that we''re not searching your local gems path for IronRuby (it''s based off of the RUBY_ENGINE constant which means that it will look under a different set of paths. Since we haven''t gotten gem install to work correctly yet, we''ve been hacking things to work with an existing MRI installation and pulling gems out of that path instead. If you add these lines to the first file that runs (and before require ''rubygems''), things should just work: RUBY_ENGINE = ''ruby'' Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Built a release version, and it takes 1.769418 seconds, which is a fair improvement from 2.07 congrats on getting this far! PS: The painful mess that you have to go through regarding Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive with Merlin and Main folders is a bit uncool :-( Is this kind of thing an area you will accept patches for? Orion Edwards wrote: I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B9.7636F7D0] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B9.7636F7D0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/87196e01/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/87196e01/attachment-0001.jpg>
Are those behaviors spec''d? If not they should be. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Tuesday, October 21, 2008 8:12 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Qualified constants (and method calls) in ''define?'' are actually quite interesting. In: defined? x(f(1))::y(f(2))::D methods f, x, f, y are called (in this order) and if any of them throws an exception the exception is swallowed ($! is not set). It seems that the code should actually do something like: begin x(f(1))::y(f(2)).const_defined?(:D) ? ''constant'' : nil rescue Exception end Also ''defined?'' on a method call: defined? foo(1,2,3).bar(1,2,3) should do: begin foo(1,2,3).instance_methods.include? ''bar'' rescue Exception end Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933B9.BF0D8370] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/97108918/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/97108918/attachment-0001.jpg>
Try r168 that I just pushed out. It should fix all of the problems related to littering your root directory, as well as the Microsoft.Scripting.ExtensionAttribute.dll build from both the IronRuby.sln solution, as well as in the rake compile task. The YAML external build was the main thing that was causing this - to the point where I doubt that YAML has worked for externals in quite some time. Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Built a release version, and it takes 1.769418 seconds, which is a fair improvement from 2.07 congrats on getting this far! PS: The painful mess that you have to go through regarding Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive with Merlin and Main folders is a bit uncool :-( Is this kind of thing an area you will accept patches for? Orion Edwards wrote: I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933C6.F5B96940] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933C6.F5B96940] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/c8c58cd4/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/c8c58cd4/attachment-0001.jpg>
Orion - can you supply us with your rspectest.rb file? I was just hacking around with rspec 1.1.9 here, and it''s blowing up with a bunch of dependencies on startup. Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:37 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner The nested defined? bug is logged here: http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 The ''caller'' one is actually 2 bugs, both of which have been logged by ben hall already http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 For those interested in running rspec right now, a better fix is to replace line 26 of main.rb with args.last[:spec_path] = File.expand_path( caller(0)[1].split('':'').first ) This will only cause rspec to lose the line number - you also have to run ir with the -D flag, or it doesn''t include the path at all. As far as my quick-hack investigation shows me, rspec only uses this data for showing friendly error messages, rather than any core logic, so perhaps it''s not super-critical. It would be nice to run it unpatched tho, IronRuby is looking incredibly close to doing that :-) Jim Deville wrote: I''ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I''d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933CE.03EA3510] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933CE.03EA3510] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/022a94c1/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8147 bytes Desc: image001.jpg URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/022a94c1/attachment-0001.jpg>
I wasn''t really sure where to start. Running a rake compile leaves the system alone, it''s actually when you open the projects in visual studio (which I needed to do earlier to compile a release build). Note: I have my code in c:\dev\ironruby on this box. there''s no trunk subfolder, so this may have something to do with all those ....\..\.. \..\..\.\.\...\''s that are in the csproj files The security warning dialog comes up telling me it may be unsafe, and asking to load the project for browsing, or to load normally. I tell it to load the project normally (I trust you guys, awwww), and it then creates these folders. Note that the only thing that was present previously was my c:\dev c:\build\release c:\Merlin\Main\Bin\FxCop c:\dev\Bin\FxCop Note: At this point, all I''ve done is tell VS to load microsoft.scripting.core.dll It then prompts me again if I trust it to load microsoft.scripting.extensionattribute.dll, which doesn''t create any extra directories that I can find This is not something I realised visual studio could actually even do, so perhaps I''m not the right person to provide a patch for it... Moving on, I now switch to release config, and hit compile. This now works with no additional hackery in svn r168 (Thanks John!) However, I now also have c:\Tools\Nessie\Nessie\bin\IronRuby.dll c:\build\debug IIRC compiling from VS in debug mode produces even more littering too. Thanks, Orion On 22/10/2008, at 4:13 PM, Jim Deville wrote:> John: > The reason for ActiveSupport not being defined may have been due to > the search path, but throwing an error on defined? Foo::Foo is a bug > in our implementation. The bug is more of the problem in this case. > RSpec is trying to use ActiveSupport if it?s already loaded, or load > its own copy of the Inflector library. > > Orion: > Were you wanting to patch the ExtensionAttribute thing? Or something > with the Merlin and Main folders. The former just needs to be > corrected by us (we already have it, it just needs some changes to > our scripts), the latter is something we could probably take a patch > for. > JD > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of John Lam (IRONRUBY) > Sent: Tuesday, October 21, 2008 8:06 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > Sorry ?the transform script that strips internal layout details from > our .csproj files hasn?t been updated to support the > ExtensionAttribute project yet. > > If you do rake compile from the command prompt it will build > correctly. > > I suspect that your problem with ActiveSupport has to do with the > fact that we?re not searching your local gems path for IronRuby > (it?s based off of the RUBY_ENGINE constant which means that it will > look under a different set of paths. > > Since we haven?t gotten gem install to work correctly yet, we?ve > been hacking things to work with an existing MRI installation and > pulling gems out of that path instead. If you add these lines to the > first file that runs (and before require ?rubygems?), things should > just work: > > RUBY_ENGINE = ?ruby? > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:18 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > Built a release version, and it takes 1.769418 seconds, which is a > fair improvement from 2.07 > > congrats on getting this far! > > PS: The painful mess that you have to go through regarding > Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive > with Merlin and Main folders is a bit uncool :-( > Is this kind of thing an area you will accept patches for? > > Orion Edwards wrote: > I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, > and it appears to work (I only have a simple test, but hey). > > I only had to make 2 changes: > > rspec\lib\spec\extensions\main.rb:26 is > args.last[:spec_path] = File.expand_path(caller(0)[1]) > > IronRuby still doesn''t seem to handle caller quite the same as MRI. > I have no idea what that code is for, but I replaced it with this as > a quick hack > args.last[:spec_path] = "." > > and it seemed to work. > > I encountered another problem using the ''have'' matcher - rspec does > this > if inflector = (defined?(ActiveSupport::Inflector) ? > ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > > IronRuby throws uninitialized constant Object::ActiveSupport, > whereas MRI just returns nil - it looks like IR isn''t handling > defined? on nested things properly yet. > > To work around this I just put > module ActiveSupport; end > > at the top of my ruby file to get around the nested module issue. > > And presto! > C:\development\irtest>ir rspectest.rb > . > > Finished in 2.072133 seconds > > 1 example, 0 failures > > C:\development\irtest>ruby rspectest.rb > . > > Finished in 0.053 seconds > > 1 example, 0 failures > > > The only problem now is that 2.07 seconds is somewhat larger than > 0.053... I am using the debug build of ir though, as that''s what > rake:compile seems to give me. > > Just playing with VS now to see if I can build a release version and > try that > > Ben Hall wrote: > Hi, > > To get rspec to work you will need to modify the actual Ironruby > source. I''ve raised bugs to get the changes required fixed, however I > did this based on 1.1.4, I think Cucumber will have a whole load more > bugs attached as it has more dependencies. > > I know for a fact you won''t be able to run Cucumber unmodified due to > existing bugs around gems. (for example, gem needing .rb at the end > of the file to be able to find it) > > However, I haven''t had chance to take a closer look. > > Ben > > > > On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > <curth at microsoft.com> wrote: > > If you explicitly set the GEM_PATH before requiring gems, you should > be able to use gems that are already present. I haven''t tried any > other gem operations. > > I assume you''re running with the latest source? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > > Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story > runner) to work with IronRuby? I have not had any luck thus far (I am > extremely new to Ruby), and I would really like to be able to use > Cucumber to write executable feature documentation for my .NET code. > > http://github.com/aslakhellesoy/cucumber/wikis > > I copied it under the "lib" directory, as well as several of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a > stack > overflow. The same thing happens when I try to require some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > > I also tried to get gem working to aide me in this process, but I had > problems with that too. Has anyone got gem working with IronRuby? > > Thanks in advance! > Pat Gannon > -- > 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 > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > > > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/f39eb1c9/attachment-0001.html>
It appears that rspec has a broken gemspec. It''s not installing spicycode-rcov, syntax, and possibly more. JD ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (IRONRUBY) [jflam at microsoft.com] Sent: Tuesday, October 21, 2008 10:40 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Orion ? can you supply us with your rspectest.rb file? I was just hacking around with rspec 1.1.9 here, and it?s blowing up with a bunch of dependencies on startup. Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:37 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner The nested defined? bug is logged here: http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 The ''caller'' one is actually 2 bugs, both of which have been logged by ben hall already http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 For those interested in running rspec right now, a better fix is to replace line 26 of main.rb with args.last[:spec_path] = File.expand_path( caller(0)[1].split('':'').first ) This will only cause rspec to lose the line number - you also have to run ir with the -D flag, or it doesn''t include the path at all. As far as my quick-hack investigation shows me, rspec only uses this data for showing friendly error messages, rather than any core logic, so perhaps it''s not super-critical. It would be nice to run it unpatched tho, IronRuby is looking incredibly close to doing that :-) Jim Deville wrote: I?ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I?d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933CE.03EA3510] ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website [cid:image001.jpg at 01C933CE.03EA3510]
Sure. Here''s the entire contents of the ruby file $LOAD_PATH << ''c:/dev/rspec/lib'' require ''spec'' module ActiveSupport; end # workaround ironruby defined? bug class Vehicle def initialize(people) @people = people end attr_accessor :people end describe Vehicle do it "should assign people using the constructor" do car = Vehicle.new([''orion'', ''john'', ''jim'']) car.should have(3).people end end Note I''m not using gems or anything else like that. To replicate this you''d basically do this: svn checkout ironruby 168 into c:\dev\ironruby rake compile git clone rspec straight from github, and stick it in c:\dev\rspec edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to File.expand_path spin up a command prompt and set PATH=blahblah so it can see the ironruby binaries that got build previously ir rspectest.rb On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote:> Orion ? can you supply us with your rspectest.rb file? > > I was just hacking around with rspec 1.1.9 here, and it?s blowing up > with a bunch of dependencies on startup. > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:37 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > The nested defined? bug is logged here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 > > The ''caller'' one is actually 2 bugs, both of which have been logged > by ben hall already > > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 > > For those interested in running rspec right now, a better fix is to > replace line 26 of main.rb with > args.last[:spec_path] = File.expand_path( caller(0) > [1].split('':'').first ) > > This will only cause rspec to lose the line number - you also have > to run ir with the -D flag, or it doesn''t include the path at all. > > As far as my quick-hack investigation shows me, rspec only uses this > data for showing friendly error messages, rather than any core > logic, so perhaps it''s not super-critical. > It would be nice to run it unpatched tho, IronRuby is looking > incredibly close to doing that :-) > > > Jim Deville wrote: > I?ll add a rake task to compile release. Can you try to isolate > those cases and file bugs? The second one is pretty easy, but I?d > like to have tracking on both of them. > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:04 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, > and it appears to work (I only have a simple test, but hey). > > I only had to make 2 changes: > > rspec\lib\spec\extensions\main.rb:26 is > args.last[:spec_path] = File.expand_path(caller(0)[1]) > IronRuby still doesn''t seem to handle caller quite the same as MRI. > I have no idea what that code is for, but I replaced it with this as > a quick hack > args.last[:spec_path] = "." > and it seemed to work. > > I encountered another problem using the ''have'' matcher - rspec does > this > if inflector = (defined?(ActiveSupport::Inflector) ? > ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > IronRuby throws uninitialized constant Object::ActiveSupport, > whereas MRI just returns nil - it looks like IR isn''t handling > defined? on nested things properly yet. > > To work around this I just put > module ActiveSupport; end > at the top of my ruby file to get around the nested module issue. > > And presto! > C:\development\irtest>ir rspectest.rb > . > > Finished in 2.072133 seconds > > 1 example, 0 failures > > C:\development\irtest>ruby rspectest.rb > . > > Finished in 0.053 seconds > > 1 example, 0 failures > > The only problem now is that 2.07 seconds is somewhat larger than > 0.053... I am using the debug build of ir though, as that''s what > rake:compile seems to give me. > > Just playing with VS now to see if I can build a release version and > try that > > Ben Hall wrote: > Hi, > > To get rspec to work you will need to modify the actual Ironruby > source. I''ve raised bugs to get the changes required fixed, however I > did this based on 1.1.4, I think Cucumber will have a whole load more > bugs attached as it has more dependencies. > > I know for a fact you won''t be able to run Cucumber unmodified due to > existing bugs around gems. (for example, gem needing .rb at the end > of the file to be able to find it) > > However, I haven''t had chance to take a closer look. > > Ben > > > > On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > <curth at microsoft.com> wrote: > > If you explicitly set the GEM_PATH before requiring gems, you should > be able to use gems that are already present. I haven''t tried any > other gem operations. > > I assume you''re running with the latest source? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > > Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story > runner) to work with IronRuby? I have not had any luck thus far (I am > extremely new to Ruby), and I would really like to be able to use > Cucumber to write executable feature documentation for my .NET code. > > http://github.com/aslakhellesoy/cucumber/wikis > > I copied it under the "lib" directory, as well as several of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a > stack > overflow. The same thing happens when I try to require some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > > I also tried to get gem working to aide me in this process, but I had > problems with that too. Has anyone got gem working with IronRuby? > > Thanks in advance! > Pat Gannon > -- > 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 > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/28bc641f/attachment-0001.html>
Here''s another test if you are using gems. It should work with ir test_spec.rb JD ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards [orion.edwards at open2view.com] Sent: Tuesday, October 21, 2008 11:07 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Sure. Here''s the entire contents of the ruby file $LOAD_PATH << ''c:/dev/rspec/lib'' require ''spec'' module ActiveSupport; end # workaround ironruby defined? bug class Vehicle def initialize(people) @people = people end attr_accessor :people end describe Vehicle do it "should assign people using the constructor" do car = Vehicle.new([''orion'', ''john'', ''jim'']) car.should have(3).people end end Note I''m not using gems or anything else like that. To replicate this you''d basically do this: svn checkout ironruby 168 into c:\dev\ironruby rake compile git clone rspec straight from github, and stick it in c:\dev\rspec edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to File.expand_path spin up a command prompt and set PATH=blahblah so it can see the ironruby binaries that got build previously ir rspectest.rb On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: Orion ? can you supply us with your rspectest.rb file? I was just hacking around with rspec 1.1.9 here, and it?s blowing up with a bunch of dependencies on startup. Thanks, -John From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:37 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner The nested defined? bug is logged here: http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 The ''caller'' one is actually 2 bugs, both of which have been logged by ben hall already http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 For those interested in running rspec right now, a better fix is to replace line 26 of main.rb with args.last[:spec_path] = File.expand_path( caller(0)[1].split('':'').first ) This will only cause rspec to lose the line number - you also have to run ir with the -D flag, or it doesn''t include the path at all. As far as my quick-hack investigation shows me, rspec only uses this data for showing friendly error messages, rather than any core logic, so perhaps it''s not super-critical. It would be nice to run it unpatched tho, IronRuby is looking incredibly close to doing that :-) Jim Deville wrote: I?ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I?d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- A non-text attachment was scrubbed... Name: test_spec.rb Type: text/x-ruby-script Size: 106 bytes Desc: test_spec.rb URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/14124706/attachment.bin>
John, for the record, you have to add github as a source for spicycode-rcov (gem sources -a http://gems.github.com). JD ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville [jdeville at microsoft.com] Sent: Tuesday, October 21, 2008 11:10 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Here''s another test if you are using gems. It should work with ir test_spec.rb JD ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards [orion.edwards at open2view.com] Sent: Tuesday, October 21, 2008 11:07 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Sure. Here''s the entire contents of the ruby file $LOAD_PATH << ''c:/dev/rspec/lib'' require ''spec'' module ActiveSupport; end # workaround ironruby defined? bug class Vehicle def initialize(people) @people = people end attr_accessor :people end describe Vehicle do it "should assign people using the constructor" do car = Vehicle.new([''orion'', ''john'', ''jim'']) car.should have(3).people end end Note I''m not using gems or anything else like that. To replicate this you''d basically do this: svn checkout ironruby 168 into c:\dev\ironruby rake compile git clone rspec straight from github, and stick it in c:\dev\rspec edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to File.expand_path spin up a command prompt and set PATH=blahblah so it can see the ironruby binaries that got build previously ir rspectest.rb On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: Orion ? can you supply us with your rspectest.rb file? I was just hacking around with rspec 1.1.9 here, and it?s blowing up with a bunch of dependencies on startup. Thanks, -John From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:37 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner The nested defined? bug is logged here: http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 The ''caller'' one is actually 2 bugs, both of which have been logged by ben hall already http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 For those interested in running rspec right now, a better fix is to replace line 26 of main.rb with args.last[:spec_path] = File.expand_path( caller(0)[1].split('':'').first ) This will only cause rspec to lose the line number - you also have to run ir with the -D flag, or it doesn''t include the path at all. As far as my quick-hack investigation shows me, rspec only uses this data for showing friendly error messages, rather than any core logic, so perhaps it''s not super-critical. It would be nice to run it unpatched tho, IronRuby is looking incredibly close to doing that :-) Jim Deville wrote: I?ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I?d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core
Great - I have it working now on my machine. I''m seeing 0.45s or so as the net time (excluding startup) for the tests if I run using the -X:Interpret flag. Can you try running with that flag enabled on your machine and let me know how quickly it runs? Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 11:07 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner Sure. Here''s the entire contents of the ruby file $LOAD_PATH << ''c:/dev/rspec/lib'' require ''spec'' module ActiveSupport; end # workaround ironruby defined? bug class Vehicle def initialize(people) @people = people end attr_accessor :people end describe Vehicle do it "should assign people using the constructor" do car = Vehicle.new([''orion'', ''john'', ''jim'']) car.should have(3).people end end Note I''m not using gems or anything else like that. To replicate this you''d basically do this: svn checkout ironruby 168 into c:\dev\ironruby rake compile git clone rspec straight from github, and stick it in c:\dev\rspec edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to File.expand_path spin up a command prompt and set PATH=blahblah so it can see the ironruby binaries that got build previously ir rspectest.rb On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: Orion - can you supply us with your rspectest.rb file? I was just hacking around with rspec 1.1.9 here, and it''s blowing up with a bunch of dependencies on startup. Thanks, -John From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:37 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner The nested defined? bug is logged here: http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 The ''caller'' one is actually 2 bugs, both of which have been logged by ben hall already http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 For those interested in running rspec right now, a better fix is to replace line 26 of main.rb with args.last[:spec_path] = File.expand_path( caller(0)[1].split('':'').first ) This will only cause rspec to lose the line number - you also have to run ir with the -D flag, or it doesn''t include the path at all. As far as my quick-hack investigation shows me, rspec only uses this data for showing friendly error messages, rather than any core logic, so perhaps it''s not super-critical. It would be nice to run it unpatched tho, IronRuby is looking incredibly close to doing that :-) Jim Deville wrote: I''ll add a rake task to compile release. Can you try to isolate those cases and file bugs? The second one is pretty easy, but I''d like to have tracking on both of them. From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, October 21, 2008 7:04 PM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey). I only had to make 2 changes: rspec\lib\spec\extensions\main.rb:26 is args.last[:spec_path] = File.expand_path(caller(0)[1]) IronRuby still doesn''t seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack args.last[:spec_path] = "." and it seemed to work. I encountered another problem using the ''have'' matcher - rspec does this if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn''t handling defined? on nested things properly yet. To work around this I just put module ActiveSupport; end at the top of my ruby file to get around the nested module issue. And presto! C:\development\irtest>ir rspectest.rb . Finished in 2.072133 seconds 1 example, 0 failures C:\development\irtest>ruby rspectest.rb . Finished in 0.053 seconds 1 example, 0 failures The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that''s what rake:compile seems to give me. Just playing with VS now to see if I can build a release version and try that Ben Hall wrote: Hi, To get rspec to work you will need to modify the actual Ironruby source. I''ve raised bugs to get the changes required fixed, however I did this based on 1.1.4, I think Cucumber will have a whole load more bugs attached as it has more dependencies. I know for a fact you won''t be able to run Cucumber unmodified due to existing bugs around gems. (for example, gem needing .rb at the end of the file to be able to find it) However, I haven''t had chance to take a closer look. Ben On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote: If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present. I haven''t tried any other gem operations. I assume you''re running with the latest source? -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon Sent: Friday, October 17, 2008 1:30 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Cucumber / RSpec Story Runner Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story runner) to work with IronRuby? I have not had any luck thus far (I am extremely new to Ruby), and I would really like to be able to use Cucumber to write executable feature documentation for my .NET code. http://github.com/aslakhellesoy/cucumber/wikis I copied it under the "lib" directory, as well as several of its dependencies, but when I try to do "require ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a stack overflow. The same thing happens when I try to require some its dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require ''polyglot-0.2.3/lib/polyglot''" and "require ''treetop-1.2.4/lib/treetop''"). I also tried to get gem working to aide me in this process, but I had problems with that too. Has anyone got gem working with IronRuby? Thanks in advance! Pat Gannon -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> ________________________________ _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- Orion Edwards Web Application Developer T: +64 7 859 2120 F: +64 7 859 2320 E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com> Open2view.com The Real Estate Website <image001.jpg> _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/59d1d567/attachment-0001.html>
I''m not on the same machine as earlier - the previous machine was my work desktop PC running vista This one is running windows XP under vmware on a macbook Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on the first) Without it I see 1.95 seconds (2.05 on the first run) I didn''t know about -X:Interpret... So what exactly does it do differently, and if it''s so much faster, why isn''t it the default? On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote:> Great ? I have it working now on my machine. > > I?m seeing 0.45s or so as the net time (excluding startup) for the > tests if I run using the ?X:Interpret flag. Can you try running with > that flag enabled on your machine and let me know how quickly it runs? > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 11:07 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > Sure. Here''s the entire contents of the ruby file > > $LOAD_PATH << ''c:/dev/rspec/lib'' > > require ''spec'' > > module ActiveSupport; end # workaround ironruby defined? bug > > class Vehicle > def initialize(people) > @people = people > end > attr_accessor :people > end > > describe Vehicle do > it "should assign people using the constructor" do > car = Vehicle.new([''orion'', ''john'', ''jim'']) > car.should have(3).people > end > end > > Note I''m not using gems or anything else like that. To replicate > this you''d basically do this: > > svn checkout ironruby 168 into c:\dev\ironruby > > rake compile > > git clone rspec straight from github, and stick it in c:\dev\rspec > > edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to > File.expand_path > > spin up a command prompt and set PATH=blahblah so it can see the > ironruby binaries that got build previously > > ir rspectest.rb > > > > On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: > > > Orion ? can you supply us with your rspectest.rb file? > > I was just hacking around with rspec 1.1.9 here, and it?s blowing up > with a bunch of dependencies on startup. > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:37 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > The nested defined? bug is logged here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id=4359&atid=16798 > > The ''caller'' one is actually 2 bugs, both of which have been logged > by ben hall already > > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22315 > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=22348 > > For those interested in running rspec right now, a better fix is to > replace line 26 of main.rb with > args.last[:spec_path] = File.expand_path( caller(0) > [1].split('':'').first ) > > This will only cause rspec to lose the line number - you also have > to run ir with the -D flag, or it doesn''t include the path at all. > > As far as my quick-hack investigation shows me, rspec only uses this > data for showing friendly error messages, rather than any core > logic, so perhaps it''s not super-critical. > It would be nice to run it unpatched tho, IronRuby is looking > incredibly close to doing that :-) > > > Jim Deville wrote: > I?ll add a rake task to compile release. Can you try to isolate > those cases and file bugs? The second one is pretty easy, but I?d > like to have tracking on both of them. > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:04 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, > and it appears to work (I only have a simple test, but hey). > > I only had to make 2 changes: > > rspec\lib\spec\extensions\main.rb:26 is > args.last[:spec_path] = File.expand_path(caller(0)[1]) > IronRuby still doesn''t seem to handle caller quite the same as MRI. > I have no idea what that code is for, but I replaced it with this as > a quick hack > args.last[:spec_path] = "." > and it seemed to work. > > I encountered another problem using the ''have'' matcher - rspec does > this > if inflector = (defined?(ActiveSupport::Inflector) ? > ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > IronRuby throws uninitialized constant Object::ActiveSupport, > whereas MRI just returns nil - it looks like IR isn''t handling > defined? on nested things properly yet. > > To work around this I just put > module ActiveSupport; end > at the top of my ruby file to get around the nested module issue. > > And presto! > C:\development\irtest>ir rspectest.rb > . > > Finished in 2.072133 seconds > > 1 example, 0 failures > > C:\development\irtest>ruby rspectest.rb > . > > Finished in 0.053 seconds > > 1 example, 0 failures > > The only problem now is that 2.07 seconds is somewhat larger than > 0.053... I am using the debug build of ir though, as that''s what > rake:compile seems to give me. > > Just playing with VS now to see if I can build a release version and > try that > > Ben Hall wrote: > Hi, > > To get rspec to work you will need to modify the actual Ironruby > source. I''ve raised bugs to get the changes required fixed, however I > did this based on 1.1.4, I think Cucumber will have a whole load more > bugs attached as it has more dependencies. > > I know for a fact you won''t be able to run Cucumber unmodified due to > existing bugs around gems. (for example, gem needing .rb at the end > of the file to be able to find it) > > However, I haven''t had chance to take a closer look. > > Ben > > > > On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > <curth at microsoft.com> wrote: > > If you explicitly set the GEM_PATH before requiring gems, you should > be able to use gems that are already present. I haven''t tried any > other gem operations. > > I assume you''re running with the latest source? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org > ] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > > Has anyone tried to get Cucumber (or it''s predecessor: the RSpec story > runner) to work with IronRuby? I have not had any luck thus far (I am > extremely new to Ruby), and I would really like to be able to use > Cucumber to write executable feature documentation for my .NET code. > > http://github.com/aslakhellesoy/cucumber/wikis > > I copied it under the "lib" directory, as well as several of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a > stack > overflow. The same thing happens when I try to require some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > > I also tried to get gem working to aide me in this process, but I had > problems with that too. Has anyone got gem working with IronRuby? > > Thanks in advance! > Pat Gannon > -- > 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 > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > <image001.jpg> > _______________________________________________ > 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: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/32838464/attachment-0001.html>
-X:Interpret forces execution to always go through the DLR interpreter rather than through the DLR compilation engine. This trades-off faster startup for decreased throughput. We have a number of different strategies that we''re exploring to improve things: 1) Ahead of time cached pre-compilation to native x86 via ngen 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off interpreting and compile the ''hot'' code paths dynamically at runtime. 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even more by writing a Ruby specific interpreter and avoiding the tree transform from the Ruby AST to DLR trees for the interpreted code paths. We really haven''t done any performance tuning of note on IronRuby so far. We''re focusing on getting the language correct; performance will come after we stabilize the language. Thanks, -John> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 11:38 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > I''m not on the same machine as earlier - the previous machine was my > work desktop PC running vista > > This one is running windows XP under vmware on a macbook > > Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on > the first) Without it I see 1.95 seconds (2.05 on the first run) > > I didn''t know about -X:Interpret... > So what exactly does it do differently, and if it''s so much faster, > why isn''t it the default? > > > > On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: > > > > Great - I have it working now on my machine. > > I''m seeing 0.45s or so as the net time (excluding startup) for the > tests if I run using the -X:Interpret flag. Can you try running with > that flag enabled on your machine and let me know how quickly it runs? > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 11:07 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > Sure. Here''s the entire contents of the ruby file > > $LOAD_PATH << ''c:/dev/rspec/lib'' > > require ''spec'' > > module ActiveSupport; end # workaround ironruby defined? bug > > class Vehicle > def initialize(people) > @people = people > end > attr_accessor :people > end > > describe Vehicle do > it "should assign people using the constructor" do > car = Vehicle.new([''orion'', ''john'', ''jim'']) > car.should have(3).people > end > end > > Note I''m not using gems or anything else like that. To replicate this > you''d basically do this: > > svn checkout ironruby 168 into c:\dev\ironruby > > rake compile > > git clone rspec straight from github, and stick it in c:\dev\rspec > > edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to > File.expand_path > > spin up a command prompt and set PATH=blahblah so it can see the > ironruby binaries that got build previously > > ir rspectest.rb > > > > On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: > > > Orion - can you supply us with your rspectest.rb file? > > I was just hacking around with rspec 1.1.9 here, and it''s blowing up > with a bunch of dependencies on startup. > > Thanks, > -John > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:37 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > The nested defined? bug is logged here: > > > http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id> 4 > 3 > 59&atid=16798 > > The ''caller'' one is actually 2 bugs, both of which have been logged > by ben hall already > > > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > > 2 > 2315 > > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > > 2 > 2348 > > For those interested in running rspec right now, a better fix is to > replace line 26 of main.rb with > args.last[:spec_path] = File.expand_path( > caller(0)[1].split('':'').first ) > > This will only cause rspec to lose the line number - you also have to > run ir with the -D flag, or it doesn''t include the path at all. > > As far as my quick-hack investigation shows me, rspec only uses this > data for showing friendly error messages, rather than any core logic, > so perhaps it''s not super-critical. > It would be nice to run it unpatched tho, IronRuby is looking > incredibly close to doing that :-) > > > Jim Deville wrote: > I''ll add a rake task to compile release. Can you try to isolate those > cases and file bugs? The second one is pretty easy, but I''d like to > have tracking on both of them. > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:04 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, > and it appears to work (I only have a simple test, but hey). > > I only had to make 2 changes: > > rspec\lib\spec\extensions\main.rb:26 is > args.last[:spec_path] = File.expand_path(caller(0)[1]) > IronRuby still doesn''t seem to handle caller quite the same as MRI. I > have no idea what that code is for, but I replaced it with this as a > quick hack > args.last[:spec_path] = "." > > and it seemed to work. > > I encountered another problem using the ''have'' matcher - rspec does > this > if inflector = (defined?(ActiveSupport::Inflector) ? > ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > IronRuby throws uninitialized constant Object::ActiveSupport, whereas > MRI just returns nil - it looks like IR isn''t handling defined? > on nested things properly yet. > > To work around this I just put > module ActiveSupport; end > at the top of my ruby file to get around the nested module issue. > > And presto! > C:\development\irtest>ir rspectest.rb > . > > Finished in 2.072133 seconds > > 1 example, 0 failures > > C:\development\irtest>ruby rspectest.rb > . > > Finished in 0.053 seconds > > 1 example, 0 failures > > The only problem now is that 2.07 seconds is somewhat larger than > 0.053... I am using the debug build of ir though, as that''s what > rake:compile seems to give me. > > Just playing with VS now to see if I can build a release version and > try that > > Ben Hall wrote: > Hi, > > To get rspec to work you will need to modify the actual Ironruby > source. I''ve raised bugs to get the changes required fixed, however > I > did this based on 1.1.4, I think Cucumber will have a whole load more > bugs attached as it has more dependencies. > > I know for a fact you won''t be able to run Cucumber unmodified due to > existing bugs around gems. (for example, gem needing .rb at the end > of the file to be able to find it) > > However, I haven''t had chance to take a closer look. > > Ben > > > > On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > <curth at microsoft.com> <mailto:curth at microsoft.com> wrote: > > > If you explicitly set the GEM_PATH before requiring gems, you should > be able to use gems that are already present. I haven''t tried any > other gem operations. > > I assume you''re running with the latest source? > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > > Has anyone tried to get Cucumber (or it''s predecessor: > the RSpec story > runner) to work with IronRuby? I have not had any luck thus far (I > am > extremely new to Ruby), and I would really like to be able to use > Cucumber to write executable feature documentation for my .NET code. > > http://github.com/aslakhellesoy/cucumber/wikis > > I copied it under the "lib" directory, as well as several of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a > stack > overflow. The same thing happens when I try to require some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" > and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. > "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > > I also tried to get gem working to aide me in this process, but I > had > problems with that too. Has anyone got gem working with IronRuby? > > Thanks in advance! > Pat Gannon > -- > 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 > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > <mailto:orion.edwards at open2view.com> > > Open2view.com > The Real Estate Website > > <image001.jpg> > > > ________________________________ > > > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > <mailto:orion.edwards at open2view.com> > > Open2view.com > The Real Estate Website > > <image001.jpg> > _______________________________________________ > 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 > >
Nice work guys!! Pleased that I won''t be having to use a hacked version of r156 :) One of the problems you mentioned (pretty errors due to backtrace) will cause the story runner in 1.1.4 to blow up and throw an exception, but as that is now Cucumber I don''t know if we will have the same issues. Have you tried Cucumber yet? Ben On Wed, Oct 22, 2008 at 8:01 AM, John Lam (IRONRUBY) <jflam at microsoft.com> wrote:> -X:Interpret forces execution to always go through the DLR interpreter rather than through the DLR compilation engine. > > This trades-off faster startup for decreased throughput. > > We have a number of different strategies that we''re exploring to improve things: > > 1) Ahead of time cached pre-compilation to native x86 via ngen > 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off interpreting and compile the ''hot'' code paths dynamically at runtime. > 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even more by writing a Ruby specific interpreter and avoiding the tree transform from the Ruby AST to DLR trees for the interpreted code paths. > > We really haven''t done any performance tuning of note on IronRuby so far. We''re focusing on getting the language correct; performance will come after we stabilize the language. > > > Thanks, > -John > > >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- >> bounces at rubyforge.org] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 11:38 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> I''m not on the same machine as earlier - the previous machine was my >> work desktop PC running vista >> >> This one is running windows XP under vmware on a macbook >> >> Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on >> the first) Without it I see 1.95 seconds (2.05 on the first run) >> >> I didn''t know about -X:Interpret... >> So what exactly does it do differently, and if it''s so much faster, >> why isn''t it the default? >> >> >> >> On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: >> >> >> >> Great - I have it working now on my machine. >> >> I''m seeing 0.45s or so as the net time (excluding startup) for the >> tests if I run using the -X:Interpret flag. Can you try running with >> that flag enabled on your machine and let me know how quickly it runs? >> >> Thanks, >> -John >> >> From: ironruby-core-bounces at rubyforge.org >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 11:07 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> Sure. Here''s the entire contents of the ruby file >> >> $LOAD_PATH << ''c:/dev/rspec/lib'' >> >> require ''spec'' >> >> module ActiveSupport; end # workaround ironruby defined? bug >> >> class Vehicle >> def initialize(people) >> @people = people >> end >> attr_accessor :people >> end >> >> describe Vehicle do >> it "should assign people using the constructor" do >> car = Vehicle.new([''orion'', ''john'', ''jim'']) >> car.should have(3).people >> end >> end >> >> Note I''m not using gems or anything else like that. To replicate this >> you''d basically do this: >> >> svn checkout ironruby 168 into c:\dev\ironruby >> >> rake compile >> >> git clone rspec straight from github, and stick it in c:\dev\rspec >> >> edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to >> File.expand_path >> >> spin up a command prompt and set PATH=blahblah so it can see the >> ironruby binaries that got build previously >> >> ir rspectest.rb >> >> >> >> On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: >> >> >> Orion - can you supply us with your rspectest.rb file? >> >> I was just hacking around with rspec 1.1.9 here, and it''s blowing up >> with a bunch of dependencies on startup. >> >> Thanks, >> -John >> >> From: ironruby-core-bounces at rubyforge.org >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 7:37 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> The nested defined? bug is logged here: >> >> >> http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id>> 4 >> 3 >> 59&atid=16798 >> >> The ''caller'' one is actually 2 bugs, both of which have been logged >> by ben hall already >> >> >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >> >> 2 >> 2315 >> >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >> >> 2 >> 2348 >> >> For those interested in running rspec right now, a better fix is to >> replace line 26 of main.rb with >> args.last[:spec_path] = File.expand_path( >> caller(0)[1].split('':'').first ) >> >> This will only cause rspec to lose the line number - you also have to >> run ir with the -D flag, or it doesn''t include the path at all. >> >> As far as my quick-hack investigation shows me, rspec only uses this >> data for showing friendly error messages, rather than any core logic, >> so perhaps it''s not super-critical. >> It would be nice to run it unpatched tho, IronRuby is looking >> incredibly close to doing that :-) >> >> >> Jim Deville wrote: >> I''ll add a rake task to compile release. Can you try to isolate those >> cases and file bugs? The second one is pretty easy, but I''d like to >> have tracking on both of them. >> >> From: ironruby-core-bounces at rubyforge.org >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 7:04 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, >> and it appears to work (I only have a simple test, but hey). >> >> I only had to make 2 changes: >> >> rspec\lib\spec\extensions\main.rb:26 is >> args.last[:spec_path] = File.expand_path(caller(0)[1]) >> IronRuby still doesn''t seem to handle caller quite the same as MRI. I >> have no idea what that code is for, but I replaced it with this as a >> quick hack >> args.last[:spec_path] = "." >> >> and it seemed to work. >> >> I encountered another problem using the ''have'' matcher - rspec does >> this >> if inflector = (defined?(ActiveSupport::Inflector) ? >> ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) >> IronRuby throws uninitialized constant Object::ActiveSupport, whereas >> MRI just returns nil - it looks like IR isn''t handling defined? >> on nested things properly yet. >> >> To work around this I just put >> module ActiveSupport; end >> at the top of my ruby file to get around the nested module issue. >> >> And presto! >> C:\development\irtest>ir rspectest.rb >> . >> >> Finished in 2.072133 seconds >> >> 1 example, 0 failures >> >> C:\development\irtest>ruby rspectest.rb >> . >> >> Finished in 0.053 seconds >> >> 1 example, 0 failures >> >> The only problem now is that 2.07 seconds is somewhat larger than >> 0.053... I am using the debug build of ir though, as that''s what >> rake:compile seems to give me. >> >> Just playing with VS now to see if I can build a release version and >> try that >> >> Ben Hall wrote: >> Hi, >> >> To get rspec to work you will need to modify the actual Ironruby >> source. I''ve raised bugs to get the changes required fixed, however >> I >> did this based on 1.1.4, I think Cucumber will have a whole load more >> bugs attached as it has more dependencies. >> >> I know for a fact you won''t be able to run Cucumber unmodified due to >> existing bugs around gems. (for example, gem needing .rb at the end >> of the file to be able to find it) >> >> However, I haven''t had chance to take a closer look. >> >> Ben >> >> >> >> On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher >> <curth at microsoft.com> <mailto:curth at microsoft.com> wrote: >> >> >> If you explicitly set the GEM_PATH before requiring gems, you should >> be able to use gems that are already present. I haven''t tried any >> other gem operations. >> >> I assume you''re running with the latest source? >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon >> Sent: Friday, October 17, 2008 1:30 AM >> To: ironruby-core at rubyforge.org >> Subject: [Ironruby-core] Cucumber / RSpec Story Runner >> >> Has anyone tried to get Cucumber (or it''s predecessor: >> the RSpec story >> runner) to work with IronRuby? I have not had any luck thus far (I >> am >> extremely new to Ruby), and I would really like to be able to use >> Cucumber to write executable feature documentation for my .NET code. >> >> http://github.com/aslakhellesoy/cucumber/wikis >> >> I copied it under the "lib" directory, as well as several of its >> dependencies, but when I try to do "require >> ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a >> stack >> overflow. The same thing happens when I try to require some its >> dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" >> and "require >> ''rake-0.8.3/lib/rake''"), but some work just fine (eg. >> "require >> ''polyglot-0.2.3/lib/polyglot''" and "require >> ''treetop-1.2.4/lib/treetop''"). >> >> I also tried to get gem working to aide me in this process, but I >> had >> problems with that too. Has anyone got gem working with IronRuby? >> >> Thanks in advance! >> Pat Gannon >> -- >> 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 >> >> >> -- >> Orion Edwards >> Web Application Developer >> >> T: +64 7 859 2120 >> F: +64 7 859 2320 >> E: orion.edwards at open2view.com >> <mailto:orion.edwards at open2view.com> >> >> Open2view.com >> The Real Estate Website >> >> <image001.jpg> >> >> >> ________________________________ >> >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> -- >> Orion Edwards >> Web Application Developer >> >> T: +64 7 859 2120 >> F: +64 7 859 2320 >> E: orion.edwards at open2view.com >> <mailto:orion.edwards at open2view.com> >> >> Open2view.com >> The Real Estate Website >> >> <image001.jpg> >> _______________________________________________ >> 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 >
I''ll try cucumber tonight when i get home. I''m trying to build a little rails app with rspec etc. What''s the status on a .NET based active record adapter? I''ve been thinking that it might be necessary to write an adapter that creates the correct .NET provider and dispatches the calls through that layer. Either as a part of ruby-dbd or as adapters to ActiveRecord.. dbd gives the advantage that you can use it everywhere then. any thoughts? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Wed, Oct 22, 2008 at 9:56 AM, Ben Hall <ben2004uk at googlemail.com> wrote:> Nice work guys!! Pleased that I won''t be having to use a hacked > version of r156 :) > > One of the problems you mentioned (pretty errors due to backtrace) > will cause the story runner in 1.1.4 to blow up and throw an > exception, but as that is now Cucumber I don''t know if we will have > the same issues. Have you tried Cucumber yet? > > > Ben > > > > > On Wed, Oct 22, 2008 at 8:01 AM, John Lam (IRONRUBY) > <jflam at microsoft.com> wrote: > > -X:Interpret forces execution to always go through the DLR interpreter > rather than through the DLR compilation engine. > > > > This trades-off faster startup for decreased throughput. > > > > We have a number of different strategies that we''re exploring to improve > things: > > > > 1) Ahead of time cached pre-compilation to native x86 via ngen > > 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off > interpreting and compile the ''hot'' code paths dynamically at runtime. > > 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even > more by writing a Ruby specific interpreter and avoiding the tree transform > from the Ruby AST to DLR trees for the interpreted code paths. > > > > We really haven''t done any performance tuning of note on IronRuby so far. > We''re focusing on getting the language correct; performance will come after > we stabilize the language. > > > > > > Thanks, > > -John > > > > > >> -----Original Message----- > >> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > >> bounces at rubyforge.org] On Behalf Of Orion Edwards > >> Sent: Tuesday, October 21, 2008 11:38 PM > >> To: ironruby-core at rubyforge.org > >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > >> > >> I''m not on the same machine as earlier - the previous machine was my > >> work desktop PC running vista > >> > >> This one is running windows XP under vmware on a macbook > >> > >> Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on > >> the first) Without it I see 1.95 seconds (2.05 on the first run) > >> > >> I didn''t know about -X:Interpret... > >> So what exactly does it do differently, and if it''s so much faster, > >> why isn''t it the default? > >> > >> > >> > >> On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: > >> > >> > >> > >> Great - I have it working now on my machine. > >> > >> I''m seeing 0.45s or so as the net time (excluding startup) for the > >> tests if I run using the -X:Interpret flag. Can you try running with > >> that flag enabled on your machine and let me know how quickly it runs? > >> > >> Thanks, > >> -John > >> > >> From: ironruby-core-bounces at rubyforge.org > >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > >> Sent: Tuesday, October 21, 2008 11:07 PM > >> To: ironruby-core at rubyforge.org > >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > >> > >> Sure. Here''s the entire contents of the ruby file > >> > >> $LOAD_PATH << ''c:/dev/rspec/lib'' > >> > >> require ''spec'' > >> > >> module ActiveSupport; end # workaround ironruby defined? bug > >> > >> class Vehicle > >> def initialize(people) > >> @people = people > >> end > >> attr_accessor :people > >> end > >> > >> describe Vehicle do > >> it "should assign people using the constructor" do > >> car = Vehicle.new([''orion'', ''john'', ''jim'']) > >> car.should have(3).people > >> end > >> end > >> > >> Note I''m not using gems or anything else like that. To replicate > this > >> you''d basically do this: > >> > >> svn checkout ironruby 168 into c:\dev\ironruby > >> > >> rake compile > >> > >> git clone rspec straight from github, and stick it in c:\dev\rspec > >> > >> edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to > >> File.expand_path > >> > >> spin up a command prompt and set PATH=blahblah so it can see the > >> ironruby binaries that got build previously > >> > >> ir rspectest.rb > >> > >> > >> > >> On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: > >> > >> > >> Orion - can you supply us with your rspectest.rb file? > >> > >> I was just hacking around with rspec 1.1.9 here, and it''s blowing > up > >> with a bunch of dependencies on startup. > >> > >> Thanks, > >> -John > >> > >> From: ironruby-core-bounces at rubyforge.org > >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > >> Sent: Tuesday, October 21, 2008 7:37 PM > >> To: ironruby-core at rubyforge.org > >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > >> > >> The nested defined? bug is logged here: > >> > >> > >> http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id> >> 4 > >> 3 > >> 59&atid=16798 > >> > >> The ''caller'' one is actually 2 bugs, both of which have been > logged > >> by ben hall already > >> > >> > >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > >> > >> 2 > >> 2315 > >> > >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > >> > >> 2 > >> 2348 > >> > >> For those interested in running rspec right now, a better fix is > to > >> replace line 26 of main.rb with > >> args.last[:spec_path] = File.expand_path( > >> caller(0)[1].split('':'').first ) > >> > >> This will only cause rspec to lose the line number - you also have > to > >> run ir with the -D flag, or it doesn''t include the path at all. > >> > >> As far as my quick-hack investigation shows me, rspec only uses > this > >> data for showing friendly error messages, rather than any core logic, > >> so perhaps it''s not super-critical. > >> It would be nice to run it unpatched tho, IronRuby is looking > >> incredibly close to doing that :-) > >> > >> > >> Jim Deville wrote: > >> I''ll add a rake task to compile release. Can you try to isolate > those > >> cases and file bugs? The second one is pretty easy, but I''d like to > >> have tracking on both of them. > >> > >> From: ironruby-core-bounces at rubyforge.org > >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > >> Sent: Tuesday, October 21, 2008 7:04 PM > >> To: ironruby-core at rubyforge.org > >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > >> > >> I just ran rspec 1.1.9 (straight from github) on IronRuby build > 167, > >> and it appears to work (I only have a simple test, but hey). > >> > >> I only had to make 2 changes: > >> > >> rspec\lib\spec\extensions\main.rb:26 is > >> args.last[:spec_path] = File.expand_path(caller(0)[1]) > >> IronRuby still doesn''t seem to handle caller quite the same as > MRI. I > >> have no idea what that code is for, but I replaced it with this as a > >> quick hack > >> args.last[:spec_path] = "." > >> > >> and it seemed to work. > >> > >> I encountered another problem using the ''have'' matcher - rspec > does > >> this > >> if inflector = (defined?(ActiveSupport::Inflector) ? > >> ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > >> IronRuby throws uninitialized constant Object::ActiveSupport, > whereas > >> MRI just returns nil - it looks like IR isn''t handling defined? > >> on nested things properly yet. > >> > >> To work around this I just put > >> module ActiveSupport; end > >> at the top of my ruby file to get around the nested module issue. > >> > >> And presto! > >> C:\development\irtest>ir rspectest.rb > >> . > >> > >> Finished in 2.072133 seconds > >> > >> 1 example, 0 failures > >> > >> C:\development\irtest>ruby rspectest.rb > >> . > >> > >> Finished in 0.053 seconds > >> > >> 1 example, 0 failures > >> > >> The only problem now is that 2.07 seconds is somewhat larger than > >> 0.053... I am using the debug build of ir though, as that''s what > >> rake:compile seems to give me. > >> > >> Just playing with VS now to see if I can build a release version > and > >> try that > >> > >> Ben Hall wrote: > >> Hi, > >> > >> To get rspec to work you will need to modify the actual Ironruby > >> source. I''ve raised bugs to get the changes required fixed, > however > >> I > >> did this based on 1.1.4, I think Cucumber will have a whole load > more > >> bugs attached as it has more dependencies. > >> > >> I know for a fact you won''t be able to run Cucumber unmodified due > to > >> existing bugs around gems. (for example, gem needing .rb at the > end > >> of the file to be able to find it) > >> > >> However, I haven''t had chance to take a closer look. > >> > >> Ben > >> > >> > >> > >> On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > >> <curth at microsoft.com> <mailto:curth at microsoft.com> wrote: > >> > >> > >> If you explicitly set the GEM_PATH before requiring gems, > you should > >> be able to use gems that are already present. I haven''t tried any > >> other gem operations. > >> > >> I assume you''re running with the latest source? > >> > >> -----Original Message----- > >> From: ironruby-core-bounces at rubyforge.org > >> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon > >> Sent: Friday, October 17, 2008 1:30 AM > >> To: ironruby-core at rubyforge.org > >> Subject: [Ironruby-core] Cucumber / RSpec Story Runner > >> > >> Has anyone tried to get Cucumber (or it''s predecessor: > >> the RSpec story > >> runner) to work with IronRuby? I have not had any luck > thus far (I > >> am > >> extremely new to Ruby), and I would really like to be able > to use > >> Cucumber to write executable feature documentation for my > .NET code. > >> > >> http://github.com/aslakhellesoy/cucumber/wikis > >> > >> I copied it under the "lib" directory, as well as several > of its > >> dependencies, but when I try to do "require > >> ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) > fails with a > >> stack > >> overflow. The same thing happens when I try to require > some its > >> dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" > >> and "require > >> ''rake-0.8.3/lib/rake''"), but some work just fine (eg. > >> "require > >> ''polyglot-0.2.3/lib/polyglot''" and "require > >> ''treetop-1.2.4/lib/treetop''"). > >> > >> I also tried to get gem working to aide me in this > process, but I > >> had > >> problems with that too. Has anyone got gem working with > IronRuby? > >> > >> Thanks in advance! > >> Pat Gannon > >> -- > >> 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 > >> > >> > >> -- > >> Orion Edwards > >> Web Application Developer > >> > >> T: +64 7 859 2120 > >> F: +64 7 859 2320 > >> E: orion.edwards at open2view.com > >> <mailto:orion.edwards at open2view.com> > >> > >> Open2view.com > >> The Real Estate Website > >> > >> <image001.jpg> > >> > >> > >> ________________________________ > >> > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Ironruby-core mailing list > >> Ironruby-core at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > >> > >> -- > >> Orion Edwards > >> Web Application Developer > >> > >> T: +64 7 859 2120 > >> F: +64 7 859 2320 > >> E: orion.edwards at open2view.com > >> <mailto:orion.edwards at open2view.com> > >> > >> Open2view.com > >> The Real Estate Website > >> > >> <image001.jpg> > >> _______________________________________________ > >> 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: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/a310cfc5/attachment-0001.html>
I?ve attached an adapter against MSSQL that I use for testing. This adapter is buggy and incomplete and was cobbled together from many sources. Absolutely nothing about it is guaranteed, but someone may find some use in it. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Wednesday, October 22, 2008 1:08 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner I''ll try cucumber tonight when i get home. I''m trying to build a little rails app with rspec etc. What''s the status on a .NET based active record adapter? I''ve been thinking that it might be necessary to write an adapter that creates the correct .NET provider and dispatches the calls through that layer. Either as a part of ruby-dbd or as adapters to ActiveRecord.. dbd gives the advantage that you can use it everywhere then. any thoughts? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Wed, Oct 22, 2008 at 9:56 AM, Ben Hall <ben2004uk at googlemail.com<mailto:ben2004uk at googlemail.com>> wrote: Nice work guys!! Pleased that I won''t be having to use a hacked version of r156 :) One of the problems you mentioned (pretty errors due to backtrace) will cause the story runner in 1.1.4 to blow up and throw an exception, but as that is now Cucumber I don''t know if we will have the same issues. Have you tried Cucumber yet? Ben On Wed, Oct 22, 2008 at 8:01 AM, John Lam (IRONRUBY) <jflam at microsoft.com<mailto:jflam at microsoft.com>> wrote:> -X:Interpret forces execution to always go through the DLR interpreter rather than through the DLR compilation engine. > > This trades-off faster startup for decreased throughput. > > We have a number of different strategies that we''re exploring to improve things: > > 1) Ahead of time cached pre-compilation to native x86 via ngen > 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off interpreting and compile the ''hot'' code paths dynamically at runtime. > 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even more by writing a Ruby specific interpreter and avoiding the tree transform from the Ruby AST to DLR trees for the interpreted code paths. > > We really haven''t done any performance tuning of note on IronRuby so far. We''re focusing on getting the language correct; performance will come after we stabilize the language. > > > Thanks, > -John > > >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-<mailto:ironruby-core-> >> bounces at rubyforge.org<mailto:bounces at rubyforge.org>] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 11:38 PM >> To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> I''m not on the same machine as earlier - the previous machine was my >> work desktop PC running vista >> >> This one is running windows XP under vmware on a macbook >> >> Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on >> the first) Without it I see 1.95 seconds (2.05 on the first run) >> >> I didn''t know about -X:Interpret... >> So what exactly does it do differently, and if it''s so much faster, >> why isn''t it the default? >> >> >> >> On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: >> >> >> >> Great - I have it working now on my machine. >> >> I''m seeing 0.45s or so as the net time (excluding startup) for the >> tests if I run using the -X:Interpret flag. Can you try running with >> that flag enabled on your machine and let me know how quickly it runs? >> >> Thanks, >> -John >> >> From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> >> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 11:07 PM >> To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> Sure. Here''s the entire contents of the ruby file >> >> $LOAD_PATH << ''c:/dev/rspec/lib'' >> >> require ''spec'' >> >> module ActiveSupport; end # workaround ironruby defined? bug >> >> class Vehicle >> def initialize(people) >> @people = people >> end >> attr_accessor :people >> end >> >> describe Vehicle do >> it "should assign people using the constructor" do >> car = Vehicle.new([''orion'', ''john'', ''jim'']) >> car.should have(3).people >> end >> end >> >> Note I''m not using gems or anything else like that. To replicate this >> you''d basically do this: >> >> svn checkout ironruby 168 into c:\dev\ironruby >> >> rake compile >> >> git clone rspec straight from github, and stick it in c:\dev\rspec >> >> edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to >> File.expand_path >> >> spin up a command prompt and set PATH=blahblah so it can see the >> ironruby binaries that got build previously >> >> ir rspectest.rb >> >> >> >> On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: >> >> >> Orion - can you supply us with your rspectest.rb file? >> >> I was just hacking around with rspec 1.1.9 here, and it''s blowing up >> with a bunch of dependencies on startup. >> >> Thanks, >> -John >> >> From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> >> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 7:37 PM >> To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> The nested defined? bug is logged here: >> >> >> http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id>> 4 >> 3 >> 59&atid=16798 >> >> The ''caller'' one is actually 2 bugs, both of which have been logged >> by ben hall already >> >> >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >> >> 2 >> 2315 >> >> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >> >> 2 >> 2348 >> >> For those interested in running rspec right now, a better fix is to >> replace line 26 of main.rb with >> args.last[:spec_path] = File.expand_path( >> caller(0)[1].split('':'').first ) >> >> This will only cause rspec to lose the line number - you also have to >> run ir with the -D flag, or it doesn''t include the path at all. >> >> As far as my quick-hack investigation shows me, rspec only uses this >> data for showing friendly error messages, rather than any core logic, >> so perhaps it''s not super-critical. >> It would be nice to run it unpatched tho, IronRuby is looking >> incredibly close to doing that :-) >> >> >> Jim Deville wrote: >> I''ll add a rake task to compile release. Can you try to isolate those >> cases and file bugs? The second one is pretty easy, but I''d like to >> have tracking on both of them. >> >> From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> >> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Orion Edwards >> Sent: Tuesday, October 21, 2008 7:04 PM >> To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> >> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >> >> I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, >> and it appears to work (I only have a simple test, but hey). >> >> I only had to make 2 changes: >> >> rspec\lib\spec\extensions\main.rb:26 is >> args.last[:spec_path] = File.expand_path(caller(0)[1]) >> IronRuby still doesn''t seem to handle caller quite the same as MRI. I >> have no idea what that code is for, but I replaced it with this as a >> quick hack >> args.last[:spec_path] = "." >> >> and it seemed to work. >> >> I encountered another problem using the ''have'' matcher - rspec does >> this >> if inflector = (defined?(ActiveSupport::Inflector) ? >> ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) >> IronRuby throws uninitialized constant Object::ActiveSupport, whereas >> MRI just returns nil - it looks like IR isn''t handling defined? >> on nested things properly yet. >> >> To work around this I just put >> module ActiveSupport; end >> at the top of my ruby file to get around the nested module issue. >> >> And presto! >> C:\development\irtest>ir rspectest.rb >> . >> >> Finished in 2.072133 seconds >> >> 1 example, 0 failures >> >> C:\development\irtest>ruby rspectest.rb >> . >> >> Finished in 0.053 seconds >> >> 1 example, 0 failures >> >> The only problem now is that 2.07 seconds is somewhat larger than >> 0.053... I am using the debug build of ir though, as that''s what >> rake:compile seems to give me. >> >> Just playing with VS now to see if I can build a release version and >> try that >> >> Ben Hall wrote: >> Hi, >> >> To get rspec to work you will need to modify the actual Ironruby >> source. I''ve raised bugs to get the changes required fixed, however >> I >> did this based on 1.1.4, I think Cucumber will have a whole load more >> bugs attached as it has more dependencies. >> >> I know for a fact you won''t be able to run Cucumber unmodified due to >> existing bugs around gems. (for example, gem needing .rb at the end >> of the file to be able to find it) >> >> However, I haven''t had chance to take a closer look. >> >> Ben >> >> >> >> On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher >> <curth at microsoft.com<mailto:curth at microsoft.com>> <mailto:curth at microsoft.com<mailto:curth at microsoft.com>> wrote: >> >> >> If you explicitly set the GEM_PATH before requiring gems, you should >> be able to use gems that are already present. I haven''t tried any >> other gem operations. >> >> I assume you''re running with the latest source? >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> >> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Pat Gannon >> Sent: Friday, October 17, 2008 1:30 AM >> To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> >> Subject: [Ironruby-core] Cucumber / RSpec Story Runner >> >> Has anyone tried to get Cucumber (or it''s predecessor: >> the RSpec story >> runner) to work with IronRuby? I have not had any luck thus far (I >> am >> extremely new to Ruby), and I would really like to be able to use >> Cucumber to write executable feature documentation for my .NET code. >> >> http://github.com/aslakhellesoy/cucumber/wikis >> >> I copied it under the "lib" directory, as well as several of its >> dependencies, but when I try to do "require >> ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails with a >> stack >> overflow. The same thing happens when I try to require some its >> dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" >> and "require >> ''rake-0.8.3/lib/rake''"), but some work just fine (eg. >> "require >> ''polyglot-0.2.3/lib/polyglot''" and "require >> ''treetop-1.2.4/lib/treetop''"). >> >> I also tried to get gem working to aide me in this process, but I >> had >> problems with that too. Has anyone got gem working with IronRuby? >> >> Thanks in advance! >> Pat Gannon >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> -- >> Orion Edwards >> Web Application Developer >> >> T: +64 7 859 2120 >> F: +64 7 859 2320 >> E: orion.edwards at open2view.com<mailto:orion.edwards at open2view.com> >> <mailto:orion.edwards at open2view.com<mailto:orion.edwards at open2view.com>> >> >> Open2view.com >> The Real Estate Website >> >> <image001.jpg> >> >> >> ________________________________ >> >> >> >> >> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> -- >> Orion Edwards >> Web Application Developer >> >> T: +64 7 859 2120 >> F: +64 7 859 2320 >> E: orion.edwards at open2view.com<mailto:orion.edwards at open2view.com> >> <mailto:orion.edwards at open2view.com<mailto:orion.edwards at open2view.com>> >> >> Open2view.com >> The Real Estate Website >> >> <image001.jpg> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core >_______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/c986cf36/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: mssql_adapter.rb Type: application/octet-stream Size: 17245 bytes Desc: mssql_adapter.rb URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081022/c986cf36/attachment-0001.obj>
Oh, I remember I had problems with cucumber due to require needing to have .rb on the end (http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=20167). For example, this line - load ''cucumber'' E:\IronRuby\r156\src\IronRuby.Libraries\Builtins\KernelOps.cs:380:in `load'': no such file to load -- cucumber (LoadError ) from :0 Command I was using was: E:\IronRuby\r156\build\debug>ir "c:\ruby\bin\cucumber" -r "E:\IronRuby\r156\cucumber\examples\calculator\features\steps\ calculator_steps.rb" "E:\IronRuby\r156\cucumber\examples\calculator\features\addition.feature" I made a change (load ''cucumber.rb''), but now i''m getting You must gem install win32console to get coloured output on this ruby platform (i386-mswin32) but no output :( I guess I need to do something else.... On Wed, Oct 22, 2008 at 5:21 PM, Curt Hagenlocher <curth at microsoft.com> wrote:> I''ve attached an adapter against MSSQL that I use for testing. This adapter > is buggy and incomplete and was cobbled together from many sources. > Absolutely nothing about it is guaranteed, but someone may find some use in > it. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero > Sent: Wednesday, October 22, 2008 1:08 AM > > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > > > > I''ll try cucumber tonight when i get home. > I''m trying to build a little rails app with rspec etc. > > What''s the status on a .NET based active record adapter? > I''ve been thinking that it might be necessary to write an adapter that > creates the correct .NET provider and dispatches the calls through that > layer. > Either as a part of ruby-dbd or as adapters to ActiveRecord.. > dbd gives the advantage that you can use it everywhere then. > > any thoughts? > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > GSM: +32.486.787.582 > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > > > On Wed, Oct 22, 2008 at 9:56 AM, Ben Hall <ben2004uk at googlemail.com> wrote: > > Nice work guys!! Pleased that I won''t be having to use a hacked > version of r156 :) > > One of the problems you mentioned (pretty errors due to backtrace) > will cause the story runner in 1.1.4 to blow up and throw an > exception, but as that is now Cucumber I don''t know if we will have > the same issues. Have you tried Cucumber yet? > > > Ben > > > > On Wed, Oct 22, 2008 at 8:01 AM, John Lam (IRONRUBY) > <jflam at microsoft.com> wrote: >> -X:Interpret forces execution to always go through the DLR interpreter >> rather than through the DLR compilation engine. >> >> This trades-off faster startup for decreased throughput. >> >> We have a number of different strategies that we''re exploring to improve >> things: >> >> 1) Ahead of time cached pre-compilation to native x86 via ngen >> 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off >> interpreting and compile the ''hot'' code paths dynamically at runtime. >> 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even >> more by writing a Ruby specific interpreter and avoiding the tree transform >> from the Ruby AST to DLR trees for the interpreted code paths. >> >> We really haven''t done any performance tuning of note on IronRuby so far. >> We''re focusing on getting the language correct; performance will come after >> we stabilize the language. >> >> >> Thanks, >> -John >> >> >>> -----Original Message----- >>> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- >>> bounces at rubyforge.org] On Behalf Of Orion Edwards >>> Sent: Tuesday, October 21, 2008 11:38 PM >>> To: ironruby-core at rubyforge.org >>> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >>> >>> I''m not on the same machine as earlier - the previous machine was my >>> work desktop PC running vista >>> >>> This one is running windows XP under vmware on a macbook >>> >>> Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on >>> the first) Without it I see 1.95 seconds (2.05 on the first run) >>> >>> I didn''t know about -X:Interpret... >>> So what exactly does it do differently, and if it''s so much faster, >>> why isn''t it the default? >>> >>> >>> >>> On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: >>> >>> >>> >>> Great - I have it working now on my machine. >>> >>> I''m seeing 0.45s or so as the net time (excluding startup) for the >>> tests if I run using the -X:Interpret flag. Can you try running with >>> that flag enabled on your machine and let me know how quickly it runs? >>> >>> Thanks, >>> -John >>> >>> From: ironruby-core-bounces at rubyforge.org >>> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >>> Sent: Tuesday, October 21, 2008 11:07 PM >>> To: ironruby-core at rubyforge.org >>> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >>> >>> Sure. Here''s the entire contents of the ruby file >>> >>> $LOAD_PATH << ''c:/dev/rspec/lib'' >>> >>> require ''spec'' >>> >>> module ActiveSupport; end # workaround ironruby defined? bug >>> >>> class Vehicle >>> def initialize(people) >>> @people = people >>> end >>> attr_accessor :people >>> end >>> >>> describe Vehicle do >>> it "should assign people using the constructor" do >>> car = Vehicle.new([''orion'', ''john'', ''jim'']) >>> car.should have(3).people >>> end >>> end >>> >>> Note I''m not using gems or anything else like that. To replicate >>> this >>> you''d basically do this: >>> >>> svn checkout ironruby 168 into c:\dev\ironruby >>> >>> rake compile >>> >>> git clone rspec straight from github, and stick it in c:\dev\rspec >>> >>> edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to >>> File.expand_path >>> >>> spin up a command prompt and set PATH=blahblah so it can see the >>> ironruby binaries that got build previously >>> >>> ir rspectest.rb >>> >>> >>> >>> On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: >>> >>> >>> Orion - can you supply us with your rspectest.rb file? >>> >>> I was just hacking around with rspec 1.1.9 here, and it''s blowing >>> up >>> with a bunch of dependencies on startup. >>> >>> Thanks, >>> -John >>> >>> From: ironruby-core-bounces at rubyforge.org >>> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >>> Sent: Tuesday, October 21, 2008 7:37 PM >>> To: ironruby-core at rubyforge.org >>> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >>> >>> The nested defined? bug is logged here: >>> >>> >>> http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id>>> 4 >>> 3 >>> 59&atid=16798 >>> >>> The ''caller'' one is actually 2 bugs, both of which have been logged >>> by ben hall already >>> >>> >>> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >>> >>> 2 >>> 2315 >>> >>> http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid >>> >>> 2 >>> 2348 >>> >>> For those interested in running rspec right now, a better fix is to >>> replace line 26 of main.rb with >>> args.last[:spec_path] = File.expand_path( >>> caller(0)[1].split('':'').first ) >>> >>> This will only cause rspec to lose the line number - you also have >>> to >>> run ir with the -D flag, or it doesn''t include the path at all. >>> >>> As far as my quick-hack investigation shows me, rspec only uses >>> this >>> data for showing friendly error messages, rather than any core logic, >>> so perhaps it''s not super-critical. >>> It would be nice to run it unpatched tho, IronRuby is looking >>> incredibly close to doing that :-) >>> >>> >>> Jim Deville wrote: >>> I''ll add a rake task to compile release. Can you try to isolate >>> those >>> cases and file bugs? The second one is pretty easy, but I''d like to >>> have tracking on both of them. >>> >>> From: ironruby-core-bounces at rubyforge.org >>> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards >>> Sent: Tuesday, October 21, 2008 7:04 PM >>> To: ironruby-core at rubyforge.org >>> Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner >>> >>> I just ran rspec 1.1.9 (straight from github) on IronRuby build >>> 167, >>> and it appears to work (I only have a simple test, but hey). >>> >>> I only had to make 2 changes: >>> >>> rspec\lib\spec\extensions\main.rb:26 is >>> args.last[:spec_path] = File.expand_path(caller(0)[1]) >>> IronRuby still doesn''t seem to handle caller quite the same as MRI. >>> I >>> have no idea what that code is for, but I replaced it with this as a >>> quick hack >>> args.last[:spec_path] = "." >>> >>> and it seemed to work. >>> >>> I encountered another problem using the ''have'' matcher - rspec does >>> this >>> if inflector = (defined?(ActiveSupport::Inflector) ? >>> ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) >>> IronRuby throws uninitialized constant Object::ActiveSupport, >>> whereas >>> MRI just returns nil - it looks like IR isn''t handling defined? >>> on nested things properly yet. >>> >>> To work around this I just put >>> module ActiveSupport; end >>> at the top of my ruby file to get around the nested module issue. >>> >>> And presto! >>> C:\development\irtest>ir rspectest.rb >>> . >>> >>> Finished in 2.072133 seconds >>> >>> 1 example, 0 failures >>> >>> C:\development\irtest>ruby rspectest.rb >>> . >>> >>> Finished in 0.053 seconds >>> >>> 1 example, 0 failures >>> >>> The only problem now is that 2.07 seconds is somewhat larger than >>> 0.053... I am using the debug build of ir though, as that''s what >>> rake:compile seems to give me. >>> >>> Just playing with VS now to see if I can build a release version >>> and >>> try that >>> >>> Ben Hall wrote: >>> Hi, >>> >>> To get rspec to work you will need to modify the actual Ironruby >>> source. I''ve raised bugs to get the changes required fixed, >>> however >>> I >>> did this based on 1.1.4, I think Cucumber will have a whole load >>> more >>> bugs attached as it has more dependencies. >>> >>> I know for a fact you won''t be able to run Cucumber unmodified due >>> to >>> existing bugs around gems. (for example, gem needing .rb at the >>> end >>> of the file to be able to find it) >>> >>> However, I haven''t had chance to take a closer look. >>> >>> Ben >>> >>> >>> >>> On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher >>> <curth at microsoft.com> <mailto:curth at microsoft.com> wrote: >>> >>> >>> If you explicitly set the GEM_PATH before requiring gems, >>> you should >>> be able to use gems that are already present. I haven''t tried any >>> other gem operations. >>> >>> I assume you''re running with the latest source? >>> >>> -----Original Message----- >>> From: ironruby-core-bounces at rubyforge.org >>> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon >>> Sent: Friday, October 17, 2008 1:30 AM >>> To: ironruby-core at rubyforge.org >>> Subject: [Ironruby-core] Cucumber / RSpec Story Runner >>> >>> Has anyone tried to get Cucumber (or it''s predecessor: >>> the RSpec story >>> runner) to work with IronRuby? I have not had any luck >>> thus far (I >>> am >>> extremely new to Ruby), and I would really like to be able >>> to use >>> Cucumber to write executable feature documentation for my >>> .NET code. >>> >>> http://github.com/aslakhellesoy/cucumber/wikis >>> >>> I copied it under the "lib" directory, as well as several >>> of its >>> dependencies, but when I try to do "require >>> ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails >>> with a >>> stack >>> overflow. The same thing happens when I try to require >>> some its >>> dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" >>> and "require >>> ''rake-0.8.3/lib/rake''"), but some work just fine (eg. >>> "require >>> ''polyglot-0.2.3/lib/polyglot''" and "require >>> ''treetop-1.2.4/lib/treetop''"). >>> >>> I also tried to get gem working to aide me in this process, >>> but I >>> had >>> problems with that too. Has anyone got gem working with >>> IronRuby? >>> >>> Thanks in advance! >>> Pat Gannon >>> -- >>> 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 >>> >>> >>> -- >>> Orion Edwards >>> Web Application Developer >>> >>> T: +64 7 859 2120 >>> F: +64 7 859 2320 >>> E: orion.edwards at open2view.com >>> <mailto:orion.edwards at open2view.com> >>> >>> Open2view.com >>> The Real Estate Website >>> >>> <image001.jpg> >>> >>> >>> ________________________________ >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Ironruby-core mailing list >>> Ironruby-core at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >>> >>> -- >>> Orion Edwards >>> Web Application Developer >>> >>> T: +64 7 859 2120 >>> F: +64 7 859 2320 >>> E: orion.edwards at open2view.com >>> <mailto:orion.edwards at open2view.com> >>> >>> Open2view.com >>> The Real Estate Website >>> >>> <image001.jpg> >>> _______________________________________________ >>> 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 > >
An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081023/ec68b648/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.jpg Type: image/jpeg Size: 8147 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081023/ec68b648/attachment-0001.jpg>
Well, this is how Cucumber has implement the code, as such there must be something different. Something is happening, i''m just not sure what, but there is a problem still with IronRuby. The file i''m looking at is "c:\ruby\bin\cucumber" - maybe its different due to rubygems... Without it, i''m not sure how else to run Cucumber. For example, this also fails to output anything: E:\IronRuby\r156\build\debug>ir "c:\ruby\bin\cucumber" --help This also fails: E:\IronRuby\r156\build\debug>ir "C:\ruby\lib\ruby\gems\1.8\gems\cucumber-0.1.8\lib\cucumber.rb" --help ir "c:/ruby/bin/cucumber" --help However, this works: C:/Ruby/bin/ruby.exe "c:/ruby/bin/cucumber" --help On Wed, Oct 22, 2008 at 8:56 PM, Orion Edwards <orion.edwards at open2view.com> wrote:> load always needs the .rb on the end (in MRI as well as IronRuby). > It looks like you should be using require instead - require is not at all > the same thing as load > > Currently with IronRuby SVN r167 this happens: > > There is a file called ''mylib.rb'' in the current directory > > require ''mylib'' # works in both IR and MRI > require ''mylib.rb'' # works in both IR and MRI > load ''mylib.rb'' # works in both IR and MRI > load ''mylib'' # works in neither IR or MRI - it''s not supposed to > > Looks all correct to me... Maybe time to close that bug? > > Ben Hall wrote: > > Oh, I remember I had problems with cucumber due to require needing to > have .rb on the end > (http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid=20167). > For example, this line - load ''cucumber'' > E:\IronRuby\r156\src\IronRuby.Libraries\Builtins\KernelOps.cs:380:in > `load'': no such file to load -- cucumber (LoadError > ) > from :0 > Command I was using was: E:\IronRuby\r156\build\debug>ir > "c:\ruby\bin\cucumber" -r > "E:\IronRuby\r156\cucumber\examples\calculator\features\steps\ > calculator_steps.rb" > "E:\IronRuby\r156\cucumber\examples\calculator\features\addition.feature" > I made a change (load ''cucumber.rb''), but now i''m getting You must gem > install win32console to get coloured output on this ruby platform > (i386-mswin32) but no output :( I guess I need to do something > else.... > On Wed, Oct 22, 2008 at 5:21 PM, Curt Hagenlocher <curth at microsoft.com> > wrote: > > > I''ve attached an adapter against MSSQL that I use for testing. This adapter > is buggy and incomplete and was cobbled together from many sources. > Absolutely nothing about it is guaranteed, but someone may find some use in > it. > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero > Sent: Wednesday, October 22, 2008 1:08 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > I''ll try cucumber tonight when i get home. > I''m trying to build a little rails app with rspec etc. > What''s the status on a .NET based active record adapter? > I''ve been thinking that it might be necessary to write an adapter that > creates the correct .NET provider and dispatches the calls through that > layer. > Either as a part of ruby-dbd or as adapters to ActiveRecord.. > dbd gives the advantage that you can use it everywhere then. > any thoughts? > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > GSM: +32.486.787.582 > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > On Wed, Oct 22, 2008 at 9:56 AM, Ben Hall <ben2004uk at googlemail.com> wrote: > Nice work guys!! Pleased that I won''t be having to use a hacked > version of r156 :) > One of the problems you mentioned (pretty errors due to backtrace) > will cause the story runner in 1.1.4 to blow up and throw an > exception, but as that is now Cucumber I don''t know if we will have > the same issues. Have you tried Cucumber yet? > Ben > On Wed, Oct 22, 2008 at 8:01 AM, John Lam (IRONRUBY) > <jflam at microsoft.com> wrote: > > > -X:Interpret forces execution to always go through the DLR interpreter > rather than through the DLR compilation engine. > This trades-off faster startup for decreased throughput. > We have a number of different strategies that we''re exploring to improve > things: > 1) Ahead of time cached pre-compilation to native x86 via ngen > 2) Mixed mode DLR interpreter and DLR compiler. We''ll start off > interpreting and compile the ''hot'' code paths dynamically at runtime. > 3) Mixed mode Ruby interpreter and DLR compiler. We can improve perf even > more by writing a Ruby specific interpreter and avoiding the tree transform > from the Ruby AST to DLR trees for the interpreted code paths. > We really haven''t done any performance tuning of note on IronRuby so far. > We''re focusing on getting the language correct; performance will come after > we stabilize the language. > Thanks, > -John > > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 11:38 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > I''m not on the same machine as earlier - the previous machine was my > work desktop PC running vista > This one is running windows XP under vmware on a macbook > Running with -X:Interpret I see 0.78 seconds on repeated runs (0.79 on > the first) Without it I see 1.95 seconds (2.05 on the first run) > I didn''t know about -X:Interpret... > So what exactly does it do differently, and if it''s so much faster, > why isn''t it the default? > On 22/10/2008, at 7:21 PM, John Lam (IRONRUBY) wrote: > Great - I have it working now on my machine. > I''m seeing 0.45s or so as the net time (excluding startup) for the > tests if I run using the -X:Interpret flag. Can you try running with > that flag enabled on your machine and let me know how quickly it runs? > Thanks, > -John > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 11:07 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > Sure. Here''s the entire contents of the ruby file > $LOAD_PATH << ''c:/dev/rspec/lib'' > require ''spec'' > module ActiveSupport; end # workaround ironruby defined? bug > class Vehicle > def initialize(people) > @people = people > end > attr_accessor :people > end > describe Vehicle do > it "should assign people using the constructor" do > car = Vehicle.new([''orion'', ''john'', ''jim'']) > car.should have(3).people > end > end > Note I''m not using gems or anything else like that. To replicate > this > you''d basically do this: > svn checkout ironruby 168 into c:\dev\ironruby > rake compile > git clone rspec straight from github, and stick it in c:\dev\rspec > edit c:\dev\rspec\lib\spec\extensions\main.rb and fix the call to > File.expand_path > spin up a command prompt and set PATH=blahblah so it can see the > ironruby binaries that got build previously > ir rspectest.rb > On 22/10/2008, at 6:40 PM, John Lam (IRONRUBY) wrote: > Orion - can you supply us with your rspectest.rb file? > I was just hacking around with rspec 1.1.9 here, and it''s blowing > up > with a bunch of dependencies on startup. > Thanks, > -John > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:37 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > The nested defined? bug is logged here: > http://rubyforge.org/tracker/index.php?func=detail&aid=22503&group_id> 4 > 3 > 59&atid=16798 > The ''caller'' one is actually 2 bugs, both of which have been logged > by ben hall already > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > > 2 > 2315 > http://rubyforge.org/tracker/?group_id=4359&atid=16798&func=detail&aid > > 2 > 2348 > For those interested in running rspec right now, a better fix is to > replace line 26 of main.rb with > args.last[:spec_path] = File.expand_path( > caller(0)[1].split('':'').first ) > This will only cause rspec to lose the line number - you also have > to > run ir with the -D flag, or it doesn''t include the path at all. > As far as my quick-hack investigation shows me, rspec only uses > this > data for showing friendly error messages, rather than any core logic, > so perhaps it''s not super-critical. > It would be nice to run it unpatched tho, IronRuby is looking > incredibly close to doing that :-) > Jim Deville wrote: > I''ll add a rake task to compile release. Can you try to isolate > those > cases and file bugs? The second one is pretty easy, but I''d like to > have tracking on both of them. > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, October 21, 2008 7:04 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner > I just ran rspec 1.1.9 (straight from github) on IronRuby build > 167, > and it appears to work (I only have a simple test, but hey). > I only had to make 2 changes: > rspec\lib\spec\extensions\main.rb:26 is > args.last[:spec_path] = File.expand_path(caller(0)[1]) > IronRuby still doesn''t seem to handle caller quite the same as MRI. > I > have no idea what that code is for, but I replaced it with this as a > quick hack > args.last[:spec_path] = "." > and it seemed to work. > I encountered another problem using the ''have'' matcher - rspec does > this > if inflector = (defined?(ActiveSupport::Inflector) ? > ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil)) > IronRuby throws uninitialized constant Object::ActiveSupport, > whereas > MRI just returns nil - it looks like IR isn''t handling defined? > on nested things properly yet. > To work around this I just put > module ActiveSupport; end > at the top of my ruby file to get around the nested module issue. > And presto! > C:\development\irtest>ir rspectest.rb > . > Finished in 2.072133 seconds > 1 example, 0 failures > C:\development\irtest>ruby rspectest.rb > . > Finished in 0.053 seconds > 1 example, 0 failures > The only problem now is that 2.07 seconds is somewhat larger than > 0.053... I am using the debug build of ir though, as that''s what > rake:compile seems to give me. > Just playing with VS now to see if I can build a release version > and > try that > Ben Hall wrote: > Hi, > To get rspec to work you will need to modify the actual Ironruby > source. I''ve raised bugs to get the changes required fixed, > however > I > did this based on 1.1.4, I think Cucumber will have a whole load > more > bugs attached as it has more dependencies. > I know for a fact you won''t be able to run Cucumber unmodified due > to > existing bugs around gems. (for example, gem needing .rb at the > end > of the file to be able to find it) > However, I haven''t had chance to take a closer look. > Ben > On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher > <curth at microsoft.com> <mailto:curth at microsoft.com> wrote: > If you explicitly set the GEM_PATH before requiring gems, > you should > be able to use gems that are already present. I haven''t tried any > other gem operations. > I assume you''re running with the latest source? > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon > Sent: Friday, October 17, 2008 1:30 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Cucumber / RSpec Story Runner > Has anyone tried to get Cucumber (or it''s predecessor: > the RSpec story > runner) to work with IronRuby? I have not had any luck > thus far (I > am > extremely new to Ruby), and I would really like to be able > to use > Cucumber to write executable feature documentation for my > .NET code. > http://github.com/aslakhellesoy/cucumber/wikis > I copied it under the "lib" directory, as well as several > of its > dependencies, but when I try to do "require > ''cucumber-0.1.7/lib/cucumber''", ir (interactive ruby) fails > with a > stack > overflow. The same thing happens when I try to require > some its > dependencies manually (eg. "require ''hoe-1.8.0/lib/hoe''" > and "require > ''rake-0.8.3/lib/rake''"), but some work just fine (eg. > "require > ''polyglot-0.2.3/lib/polyglot''" and "require > ''treetop-1.2.4/lib/treetop''"). > I also tried to get gem working to aide me in this process, > but I > had > problems with that too. Has anyone got gem working with > IronRuby? > Thanks in advance! > Pat Gannon > -- > 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 > -- > Orion Edwards > Web Application Developer > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > <mailto:orion.edwards at open2view.com> > Open2view.com > The Real Estate Website > <image001.jpg> > ________________________________ > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- > Orion Edwards > Web Application Developer > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > <mailto:orion.edwards at open2view.com> > Open2view.com > The Real Estate Website > <image001.jpg> > _______________________________________________ > 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 > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > -- > Orion Edwards > Web Application Developer > > T: +64 7 859 2120 > F: +64 7 859 2320 > E: orion.edwards at open2view.com > > Open2view.com > The Real Estate Website > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >
After a lot of experimentation and hacking, I was able to get Cucumber to work with IronRuby (mostly). I was not able to get the Cucumber output in ANSI color, but it works out fine in black and white. I also had to disable the functionality in Cucumber that prints the source file and line of code associated with each step. Finally, I had to re-wire the way expectations are propagated from specification failures. I have posted the instructions to get Cucumber working with IronRuby here: http://www.patrickgannon.net/archive/2008/10/23/bdd-style-feature-tests-using-ironruby-and-rspeccucumber.aspx Thanks, Pat Gannon -- Posted via http://www.ruby-forum.com/.