[Ironruby-core] 0.9.1 regression

2009-09-30 Thread Ivan Porto Carrero
Hi I'd love to log this as a bug but I can't track down why. This is the code for a ResultFilter with IronRuby MVC class LightspeedFilter < ResultFilter def on_result_executing(context) # put before result filtering code here end def on_result_executed(context) context.controller.

[Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Eelco Henderichs
Dear users, I want to build a testscript scheduler / executer in C# that runs several Ruby scripts in sequence. For this I use IronRuby with the following constuction: ScriptRuntime runtime = Ruby.CreateRuntime(); ScriptEngine engine = runtime.GetEngine("rb"); loop through scripts: engine.Execu

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Ivan Porto Carrero
you have to require the other files it uses too in the same engine. or you can add the paths to where the scripts can be found to the $LOAD_PATHS ($:) variable. require a file: http://github.com/casualjim/ironrubymvc/blob/master/IronRubyMvc/Core/RubyEngine.cs#L279 add load paths http://github.com

[Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Aaron Clauson
Hi, Is there anyway to clear all global variables from the IronRuby script engine? For example if I define a variable in a script and execute it: $myVar = "Hello" And then execute another script in a new scriptscope but with the same ScriptEngine instance and use: global_variables.each do |v

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Ivan Porto Carrero
if (Runtime.Globals.ContainsVariable(className)) Runtime.Globals.RemoveVariable(className); --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Aaron Clauson
Ivan Porto carrero wrote: > if (Runtime.Globals.ContainsVariable(className)) > Runtime.Globals.RemoveVariable(className); > What if i don't know classname though? My application is operating in a shared environment where a large number of users are each executing their own custom scripts. Than

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Eelco Henderichs
Thanks! The require a file (containing the base) option works. But adding the path to the file containing the base class does not. Here C# reports an error that the file can not be found. Don't what's wrong here, but for know the require a file option will do the trick. -- Posted via http://www

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Mohammad Azam
Check out the code in this article: http://www.highoncoding.com/Articles/573_First_Look_at_the_IronRuby.aspx On Wed, Sep 30, 2009 at 8:17 AM, Eelco Henderichs wrote: > Dear users, > > I want to build a testscript scheduler / executer in C# that runs > several Ruby scripts in sequence. > > For thi

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Ivan Porto Carrero
Do you want to do it from ruby or from C#? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Wed, Sep 30, 2009 at 4:07 PM, Aaron Clauson wrot

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Ivan Porto Carrero
root |_ lib |_ great_class.rb |_ test |_ test_great_class.rb let's say I add root to my load path then I can reach the files in lib with require 'lib/great_class' or in test_great_class.rb you can do require File.dirname(__FILE__) + "/../lib/great_class" you are free to add the

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread CDurfee
In our application, we also found we found 'load' useful in some circumstances to force reloading of script files, since 'require' will not reload files it knows it's already loaded. -- Chuck -- Chuck Durfee Lead Software Architect, CentreSuite TSYS iSolutions, Golden Email cdur...@tsys.com

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread CDurfee
Is that thread-safe? I'd be worried about deleting entries from a collection I'm iterating through without knowing the implementation. -- Chuck Durfee Lead Software Architect, CentreSuite TSYS iSolutions, Golden Email cdur...@tsys.com Ivan Porto Carrero Sent by: ironruby-core-boun...@rub

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Tomas Matousek
If the base class is defined in file "foo.rb" and used in file "bar.rb" this should also work: engine.ExecuteFile("foo.rb"); engine.ExecuteFile("bar.rb"); Example: C:\Temp>type foo.rb class C end C:\Temp>type bar.rb class D < C end p D.ancestors C:\Temp>rbd IronRuby 0.9.1.0 on .NET 2.0.50727.4

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Tomas Matousek
Runtime.Globals actually don't contain Ruby global variables ($xxx). IronRuby publishes global modules defined by a script to this scope. IronRuby 0.9.1.0 on .NET 2.0.50727.4918 Copyright (c) Microsoft Corporation. All rights reserved. >>> class C ... end => nil >>> module D ... end => nil >>> I

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread CDurfee
Agreed. We found if we changed the definition of class C, unless we did something like 'load', it would continue to use the old definition from the first load. -- Chuck -- Chuck Durfee Lead Software Architect, CentreSuite TSYS iSolutions, Golden Email cdur...@tsys.com Tomas Matousek Se

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Jim Deville
Makes sense, that’s standard Ruby for you. JD From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of cdur...@tsys.com Sent: Wednesday, September 30, 2009 10:30 AM To: ironruby-core@rubyforge.org Cc: ironruby-core@rubyforge.org; ironruby-core-boun...@r

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Tomas Matousek
Kernel#load is very similar to ExecuteFile, so you can use either for bringing the definition up to date. Tomas From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Jim Deville Sent: Wednesday, September 30, 2009 10:35 AM To: ironruby-core@rubyforg

[Ironruby-core] FYI review: Fix for SL build

2009-09-30 Thread Shri Borde
http://github.com/shri/ironruby/commit/8674ea7f926fdd48f6652935de8081425319473d Fix to irtests.rb for changing Silverlight install folder (it has changed once again to 3.0.40818.0) ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://ruby

Re: [Ironruby-core] FYI review: Fix for SL build

2009-09-30 Thread Jimmy Schementi
Looks good -- that's definitely the right change. Maybe Dev.bat should find the Silverlight path in a similar way and save it as %SilverlightPath%, and then the Silverlight build aliases will just pick up that variable instead of hard-coding it a bunch of places? Does batch have some type of reg

Re: [Ironruby-core] FYI review: Fix for SL build

2009-09-30 Thread Shri Borde
Yup, it would have to be Ruby (or Python or powershell). This is a new machine. I just installed the internal (ITG) version of Win7. I think it came with this version of Silverlight. From: Jim Deville Sent: Wednesday, September 30, 2009 11:05 AM To: Jimmy Schementi; Shri Borde; ironruby-core@rub

Re: [Ironruby-core] FYI review: Fix for SL build

2009-09-30 Thread Jim Deville
Ruby does, so we could make a Ruby script that finds the folder, then set %SilverlightPath% to the output of that script. That might end up useful in other places too. DJ From: Jimmy Schementi Sent: Wednesday, September 30, 2009 11:01 AM To: Shri Borde; ironruby-core@rubyforge.org Cc: IronRuby

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread CDurfee
Indeed. We came to Ruby from C#, so it wasn't immediately obvious to us. Thanks! -- Chuck -- Chuck Durfee Lead Software Architect, CentreSuite TSYS iSolutions, Golden Email cdur...@tsys.com Jim Deville Sent by: ironruby-core-boun...@rubyforge.org 09/30/2009 11:38 AM Please respond to iro

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread Jim Deville
Apologies if my earlier answer was rude. I wasn’t trying to be rude, and looking at it I realize it could be taken as such. I know I appreciate hearing that people are using IronRuby on real projects, not just as a novelty language ☺ Thanks, JD From: ironruby-core-boun...@rubyforge.org [mail

Re: [Ironruby-core] calling ruby scripts from C#

2009-09-30 Thread CDurfee
No worries, I didn't read your comment as rude. I fully realize the error of my ways in not embracing Ruby earlier in my career. ;) It's just an interesting thing to keep in mind with projects like IronRuby, that people come to it with different backgrounds. It will be interesting to see what s

[Ironruby-core] [Code Review] Ruby project scripts - work items

2009-09-30 Thread Jimmy Schementi
Initial Ruby project scripts: get all closed/fixed work-items since a specific date. http://github.com/jschementi/ironruby/commit/1d6592281451e00ae42ba3aca29d8289fb1a0545 Uses Watir and Nokogiri to scrape work-items out of CodePlex's "Advanced Issues Tracker" page. The eventual goal of this lib

[Ironruby-core] Code Review: legacyfix

2009-09-30 Thread Jim Deville
tfpt review "/shelveset:legacyfix;REDMOND\jdeville" Comment : Stopgap fix to legacy tests before I rewrite the runner. This just makes the tests pass on a MERLIN_ROOT environment where the checked in Ruby is not present. legacyfix.diff Description: legacyfix.diff _

Re: [Ironruby-core] Clear ScriptEngine Global Variables

2009-09-30 Thread Aaron Clauson
Ivan Porto carrero wrote: > Do you want to do it from ruby or from C#? > --- >From C#. -- Posted via http://www.ruby-forum.com/. ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core