method `module_eval' for main:Object should be undefined?
---------------------------------------------------------

                 Key: JRUBY-3190
                 URL: http://jira.codehaus.org/browse/JRUBY-3190
             Project: JRuby
          Issue Type: Bug
          Components: Interpreter
    Affects Versions: JRuby 1.1.4
         Environment: Mac OS X 10.5.4, jruby 1.1.4 (ruby 1.8.6 patchlevel 114) 
(2008-08-28 rev 7570) [x86_64-java], ruby 1.8.6 (2008-03-03 patchlevel 114) 
[universal-darwin9.0]
            Reporter: John Pywtorak
            Priority: Minor


The example below shows jruby behaviour that is different than MRI ruby for the 
builtin module_eval.
$ jruby -e 'require "ffi";extend FFI::Library;attach_function :getuid, [], 
:uint;puts getuid'
501
$ ruby -e 'require "rubygems";require "ffi";extend FFI::Library;attach_function 
:getuid, [], :uint;puts getuid'
/Library/Ruby/Gems/1.8/gems/ffi-0.1.1/lib/ffi/ffi.rb:246:in `attach_function': 
undefined method `module_eval' for main:Object (NoMethodError)
        from -e:1

Note the ruby version works as expected as soon as I put the attach_function in 
a module  and not in main, as below.
$ ruby -e 'require "rubygems";require "ffi";module GetPid;extend 
FFI::Library;attach_function :getuid, [], :uint;end;puts GetPid.getuid'
501


-- 
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


Reply via email to