キーワード
-
caller
_ locations (22) -
clock
_ gettime (11) -
count
_ tdata _ objects (11) - detach (11)
- dump (22)
-
pipeline
_ r (22) -
pipeline
_ rw (22) -
pipeline
_ start (22) -
pipeline
_ w (22) - popen2 (22)
- popen2e (22)
- popen3 (22)
検索結果
先頭5件
-
DRb
. # thread -> Thread|nil (24403.0) -
プライマリサーバが動作しているスレッドを返します。
プライマリサーバが動作しているスレッドを返します。
プライマリサーバが存在しない場合は nil を返します。
@see DRb.#primary_server -
Process
. # detach(pid) -> Thread (6202.0) -
子プロセス pid の終了を監視するスレッドを生成して返します。 生成したスレッドは子プロセスが終了した後に終了ステータス (Process::Status) を返します。 指定した子プロセスが存在しなければ即座に nil で終了します。
...。
@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。
pid = fork {
# child
sleep 3
}
p pid # => 7762
th = Process.detach(pid)
p th.value
# => #<Process::Status: pid 7762 exit 0>... -
Marshal
. # dump(obj , limit = -1) -> String (3007.0) -
obj を指定された出力先に再帰的に出力します。
...的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これ......。例えば、デフォルト値を求めるブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定......オブジェクトをダンプしようとした場合に発生します。
@raise ArgumentError limit 段以上深くリンクしたオブジェクトをダンプしようと
した場合に発生します。
@see Object#marshal_dump, Object#marshal_load... -
Marshal
. # dump(obj , port , limit = -1) -> IO (3007.0) -
obj を指定された出力先に再帰的に出力します。
...的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これ......。例えば、デフォルト値を求めるブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定......オブジェクトをダンプしようとした場合に発生します。
@raise ArgumentError limit 段以上深くリンクしたオブジェクトをダンプしようと
した場合に発生します。
@see Object#marshal_dump, Object#marshal_load... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (225.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......mlist[例][ruby]{
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......(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 (225.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......mlist[例][ruby]{
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......(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... -
ObjectSpace
. # count _ tdata _ objects(result _ hash = nil) -> Hash (207.0) -
T_DATA の種類ごとにオブジェクトの数を格納したハッシュを返します。
...t_hash 戻り値のためのハッシュを指定します。省略した場合は新
しくハッシュを作成します。result_hash の内容は上書き
されます。プローブ効果を避けるために使用します。
@raise TypeError result_hash......> {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
# :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
# ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
# Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
//}
現在のバージョンでは、... -
Open3
. # pipeline _ r(*cmds) -> [IO , [Thread]] (202.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。
...g を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandl......実行したプロセスを待つためのスレッドの配列を配列で返します。
例:
require "open3"
Open3.pipeline_r("yes", "head -10") {|r, ts|
p r.read #=> "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"
p ts[0].value #=> #<Process::Status: pid 24910 SIGPIPE (signal 13)>... -
Open3
. # pipeline _ rw(*cmds) -> [IO , IO , [Thread]] (202.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。
...g を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandl......のスレッドの配列を配列で返します。
例:
require "open3"
Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"
# sortコマンドにEOFを送る。
stdin.close
# stdinに... -
Open3
. # pipeline _ start(*cmds) -> [Thread] (202.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。
...g を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandl...