.Net<->IR Object Mapping

I had an old version (3-4 week old). After I got the latest source and
compiles it really works. Sorry for that.

Thanks!
Shay.

That should work:

[302] > rbr
IronRuby 0.5.0.0 on .NET 2.0.50727.4918
Copyright © Microsoft Corporation. All rights reserved.

require ‘fixtures.generated’
=> true

c = ClassWithMethods.new
=> ClassWithMethods

c.private_method
:0: undefined method `private_method’ for
ClassWithMethods:ClassWithMethods (NoMethodError)

c.private_methods
=> [“initialize”, “`”, “abort”, “Array”, “at_exit”, “autoload”,
“autoload?”, “binding”, “block_given?”, “caller”, “catch”, “eval”,
“exec”, “exit”, “exit!”, “fail”, “Float”, “format”, “getc”, “gets”,
“global_variables”, “initialize_copy”, “Integer”, “iterator?”, “lambda”,
“load”, “load_assembly”, “local_variables”, “loop”, “method_missing”,
“open”, “p”, “print”, “printf”, “proc”, “putc”, “puts”, “raise”, “rand”,
“remove_instance_variable”, “require”, “select”, “set_trace_func”,
“singleton_method_added”, “singleton_method_removed”,
“singleton_method_undefined”, “sleep”, “sprintf”, “String”, “system”,
“throw”, “trap”, “warn”]

c.method(:private_method)
:0:in method': undefined methodprivate_method’ for class
`ClassWithMethods’ (NameError)
from :0

exit
C:\vsl\Merlin\Main\Languages\Ruby\Tests\Interop\net
[303] > rbr “-X:PrivateBinding”
IronRuby 0.5.0.0 on .NET 2.0.50727.4918
Copyright © Microsoft Corporation. All rights reserved.

require ‘fixtures.generated’
=> true

c = ClassWithMethods.new
=> ClassWithMethods

c.private_method
=> ‘private’

c.private_methods
=> [“initialize”, “`”, “abort”, “Array”, “at_exit”, “autoload”,
“autoload?”, “binding”, “block_given?”, “caller”, “catch”, “eval”,
“exec”, “exit”, “exit!”, “fail”, “Float”, “format”, “getc”, “gets”,
“global_variables”, “initialize_copy”, “Integer”, “iterator?”, “lambda”,
“load”, “load_assembly”, “local_variables”, “loop”, “method_missing”,
“open”, “p”, “print”, “printf”, “proc”, “putc”, “puts”, “raise”, “rand”,
“remove_instance_variable”, “require”, “select”, “set_trace_func”,
“singleton_method_added”, “singleton_method_removed”,
“singleton_method_undefined”, “sleep”, “sprintf”, “String”, “system”,
“throw”, “trap”, “warn”]

c.method(:private_method)
=> #<Method: ClassWithMethods#private_method>

c.method(:private_method).call
=> ‘private’

c.method(:private_method)[]
=> ‘private’

exit
C:\vsl\Merlin\Main\Languages\Ruby\Tests\Interop\net
[304] >

If you want to try with this class, it is defined in the
fixtures.generated.dll assembly in
Merlin\Main\Languages\Ruby\Tests\Interop\net

Thanks,
JD

…there is no try

I just wrote up a blog post detailing, step by step, the process I
followed
to get Cucumber working with IronRuby. May be old hat to some of you,
but I
figured that documenting my process might help others going forward.

http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/

Thanks for the post! It will be very useful to people wanting to use it.
Mind if I put something similar on the “Real Ruby applications and
libraries” page?
http://ironruby.net/Documentation/Real_Ruby_Applications

I have comment about the last section:
SUPER IMPORTANT NOTE!
Any time you rebuild IronRuby, the C# compiler will erase the contents
of the directory C:\Development\IronRuby\Merlin\Main\Bin\Debug. This
includes the cucumber and cucumber.bat files. The only way I know to
rectify this is to igem install -–no-rdoc -–no-ri cucumber once again.
To avoid doing this, just have people create the cucumber.bat/cucumber
files in Merlin/Main/Languages/Ruby/Scripts/bin, where all the other
files like that are (rails.bat, rake.bat, etc). I believe that directory
already copies to a build’s $(TargetDir), but if not you can either just
add it to the path or make it copy.

~js

From: [email protected]
[mailto:[email protected]] On Behalf Of Will G.
Sent: Saturday, June 13, 2009 10:48 PM
To: [email protected]
Subject: Re: [Ironruby-core] Cucumber status

I just wrote up a blog post detailing, step by step, the process I
followed to get Cucumber working with IronRuby. May be old hat to some
of you, but I figured that documenting my process might help others
going forward.

http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/


Will G.
http://willgreen.mp/

My pleasure! I hope others will find the guide helpful. Pleas feel
free to link to the post and publicize it any way you see fit.

As for the cucumber executables (cucumber & cucumber.bat), or any gem
that installs executable commands, these files are installed by the
gem command, by default, in the same directory as the ruby executable.
Perhaps some combination of setting GEM_HOME and GEM_PATH could allow
them to be installed elsewhere? My RubyGems-foo is not yet advanced
enough.

I would hate for this to be a manual process for every gem install,
every time you rebuild IronRuby. I’m open to suggestions on automating
this, and ammending the post.


Will G.
http://willgreen.mp/

On Jun 14, 2009, at 2:42 PM, Jimmy S.
<[email protected]

Shri,
I am very interested in using cucumber for my .Net projects, so I’m
willing
to give it a go at porting win32console. To that end, I’ve created a git
repo for it on GitHub:
http://github.com/hotgazpacho/ironruby-win32console

Any guidance anyone can offer would be appreciated. Thanks!


Will G.
http://willgreen.mp/