115件ヒット
[1-100件を表示]
(0.039秒)
別のキーワード
種類
- モジュール関数 (60)
- インスタンスメソッド (55)
キーワード
-
arg
_ config (11) -
enable
_ config (22) - rand (16)
- spawn (44)
-
with
_ config (22)
検索結果
先頭5件
- Kernel
# arg _ config(config , default) { . . . } -> object | String | true | nil - Kernel
# enable _ config(config , default) {|config , default| . . . } -> bool | String - Kernel
# with _ config(config , default = nil) {|config , default| . . . } -> bool | String - Kernel
# enable _ config(config , default) -> bool | String - Kernel
# with _ config(config , default = nil) -> bool | String
-
Kernel
# arg _ config(config , default) { . . . } -> object | String | true | nil (523.0) -
configure オプション --config の値を返します。
...configure オプション --config の値を返します。
@param config オプションを文字列で指定します。
@param default 引数 config で指定したオプションのデフォルト値を指定します。
@return オプションが指定されてた場合は true を、指定......されなかった場合は
nil を返します。
引数 default、あるいはブロックを指定すると、オプションが指定さ
れていない場合に引数 default の値かブロックの評価結果を返します
(両方指定した場合はブロ......ンに引数が指定されていた場合は指定した文字列を返します。
例えば extconf.rb で arg_config メソッドを使う場合、
$ ruby extconf.rb --foo --bar=baz
と実行したとき、arg_config("--foo") の値は true、
arg_config("--bar") の値は "baz" です。... -
Kernel
# enable _ config(config , default) {|config , default| . . . } -> bool | String (419.0) -
configure のオプションを検査します。
...ョンを検査します。
configure のオプションに --enable-<config> が指定された場合は、真を返し
ます。--disable-<config> が指定された場合は。偽を返します。どちらでもな
い場合は default を返します。
これはデバッグ情報などのカ......義を、追加するのに役立ちます。
@param config configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if enable_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Kernel
# with _ config(config , default = nil) {|config , default| . . . } -> bool | String (419.0) -
configure のオプションを検査します。
...ションを検査します。
configure のオプションに --with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。
これはデバッグ情報などのカス......定義を、追加するのに役立ちます。
@param config configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if with_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Kernel
# enable _ config(config , default) -> bool | String (319.0) -
configure のオプションを検査します。
...ョンを検査します。
configure のオプションに --enable-<config> が指定された場合は、真を返し
ます。--disable-<config> が指定された場合は。偽を返します。どちらでもな
い場合は default を返します。
これはデバッグ情報などのカ......義を、追加するのに役立ちます。
@param config configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if enable_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Kernel
# with _ config(config , default = nil) -> bool | String (319.0) -
configure のオプションを検査します。
...ションを検査します。
configure のオプションに --with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。
これはデバッグ情報などのカス......定義を、追加するのに役立ちます。
@param config configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if with_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end... -
Kernel
. # rand(range) -> Integer | Float | nil (310.0) -
擬似乱数を発生させます。
...します。
range に含まれる数が無い場合は nil を返します。
まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。
擬似乱数生成器として Random::DEFAULT を使用します。
これは Random.rand と共通です。
@param max 乱数値......10) #=> 1 (0 から 9 までの整数。終端を含まない)
rand(1.0..1.5) #=> 1.1362963047752432 (1.0 以上 1.5 以下の実数)
rand(1.0...1.5) #=> 1.1382321275715483 (1.0 以上 1.5 未満の実数)
rand(1..0) #=> nil
//}
@see Kernel.#srand, Random#rand, Random... -
Kernel
. # rand(max = 0) -> Integer | Float (210.0) -
擬似乱数を発生させます。
...します。
range に含まれる数が無い場合は nil を返します。
まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。
擬似乱数生成器として Random::DEFAULT を使用します。
これは Random.rand と共通です。
@param max 乱数値......10) #=> 1 (0 から 9 までの整数。終端を含まない)
rand(1.0..1.5) #=> 1.1362963047752432 (1.0 以上 1.5 以下の実数)
rand(1.0...1.5) #=> 1.1382321275715483 (1.0 以上 1.5 未満の実数)
rand(1..0) #=> nil
//}
@see Kernel.#srand, Random#rand, Random... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (132.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...d = spawn(command, :out=>["log", "w", 0600])
# flagを文字列でなくビットで指定する
pid = spawn(command, :out=>["log", File::WRONLY|File::EXCL|File::CREAT, 0600])
//}
配列で複数のファイルデスクリプタを同時にリダイレクトできます。
//emlist[][ruby]{
# stdou......を用いて、IO.popen で、子プロセスの
stderr と stdout を混ぜる例を以下に示します。
//emlist[][ruby]{
io = IO.popen(["sh", "-c", "echo out; echo err >&2", :err=>[:child, :out]])
p io.read #=> "out\nerr\n
//}
spawn と IO.popen では
デフォルトでは非標準的なフ......自動的に
閉じられることに注意してください。
//emlist[][ruby]{
pid = spawn(command, :close_others=>true) # close 3,4,5,... (default)
pid = spawn(command, :close_others=>false) # don't close 3,4,5,...
//}
これを利用して spawn を IO.popen のように使うことがで......din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa... -
Kernel
. # spawn(program , *args) -> Integer (132.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...d = spawn(command, :out=>["log", "w", 0600])
# flagを文字列でなくビットで指定する
pid = spawn(command, :out=>["log", File::WRONLY|File::EXCL|File::CREAT, 0600])
//}
配列で複数のファイルデスクリプタを同時にリダイレクトできます。
//emlist[][ruby]{
# stdou......を用いて、IO.popen で、子プロセスの
stderr と stdout を混ぜる例を以下に示します。
//emlist[][ruby]{
io = IO.popen(["sh", "-c", "echo out; echo err >&2", :err=>[:child, :out]])
p io.read #=> "out\nerr\n
//}
spawn と IO.popen では
デフォルトでは非標準的なフ......自動的に
閉じられることに注意してください。
//emlist[][ruby]{
pid = spawn(command, :close_others=>true) # close 3,4,5,... (default)
pid = spawn(command, :close_others=>false) # don't close 3,4,5,...
//}
これを利用して spawn を IO.popen のように使うことがで......din), 1(stdout), 2(stderr) 以外の
ファイルデスクリプタをすべて閉じます。
false がデフォルトです。
: :exception
Kernel.#system のみで指定できます。
これを true に設定すると、nil や false を返す代わりに例外が発生します。
fa... -
Kernel
. # spawn(command , options={}) -> Integer (112.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...セスのプロセスIDを返します。
=== 引数の解釈
この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。......表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno::EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec...