Hello,
I'm confused by the following ambiguity of -T and $SAFE: after short examination of source code, it appears that -T
only sets safe level (using function rb_set_safe_level), which is basically what safe_getter and safe_setter used to
handle $SAFE do.
However, the behavior of -T1 and $SAFE=1 differ slightly, as described below. It may be a non-issue and I'm doing something
the Wrong Way(tm), however, the fact that require complains about NULL pointer given itself would suggest otherwise.
Thanks in advance for any comments.
##################
## Test case #1:
## Using -T1
isteve@silver:~$ ruby -T1 yap.rb
yap.rb:5:in `require': NULL pointer given (ArgumentError)
from yap.rb:5
isteve@silver:~$ cat yap.rb
#!/usr/bin/ruby -T1
#$SAFE=1
require 'test.rb'
puts "asd"
isteve@silver:~$ cat test.rb
#!/usr/bin/env ruby
def foo(s)
"s"
end
##################
## Test case #2: #
## I've only altered yap.rb in fashion to be seen far below (ie. use $SAFE instead of -T1)
isteve@silver:~$ ruby yap.rb
asd
isteve@silver:~$ cat yap.rb
#!/usr/bin/ruby
$SAFE=1
require 'test.rb'
puts "asd" |