Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

evalling a string containing __FILE__ can screw up future calls to __FILE__ #149

Closed
wycats opened this Issue · 1 comment

2 participants

@wycats
Collaborator

Test case:

def blah
  p __FILE__
  eval("p __FILE__", binding, "(erb)", 1)
end

blah
blah

This issue came up in bundler, which uses FILE to get the ERB template to render. The ERB template itself used FILE, and since ERB uses eval to get its result, a second call to the method that found the ERB file resulted in an incorrect FILE.

@evanphx
Owner

Don't change a StaticScope in eval. Closed by 93f86c4.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.