Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__FILE__ in a binding gets overwritten #1581

Closed
banister opened this issue Feb 29, 2012 · 0 comments
Closed

__FILE__ in a binding gets overwritten #1581

banister opened this issue Feb 29, 2012 · 0 comments

Comments

@banister
Copy link
Contributor

When using binding.eval(code, my_file) the my_file seems to overwrite the actual __FILE__ for the binding causing subsequent calls to binding.eval("__FILE__") to return my_file.

MRI (desired) behaviour:

> b.eval("__FILE__")
=> "(pry)"
> b.eval(":hello", "pig.rb")
=> :hello
> b.eval("__FILE__")
=> "(pry)"

Rubinius behaviour:

> b.eval("__FILE__")
=> "(pry)"
> b.eval(":hello", "pig.rb")
=> :hello
> b.eval("__FILE__")
=> "pig.rb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants