248件ヒット
[1-100件を表示]
(0.169秒)
クラス
- Enumerator (19)
- Hash (30)
- Proc (19)
-
RubyVM
:: InstructionSequence (36)
モジュール
- Process (104)
-
RubyVM
:: AbstractSyntaxTree (10) - Warning (6)
オブジェクト
- main (24)
キーワード
- [] (6)
- abort (24)
-
define
_ method (24) - disasm (12)
- disassemble (12)
- exec (12)
- exit (12)
- exit! (12)
- fork (24)
-
last
_ status (8) - new (62)
- of (22)
-
ruby2
_ keywords _ hash? (6) - spawn (12)
検索結果
先頭5件
-
Proc
. new -> Proc (21159.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...OSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しなければ、こ......上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}
これは以下と同じです。
//emlist[例][ruby]{
def foo
yield(1)
end
foo {|arg| p ar......entError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクト... -
Proc
. new { . . . } -> Proc (21159.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...OSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しなければ、こ......上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}
これは以下と同じです。
//emlist[例][ruby]{
def foo
yield(1)
end
foo {|arg| p ar......entError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクト......行ったときに発生します。
//emlist[][ruby]{
pr = Proc.new {|arg| p arg }
pr.call(1) # => 1
//}
//emlist[][ruby]{
Proc.new # => -e:1:in `new': tried to create Proc object without a block (ArgumentError)
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクトの......初期化のためにこれを呼び出します。このことを
除けば、Kernel.#proc と同じです。... -
Process
. last _ status -> Process :: Status | nil (3103.0) -
カレントスレッドで最後に終了した子プロセスのステータスを返します。
...じです。
Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status # => #<Process::Status: pid 4825 exit 13>
カレントスレッドで子プロセスを実行したことがない場合は nil を返します。
Process.last_status # => nil
@see Process::Status
@... -
Process
. abort -> () (3003.0) -
関数 Kernel.#abort と同じです。
関数 Kernel.#abort と同じです。
@param message 終了時のメッセージを文字列で指定します。 -
Process
. abort(message) -> () (3003.0) -
関数 Kernel.#abort と同じです。
関数 Kernel.#abort と同じです。
@param message 終了時のメッセージを文字列で指定します。 -
Process
. exec(command , *args) -> () (3003.0) -
カレントプロセスを与えられた外部コマンドで置き換えます。
カレントプロセスを与えられた外部コマンドで置き換えます。
=== 引数の解釈
引数が一つだけ与えられた場合、command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。
引数が複数与えられた場合、第 2 引数以降は command に直接渡され、
インタプリタから直接実行されます。
第 1 引数が 2 要素の配列の場合、第 1 要素の文字列が実際に起動する
プログラムのパスで、第 2 要素が「みせかけ... -
Process
. exit!(status = false) -> () (3003.0) -
関数 Kernel.#exit! と同じです。
関数 Kernel.#exit! と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see _exit(2) -
Process
. exit(status = true) -> () (3003.0) -
プロセスを終了します。関数 Kernel.#exit と同じです。
プロセスを終了します。関数 Kernel.#exit と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see exit(3) -
Process
. fork -> Integer | nil (3003.0) -
子プロセスを生成します。関数 Kernel.#fork と同じです。
子プロセスを生成します。関数 Kernel.#fork と同じです。
@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。
@see fork(2) -
Process
. fork { . . . } -> Integer | nil (3003.0) -
子プロセスを生成します。関数 Kernel.#fork と同じです。
子プロセスを生成します。関数 Kernel.#fork と同じです。
@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。
@see fork(2)