るりまサーチ

最速Rubyリファレンスマニュアル検索!
77件ヒット [1-77件を表示] (0.090秒)

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

キーワード

検索結果

Kernel.#caller_locations(range) -> [Thread::Backtrace::Location] | nil (6303.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []
test3(1, nil)
# => ["/U...
...(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}

@see Thread::Backtrace::Location, Kernel.#caller...

Kernel.#caller_locations(start = 1, length = nil) -> [Thread::Backtrace::Location] | nil (6303.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []
test3(1, nil)
# => ["/U...
...(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}

@see Thread::Backtrace::Location, Kernel.#caller...

Kernel.#select(reads, writes = [], excepts = [], timeout = nil) -> [[IO]] | nil (250.0)

IO.select と同じです。

...
IO
.select と同じです。

@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照


@see IO.select...

Kernel.#spawn(env, program, *args, options={}) -> Integer (235.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...ラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

=== option引数の概要
Hash を options として渡すことで、起動される子プロセスの
* プロセスグループ
* resource limit
* カレントデ...
...、0(stdin), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
true がデフォルトです。


=== option引数によるリダイレクトの概要
Hash のキー(子プロセス側)には以下のいずれかが指定できます。
* 単一のファ...
...ー出力, ファイルデスクリプタ2
* 整数 指定した整数が表すファイルデスクリプタ
* IO IO#fileno で表されるファイルデスクリプタ

=== option引数の詳細および例

「:unsetenv_others」を使うと、envで指定したもの以外の環境変数を...
...
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
false がデフォルトです。

=== option引数によるリダイレクトの概要
Hash...

Kernel.#spawn(program, *args) -> Integer (135.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...ラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

=== option引数の概要
Hash を options として渡すことで、起動される子プロセスの
* プロセスグループ
* resource limit
* カレントデ...
...、0(stdin), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
true がデフォルトです。


=== option引数によるリダイレクトの概要
Hash のキー(子プロセス側)には以下のいずれかが指定できます。
* 単一のファ...
...ー出力, ファイルデスクリプタ2
* 整数 指定した整数が表すファイルデスクリプタ
* IO IO#fileno で表されるファイルデスクリプタ

=== option引数の詳細および例

「:unsetenv_others」を使うと、envで指定したもの以外の環境変数を...
...
false がデフォルトです。

: :exception
Kernel
.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
false がデフォルトです。

=== option引数によるリダイレクトの概要
Hash...

絞り込み条件を変える

Kernel.#spawn(command, options={}) -> Integer (125.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...

Kernel.#spawn(env, command, options={}) -> Integer (125.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。

@raise Errno::EXXX コマンドが実行できなかった場合に発生します。


@see Kernel.#system,Kernel.#exec...