Skip to content

Commit

Permalink
Fix error on 2.3
Browse files Browse the repository at this point in the history
```
-:5:12 syntax error, unexpected keyword_ensure, expecting keyword_end (BitClust::SyntaxHighlighter::ParseError)
```
  • Loading branch information
znz committed Nov 30, 2019
1 parent 612c4f0 commit 6aa2d52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions refm/doc/spec/safelevel.rd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Rubyではオブジェクトは「汚染されている」とみなされるこ
* プログラム開始時の$SAFEの値は0
#@since 2.6.0
* 各スレッド固有ではなくなったので必要に応じて ensure で戻す
#@samplecode
//emlist{
$SAFE = 0
th = Thread.new do
p $SAFE # => 0
Expand All @@ -63,7 +63,7 @@ Rubyではオブジェクトは「汚染されている」とみなされるこ
end
th.join
p $SAFE # => 0
#@end
//}
* $SAFE の値を現在の値より小さく変更する事もできる
//emlist{
$ ruby -e '$SAFE = 1; $SAFE = 0'
Expand Down Expand Up @@ -259,7 +259,7 @@ $SAFE はスレッドローカルからグローバルになり、レベルを
プログラムの一部だけを高いセーフレベルで実行するには、以下のように ensure でセーフレベルを
戻す必要があります。
#@samplecode 例
//emlist{
def safe(level)
result = nil
Thread.start do
Expand All @@ -274,7 +274,7 @@ end
lib = "insecure_library".taint # 外部から受け取った文字列(仮)
safe(1) { require lib } # $SAFE が 1 なので例外
require lib # 外側は影響を受けない
#@end
//}
#@else
Expand Down

0 comments on commit 6aa2d52

Please sign in to comment.