# Module::class\_eval

**URL:** <https://www.ruby-forum.com/t/module-class-eval/135602>\
**Category:** IronRuby\
**Created:** [April 23, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/module-class-eval/135602 "2008-04-23T15:02:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [April 23, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/module-class-eval/135602/1 "2008-04-23T15:02:13Z")

</div>

What’s the story with ModuleOps.Evaluate(CodeContext, RubyModule,  
MutableString) ?

I could get the previous version to work by uncommenting the code at the  
bottom to call scriptCode.Run

but in the new version, the signature of the Run method has changed to  
expect a Scope rather than a CodeContext.

What value should be passed as the Scope?

I’ve tried context.Scope and context2.Scope - they both compile and  
execute OK, but they don’t execute the code in the correct Scope.

At this stage, I’m just interested in a quick fix to this method so that  
I can use it to continue exploring the rest of gems setup.rb

Cheers, Wayne.

---

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [April 23, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/module-class-eval/135602/2 "2008-04-23T15:08:13Z")

</div>

Wayne K.:

> Module::class\_eval

eval and friends with binding support should arrive this week. Hang in  
there!

Thanks,  
-John

---

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [April 23, 2008, 3:23pm UTC](https://www.ruby-forum.com/t/module-class-eval/135602/3 "2008-04-23T15:23:28Z")

</div>

Try:  
return scriptCode.Run(context2.Scope, false);

Haven’t tested that though.

Pete

* * *

Ironruby-core mailing list  
removed\_email\_address@domain.invalid  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
