Is there a guide or thumb rule on choosing which safe level should one use for different situations? I've read Pickaxe. The only thing I can be sure of is this: $SAFE=1 is basically Ruby's equivalent of Perl's -T (in fact, Ruby also has -T and it's also automatically set for setuid/setgid scripts). Coming from Perl, I've known and use -T fairly frequently.
As for the other levels, it's blurry for me. Different safe levels have different sets of restrictions (sometimes seemingly unrelated), but I cannot understand why that restriction is placed for that level. For example, at $SAFE=2 the restrictions are mostly file-/process-related, so I'm guessing this level is for running things like CGI scripts. Am I right, or is there a different goal for $SAFE=2? $SAFE=4 is usually for embedded code. What is $SAFE=3 for? Are there definitions for $SAFE=5 and above (especially in Ruby 1.8/1.9)? Has $SAFE restrictions been changed/modified/added/relieved for certain safe levels in the past?
ยทยทยท
--
dave