Actions
Misc #14190
closedWhat are the semantics of $SAFE?
Misc #14190:
What are the semantics of $SAFE?
Status:
Closed
Assignee:
-
Description
$SAFE is documented in many places as thread-local, but it seems more than that.
For example:
gives:
So in b and in -e, $SAFE is 0.
Is it file-based somehow?
I was trying to understand what
https://github.com/ruby/ruby/blob/7c4306e6e9c3c4a255f4ad20134c1832dbe45ba2/test/rubygems/test_gem.rb#L9-L13
is supposed to do.
Does it make sense? What does it do?
It seems the test_* methods in that file actually read $SAFE as 0, not 1.
Updated by mame (Yusuke Endoh) over 8 years ago
Updated by Earlopain (Earlopain _) 9 days ago
- Status changed from Open to Closed
$SAFE is removed since Ruby 3.0
Actions