別のキーワード
モジュール
- BigMath (24)
- Etc (12)
- Fiddle (24)
- FileTest (12)
- Kernel (264)
- Math (36)
- ObjectSpace (84)
-
OpenSSL
:: ASN1 (36) - Process (60)
キーワード
- BigDecimal (24)
- Rational (12)
-
allocation
_ sourceline (12) - decode (12)
- dlwrap (12)
-
each
_ object (48) - exp (12)
- fork (24)
- format (12)
- frexp (12)
- groups (12)
- lgamma (12)
- log (12)
- malloc (12)
-
memsize
_ of (12) -
memsize
_ of _ all (12) - putc (12)
- rand (24)
- size? (12)
- sleep (24)
- spawn (48)
- sprintf (12)
- sqrt (12)
- srand (24)
- syscall (12)
- sysconf (12)
- test (24)
- wait (12)
- wait2 (12)
- waitpid (12)
- waitpid2 (12)
検索結果
先頭5件
-
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (18413.0) -
引数を整数 に変換した結果を返します。
...文字列以外のオブジェクトに対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合......数) です。
@param exception false を指定すると、変換できなかった場合、
例外を発生する代わりに nil を返します。
@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メ......o_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # c... -
Kernel
. # Integer(arg , base = 0) -> Integer (18407.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
...文字列以外のオブジェクトに対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合......数) です。
@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返......発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot... -
OpenSSL
:: ASN1 . # Integer(value) -> OpenSSL :: ASN1 :: Integer (18295.0) -
ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを 生成します。
...ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを
生成します。
OpenSSL::ASN1::Integer.new と同じです。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインスタンス)
@param tag タグ番号
@param tagging タグ付けの方法(:IMPLI......CIT もしくは :EXPLICIT)
@param tag_class タグクラス(:UNIVERSAL, :CONTEXT_SPECIFIC, :APPLICATION, :PRIVATE のいずれか)... -
OpenSSL
:: ASN1 . # Integer(value , tag , tagging , tag _ class) -> OpenSSL :: ASN1 :: Integer (18295.0) -
ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを 生成します。
...ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを
生成します。
OpenSSL::ASN1::Integer.new と同じです。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインスタンス)
@param tag タグ番号
@param tagging タグ付けの方法(:IMPLI......CIT もしくは :EXPLICIT)
@param tag_class タグクラス(:UNIVERSAL, :CONTEXT_SPECIFIC, :APPLICATION, :PRIVATE のいずれか)... -
Kernel
. # format(format , *arg) -> String (421.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...をフォーマットした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......B", "0", "0x", "0X" を付加します。
C 言語と同様引数が 0 の場合にはプレフィックスが付加されません。
//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x",... -
Kernel
. # sprintf(format , *arg) -> String (421.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...をフォーマットした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......B", "0", "0x", "0X" を付加します。
C 言語と同様引数が 0 の場合にはプレフィックスが付加されません。
//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x",... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (359.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...名文字列、Hash の値に設定する値とします。
nil とすることで環境変数が削除(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}
親プロセスは Process.#waitpid で子プロ......します。
//emlist[][ruby]{
# すべての環境変数をクリア
pid = spawn(command, :unsetenv_others=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}
「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しい......2つの配列、を渡すことができます。
それぞれ Process.#setrlimit の引数が2個、3個の場合に対応します。
//emlist[][ruby]{
# 現プロセスの core の resource limit を取得
cur, max = Process.getrlimit(:CORE)
# 一時的に子プロセスの core dump を止める... -
Kernel
. # spawn(program , *args) -> Integer (359.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...名文字列、Hash の値に設定する値とします。
nil とすることで環境変数が削除(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}
親プロセスは Process.#waitpid で子プロ......します。
//emlist[][ruby]{
# すべての環境変数をクリア
pid = spawn(command, :unsetenv_others=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}
「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しい......2つの配列、を渡すことができます。
それぞれ Process.#setrlimit の引数が2個、3個の場合に対応します。
//emlist[][ruby]{
# 現プロセスの core の resource limit を取得
cur, max = Process.getrlimit(:CORE)
# 一時的に子プロセスの core dump を止める... -
Kernel
. # spawn(command , options={}) -> Integer (194.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...ます。
@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno:......:EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec... -
Kernel
. # spawn(env , command , options={}) -> Integer (194.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...ます。
@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash
@raise Errno::EXXX 起動に失敗し、ruby インタプリタに制御が戻った場合に発生します。
@raise Errno:......:EXXX コマンドが実行できなかった場合に発生します。
@see Kernel.#system,Kernel.#exec...