-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Trouble with instance_eval when using embedded API #4067
Comments
Just discovered this behaves as expected in JRuby 1.7.25, but not 9.0.0.0. 1.7.25 would be a good workaround for me except that I apparently need some ruby 2.1 features that it doesn't have a CompatVersion for. |
Confirmed. It can be reproduced at a command line too:
Something's up with the way |
Today I discovered that if you don't use
Doesn't really help me, but how is that possible? |
@chadselph That's a good clue! I'm going to step through the logic a bit today. |
Ok, here's another clue: calling |
Maybe @subbuss or @enebo can refresh my memory about where we might start looking for this. I know we have punted on some bugs in the pass where someone does |
First, I want to explain I am not a ruby programmer, so I probably haven't debugged this as well as I could have. I'm writing an application on the JVM that takes as its input some files from an existing ruby DSL. Basically, it makes use of
instance_eval
and the files it evals occasionally eval other files. I can't seem to get this to work from the embedded API.Environment
Provide at least:
org.jruby:jruby-complete:9.1.2.0
14.5.0 Darwin Kernel Version 14.5.
Expected Behavior
I expect that running
::Kernel.eval
from within a block ofinstance_eval
will put the symbols in scope.Actual Behavior
Code gets evaled, (confirmed with
::Kernel.puts
) but symbols are not in scope.I have a minimized example here, with the error and the behavior in standard ruby:
https://gist.github.com/chadselph/0be497f37b16f1b01009836686e3875c
Thanks for you time!
The text was updated successfully, but these errors were encountered: