Module.class_exec and Module.module_exec
----------------------------------------
Key: JRUBY-5131
URL: http://jira.codehaus.org/browse/JRUBY-5131
Project: JRuby
Issue Type: Improvement
Components: Core Classes/Modules
Affects Versions: JRuby 1.5.3
Environment: master
Reporter: Hiro Asari
Fix For: JRuby 1.6
These methods are identical, and exist in both MRI 1.8.7 and 1.9.x:
{noformat}
$ ruby -v -S irb
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
irb(main):001:0> class C; end
=> nil
irb(main):002:0> C.class_exec { def hello; "hello" end }
=> nil
irb(main):003:0> C.new.hello
=> "hello"
{noformat}
{noformat}
$ ruby1.9 -v -S irb
ruby 1.9.3dev (2010-09-01 trunk 29160) [x86_64-darwin10.4.0]
irb(main):001:0> class C; end
=> nil
irb(main):002:0> C.class_exec { def hello; "hello" end }
=> nil
irb(main):003:0> C.new.hello
=> "hello"
{noformat}
{noformat}
$ jruby -v -S irb
jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSpot(TM)
64-Bit Server VM 1.6.0_20) [x86_64-java]
jruby-1.5.3 > class C; end
=> nil
jruby-1.5.3 > C.class_exec { def hello; "hello" end }
NoMethodError: undefined method `class_exec' for C:Class
from (irb):2
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email