別のキーワード
ライブラリ
クラス
- BasicSocket (11)
- CSV (33)
- Enumerator (5)
- Object (26)
-
OpenSSL
:: OCSP :: BasicResponse (11) -
REXML
:: Element (11) -
RubyVM
:: InstructionSequence (22) - ThreadsWait (6)
モジュール
- Find (22)
- Kernel (53)
-
REXML
:: Node (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Numeric (11)
- OCSP (11)
- Proc (11)
- Ruby プログラムの実行 (11)
- TCPServer (11)
- ZStream (11)
- debug (11)
- disasm (11)
- disassemble (11)
- filter (33)
- find (22)
- getpeereid (11)
- lambda (17)
- loop (18)
-
next
_ element (11) -
next
_ sibling _ node (11) -
next
_ wait (6) - proc (18)
- produce (5)
-
rexml
/ parsers / pullparser (11) -
ruby 1
. 8 . 4 feature (11) - status (11)
- then (12)
-
yield
_ self (14) - メソッド呼び出し(super・ブロック付き・yield) (11)
- リテラル (11)
- 制御構造 (11)
- 手続きオブジェクトの挙動の詳細 (11)
検索結果
先頭5件
-
Ruby プログラムの実行 (18.0)
-
Ruby プログラムの実行 === Ruby プログラム
...ドを break して終了したらその値は
nil です。スタックフレーム上にないなら例外 LocalJumpError
を発生します。
next ブロックの終わりまでジャンプ
retry 複雑だ…
==== eval, instance_eval, module_eval
これなんだっけ
=== 代入
代入と......ロック上での多重代入とみなされます。たと
えば以下のコードのブロック実行開始時には、
some_iterator do |a,b|
....
end
次のような操作がまず実行されます。
a, b = <some_iterator から yield された値>
==== インスタン... -
RubyVM
:: InstructionSequence . disasm(body) -> String (18.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
local table... -
RubyVM
:: InstructionSequence . disassemble(body) -> String (18.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
local table... -
TCPServer (18.0)
-
TCP/IP ストリーム型接続のサーバ側のソケットのクラスです。
...erver.open(0)
socks = [gs]
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
nsock = select(socks)
next if nsock == nil
for s in nsock[0]
if s == gs
socks.push(s.accept)
print(s, " is accepted\n")
else
if s.e......gs = TCPServer.open(0)
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
Thread.start(gs.accept) do |s| # save to dynamic variable
print(s, " is accepted\n")
while s.gets
s.write($_)
end
print(s, " is gone\n")... -
debug (18.0)
-
Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。
...。
ここに挙げたもの以外を入力した場合、その入力を ruby の式として評価します。
: break
: break [<file>:]<position>|<class>:<method>
ブレークポイントを設定します。引数を省略した場合設定したブレークポ
イントを表示しま......指定した行数分、処理を
続行します。メソッドの中に入ります。
このコマンドの省略形は s です。
: next [nnn]
一行ずつ処理を実行します。引数を指定した場合、指定した行数分、処理を
続行します。step [nnn]と......ームのスタックと、現在のフレーム位置を表示します。
このコマンドの省略形は w または f です。
: list [(-|nn-mm)]
スクリプトを表示します。引数が `-' ならば前の行を表示します。
nn-mm の形式では指定した範囲の... -
Find
. # find(*dirs) -> Enumerator (13.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...tor を返します。
@param dirs 探索するディレクトリを一つ以上指定します。
例:
require 'find'
Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}
あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune......使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1), Find.#prune... -
Find
. # find(*dirs , ignore _ error: true) -> Enumerator (13.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
例:
require 'find'
Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}
あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune......使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1), Find.#prune... -
BasicSocket
# getpeereid -> [Integer , Integer] (12.0) -
Unix ドメインソケットにおいて接続相手の euid と egid を 返します。
...返り値は
不定です。
require 'socket'
Socket.unix_server_loop("/tmp/sock") {|s|
begin
euid, egid = s.getpeereid
# Check the connected client is myself or not.
next if euid != Process.uid
# do something about my resource.
ensure
s.clos... -
NEWS for Ruby 3
. 0 . 0 (12.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......!
* String#slice / String#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ / String#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase
* Symbol
* Symbol#to_proc now returns a lambda Proc. 162......This should have no impact on extension libraries, but users might experience slow compilations.
* Memory view interface [EXPERIMENTAL]
* The memory view interface is a C-API set to exchange a raw memory area, such as a numeric array or a bitmap image, between extension libraries. The extensi... -
OpenSSL
:: OCSP (12.0) -
OCSP(Online Certificate Status Protocol)を取り扱うための モジュールです。OCSP は 2560 で定義されています。
...req.check_nonce(basic_resp))
unless basic_resp.verify([], store)
puts "verify response fail"
end
rescid, status, reason, revtime, thisupd, nextupd, exts = basic_resp.status.first
STATUS2MESSAGE = {
OpenSSL::OCSP::V_CERTSTATUS_GOOD => "OK",
OpenSSL::OCSP::V_CERTSTATUS_REVOKED =>......SAGE[status]}"
puts "reason: #{reason}" if status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
puts "revoked time: #{revtime}" if status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
puts "response update: #{thisupd}"
puts "response next update: #{nextupd}"
puts "extensions: "
exts.each{|ext| p ext}...