Amazing, now it works! :) Thank you very much Tomas!!! Bye Claudio
On Thu, May 6, 2010 at 6:31 PM, Tomas Matousek <tomas.matou...@microsoft.com > wrote: > This is almost right. You just need to split the constant lookup into 2 > parts and you should be good: > > > > require "devDept.EyeshotUltimate" > > Geometry = Object.const_get("devDept")::Geometry > > include Geometry > > o = Point3D.Origin > > puts o.x > > puts o.y > > puts o.z > > > > Tomas > > > > *From:* ironruby-core-boun...@rubyforge.org [mailto: > ironruby-core-boun...@rubyforge.org] *On Behalf Of *Claudio Maccari > *Sent:* Thursday, May 06, 2010 12:22 AM > *To:* ironruby-core@rubyforge.org > *Subject:* Re: [Ironruby-core] Lower case namespace > > > > Hi Ivan, > > > > thank you for you prompt reply > > Now my code is > > > > require "devDept.EyeshotUltimate" > > Geometry = Object.const_get("devDept::Geometry") > > include Geometry > > o = Point3D.Origin > > puts o.x > > puts o.y > > puts o.z > > > > When I run it I get this error: > > > > C:\Users\cmaccari\Desktop\ironruby-1.0\bin>ir devDept.rb > > devDept.rb:2:in `const_get': `devDept::Geometry' is not allowed as a > constant name (NameError) > > from devDept.rb:2 > > > > Any ideas > > > > On Thu, May 6, 2010 at 8:48 AM, Ivan Porto Carrero <i...@cloudslide.net> > wrote: > > you could try with: > > > > Geometry = Object.const_get("devDept::Geometry") > > include Geometry > > > > I haven't tried if this actually works though > > > > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > On Thu, May 6, 2010 at 8:38 AM, Claudio Maccari <claudio.macc...@gmail.com> > wrote: > > Hy all, > > > > I'm trying to use a 3rd party library into my app via IronRuby > > Unfortunately the root namespace of this library is lower case and I > believe this cause some problem > > This is the sample code I wish to run > > > > require "devDept.EyeshotUltimate" > > include devDept::Geometry > > o = Point3D.Origin > > puts o.x > > puts o.y > > puts o.z > > > > but the second line throws the exception > > undefined method `devDept' for main:Object (NoMethodError) > > > > I think I know why this append ( > http://ironruby.net/Documentation/.NET/Names) > > "CLR namespaces and interfaces must be capitalized as they are mapped onto > Ruby modules" > > > > Since I can't modify the 3rd party library is there a way to avoid this > error ? > > Many thanks > > claudio > > > > -- > Claudio Maccari > -------------------------------- > http://testdrivendevelopment.wordpress.com/ > http://twitter.com/scott4dev > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Claudio Maccari > -------------------------------- > http://testdrivendevelopment.wordpress.com/ > http://twitter.com/scott4dev > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > -- Claudio Maccari -------------------------------- http://testdrivendevelopment.wordpress.com/ http://twitter.com/scott4dev
_______________________________________________ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core