36件ヒット
[1-36件を表示]
(0.080秒)
クラス
-
OpenSSL
:: SSL :: SSLContext (12) - WIN32OLE (12)
モジュール
- Enumerable (12)
キーワード
- chunk (12)
-
ole
_ free (12) -
renegotiation
_ cb= (12)
検索結果
先頭3件
-
OpenSSL
:: SSL :: SSLContext # renegotiation _ cb=(cb) (3007.0) -
@todo
...@todo
ハンドシェイク開始時に呼び出されるコールバックを設定します。
コールバックには OpenSSL::SSL::SSLSocket オブジェクトが
渡されます。
このコールバック内で何らかの例外が生じた場合には
以降のSSLの処理を停止しま......す。
num_handshakes = 0
ctx.renegotiation_cb = lambda do |ssl|
num_handshakes += 1
raise RuntimeError.new("Client renegotiation disabled") if num_handshakes > 1
end
@param cb コールバック(Proc, Method など)もしくは nil
@see OpenSSL::SSL::SSLContext#renegotiation_cb... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (25.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...め upcase しています。
//emlist[例][ruby]{
# ファイルのエンコーディングは実際のファイルに合わせてください。
open("/usr/share/dict/words", "r:iso-8859-1") {|f|
f.chunk {|line| line[0].upcase }.each {|ch, lines| p [ch, lines.length] }
}
# => ["A", 17096]
#......で始まるシンボルを指定した場合は例外が発生します。
//emlist[例][ruby]{
[1, 2].chunk { |item| :_underscore }.to_a
# => RuntimeError: symbols beginning with an underscore are reserved
# 「.to_a」無しだと Enumerator を返すのみで例外は発生しない
//}
nil......の出力のハイフンの所で区切りたい場合を考えます。
//emlist[例][ruby]{
sep = "-"*72 + "\n" # ハイフンが72個の行
IO.popen("svn log README") {|f|
f.chunk {|line|
line != sep || nil
}.each {|_, lines|
pp lines
}
}
#=> ["r20018 | knu | 2008-10-29 13:20:42 +0... -
WIN32OLE
# ole _ free -> () (25.0) -
selfが参照するCOMオブジェクトを解放します。
...操作は行えません。
excel = WIN32OLE.new('Excel.Application')
excel.ole_free # オブジェクトの解放
excel.Quit #=> RuntimeError (failed to get Dispatch Interface)
通常は利用されなくなったWIN32OLEオブジェクトはGCのタイミングで自動的に
解放......OLE.new('Excel.Application')
workbook = excel.Workbooks.Open('workbook.xls')
workbook.Close(:SaveChanges => false)
workbook.ole_free
excel.ole_free
# この時点でExcel.EXEは終了しない
上の例では、excel.Workbooks.Openの行で、excel.Workbooksオブジェクトが生
成......は解
放されません。それに対して下の例では正しく解放されます。
excel = WIN32OLE.new('Excel.Application')
books = excel.Workbooks
workbook = books.Open('workbook.xls')
books.ole_free
workbook.Close(:SaveChanges => false)
workbook.ole_free
excel.ole_free...