jirb breaks method_added for classes
------------------------------------
Key: JRUBY-2224
URL: http://jira.codehaus.org/browse/JRUBY-2224
Project: JRuby
Issue Type: Bug
Reporter: Stefan Lang
Assignee: Thomas E Enebo
Save this code in jtest.rb
{code}
class Module
alias core_method_added method_added
def method_added(method_name)
core_method_added(method_name)
puts "method_added #{self} #{method_name}"
end
end
class Foo
def foo; :foo; end
end
module Bar
def bar; :bar; end
end
{code}
Running with Ruby/jruby:
{noformat}
$ ruby jtest.rb
method_added Module method_added
method_added Foo foo
method_added Bar bar
$ jruby jtest.rb
method_added Module method_added
method_added Foo foo
method_added Bar bar
{noformat}
Fine, so far. Now with irb/jirb:
{noformat}
$ irb
irb(main):001:0> load "jtest.rb"
method_added Module method_added
method_added Foo foo
method_added Bar bar
=> true
irb(main):002:0> exit
$ jirb
irb(main):001:0> load "jtest.rb"
method_added Bar bar
=> true
irb(main):002:0> exit
{noformat}
With jirb, two calls to the custom method_added are missing.
load is not the culprit - behaviour is the same if the code is entered directly
into (j)irb.
JRuby is revision 6102 from svn.
--
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