you should use not caller but caller(0)  for checking binding behavior.

b.rb:
p caller(0)
def self.run()
  p caller(0)
end

so, we can get bellow.

["b.rb:1:in `<main>'", "a.rb:2:in `class_eval'", "a.rb:2:in `<main>'"]
["b.rb:3:in `run'", "a.rb:3:in `<main>'"]

it's a correct result.

regards,
--
Masaya TARUI
No Tool,No Life.


2011/9/16 Kramer Ulrich <Ulrich.Kramer / crossgate.com>:
> I would like to report a ruby1.9 bug. I tried to create a new ticket in r=
edmine. After registration(wonderix) I tried to login, but I didn't succeed=
. After 4 password resets I gave up.
>
> So here is my description:
>
> a.rb:
> test =3D Class.new(Object)
> test.class_eval(File.read("b.rb"),"b.rb",1)
> test.run
>
> b.rb:
> p caller
> def self.run()
> =A0 p caller
> end
>
> When I run a.rb I got:
> ["a.rb:2:in `class_eval'", "a.rb:2:in `<main>'"]
> ["a.rb:3:in `<main>'"]
>
> Should be:
> ["b.rb:1:in `class_eval'", "a.rb:2:in `<main>'"]
> ["b.rb:3:in `<main>'"]
>
> ruby -v:
> ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
>
>
>
> Mit freundlichen Gr=FC=DFen | best regards,
>
> Ulrich Kramer
> Senior Developer