ライブラリ
- ビルトイン (157)
- find (24)
- json (24)
-
webrick
/ httputils (12)
モジュール
- Find (24)
- JSON (24)
- Kernel (109)
- ObjectSpace (24)
- Signal (24)
-
WEBrick
:: HTTPUtils (12)
キーワード
- ` (12)
-
at
_ exit (12) -
define
_ finalizer (24) - exit (12)
- find (24)
- lambda (18)
-
load
_ file (12) -
load
_ file! (12) -
parse
_ range _ header (12) - proc (19)
-
trace
_ var (36) - trap (24)
検索結果
先頭5件
-
JSON
. # load _ file!(filespec , opts = {}) -> object (101.0) -
filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。
...filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。
@param filespec ファイル名を指定します。
@param options オプションをハッシュで指定します。指定可能なオプションは JSON.#parse! と同様で... -
JSON
. # load _ file(filespec , opts = {}) -> object (101.0) -
filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。
...filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。
@param filespec ファイル名を指定します。
@param options オプションをハッシュで指定します。指定可能なオプションは JSON.#parse と同様で... -
WEBrick
:: HTTPUtils . # parse _ range _ header(ranges _ specifier) (101.0) -
@todo ???
...@todo ???
@param ranges_specifier... -
Kernel
. # at _ exit { . . . } -> Proc (13.0) -
与えられたブロックをインタプリタ終了時に実行します。
...る点を除けば、END ブロックによる終了
処理の登録と同等です。登録した処理を取り消すことはできません。
spec/terminateも参照してください。
@return 登録した処理を Proc オブジェクトで返します。
//emlist[例][ruby]{
3.times do |i......|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"
#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
//}
@see d:spec/control#END,Kernel.#exit!,Kernel.#fork... -
Find
. # find(*dirs) -> Enumerator (7.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...nd.#prune を使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1)... -
Find
. # find(*dirs) {|file| . . . } -> nil (7.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...nd.#prune を使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1)... -
Find
. # find(*dirs , ignore _ error: true) -> Enumerator (7.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...nd.#prune を使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1)... -
Find
. # find(*dirs , ignore _ error: true) {|file| . . . } -> nil (7.0) -
find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。
...nd.#prune を使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。
@see find(1)... -
Kernel
. # `(command) -> String (7.0) -
command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。
...いだけなら
Kernel.#system を使います。特に端末を制御するコマンドでは
`command` は失敗するかもしれません。
d:spec/literal#command も参照。
@param command コマンドとして実行する引数です。そのまま評価されるのではなく、......Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。
//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}
@see Kernel.#system,Kernel.#exec,Kernel.#spawn... -
Kernel
. # exit(status = true) -> () (7.0) -
Rubyプログラムの実行を終了します。status として整 数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 0(正常終了)です。
...puts "end1 with #{err.inspect}"
end
begin
puts 'start2...'
exit
ensure
puts 'end2...'
end
puts 'end' #実行されない
#=> start
# start1...
# end1 with #<SystemExit: exit>
# start2...
# end2...
#終了ステータス:0
//}
@see Kernel.#exit!,Kernel.#abort, d:spec/control#begin... -
Kernel
. # lambda -> Proc (7.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
#=> wrong number of arguments (2 for 3) (ArgumentError)
//}
d:spec/call#block_arg も参照してください。
==== ジャンプ構文の挙動の違い
return と break は、lambda と Proc.new では挙動が......数が違うとエラーになる][ruby]{
b = lambda{|a,b,c|
p a,b,c
}
b.call(2, 4)
# => wrong number of arguments (given 2, expected 3)
//}
d:spec/call#block_arg も参照してください。
==== ジャンプ構文の挙動の違い
return と break は、lambda と Proc.new では挙動が...