'public_instance_methods' different from MRI within Rake (breaking Needle)
--------------------------------------------------------------------------

                 Key: JRUBY-1166
                 URL: http://jira.codehaus.org/browse/JRUBY-1166
             Project: JRuby
          Issue Type: Bug
          Components: Application Error
         Environment: [EMAIL PROTECTED]
            Reporter: Anders Bengtsson


The 'public_instance_methods' method reports different results for MRI and 
JRuby when running within Rake. Even though they report the same ancestors of 
self's class, the methods differ.

In particular, methods from FileUtils are not listed in public_instance_methods 
from MRI but they are in JRuby.

Reproduced with this code in a Rakefile, then run with Rake 0.7.3 on both:

class << self
      p ancestors
      p public_instance_methods
end

MRI gives this:

[Object, RakeFileUtils, FileUtils, FileUtils::StreamUtils_, Kernel]
["methods", "instance_eval", "dup", "require_gem", "instance_variables", 
"instance_of?", "extend", "eql?", "taguri", "id", "hash", "singleton_methods", 
"include", "taguri=", "taint", "instance_variable_get", "frozen?", "kind_of?", 
"method", "to_a", "display", "type", "protected_methods", "public", 
"instance_variable_set", "is_a?", "respond_to?", "to_s", "to_yaml", 
"object_id", "class", "private_methods", "==", "tainted?", "require", "__id__", 
"===", "untaint", "nil?", "to_yaml_style", "inspect", "send", "=~", "clone", 
"public_methods", "private", "__send__", "freeze", "equal?", 
"to_yaml_properties", "gem"]

While JRuby gives this:

["public", "include", "private", "to_s", "java_kind_of?", "to_yaml_node", 
"file", "multitask", "taguri", "desc", "namespace", "timeout", "Rational", 
"to_yaml_properties", "include_class", "task", "directory", "file_create", 
"import", "rule", "to_yaml", "to_yaml_style", "sh", "chmod", "ln_s", "mv", 
"symlink", "install", "nowrite", "safe_unlink", "rm_f", "copy", "ln", "mkpath", 
"cp_r", "mkdir", "mkdir_p", "chdir", "move", "rmdir", "chown_R", "ln_sf", "cp", 
"chown", "ruby", "link", "remove", "rm", "rmtree", "chmod_R", "rm_r", "cd", 
"makedirs", "verbose", "touch", "when_writing", "rm_rf", "split_all", 
"fu_world_writable?", "safe_ln", "object_id", "frozen?", "eql?", "=~", 
"methods", "to_a", "tainted?", "javax", "trap", "taint", "public_methods", 
"dup", "method", "==", "singleton_methods", "is_a?", "instance_eval", "equal?", 
"instance_variable_get", "com", "instance_of?", "hash", "inspect", "java", 
"org", "__id__", "clone", "__send__", "id", "instance_variable_set", "send", 
"gem", "untaint", "class", "protected_methods", "kind_of?", "require_gem", 
"instance_variables", "display", "extend", "freeze", "private_methods", "nil?", 
"type", "===", "instance_exec", "require", "respond_to?"]

I have a problem with Needle 1.3.0 breaking because of this. In a more complex 
situation, it tries to call 'undef_method' on a method returned by 
'public_instance_methods', but that method isn't "there", causing an error. 
(But it works in the simpler situation above).


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