るりまサーチ (Ruby 3.1)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.055秒)
トップページ > クエリ:b[x] > クエリ:===[x] > バージョン:3.1[x] > モジュール:Kernel[x]

別のキーワード

  1. string b
  2. _builtin b
  3. b
  4. b string
  5. b _builtin

ライブラリ

キーワード

検索結果

Kernel.#format(format, *arg) -> String (922.0)

format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。

...トした文字列を返します。

@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime

=== sprintf フォーマット

Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)...
...表現の整数として出力します。

引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。

//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprintf("%d", '0b1010') #=> "10"
//}

: u

引数の数値を符号な...

Kernel.#sprintf(format, *arg) -> String (922.0)

format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。

...トした文字列を返します。

@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime

=== sprintf フォーマット

Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)...
...表現の整数として出力します。

引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。

//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprintf("%d", '0b1010') #=> "10"
//}

: u

引数の数値を符号な...

Kernel.#open(file, mode_enc = "r", perm = 0666) {|io| ... } -> object (394.0)

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

ブロックが与えられた場合、指定されたファイルをオープンし、
生成した IO オブジェクトを引数としてブロックを実行します。
ブロックの終了時や例外によりブロックを脱出するとき、
ファイルをクローズします。ブロックを評価した結果を返します。

ファイル名 file が `|' で始まる時には続く文字列をコマンドとして起動し、
コマンドの標準入出力に対してパイプラインを生成します

ファイル名が "|-" である時、open は Ruby の子プロセス
を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を...

Kernel.#system(command, options={}) -> bool | nil (325.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...# => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(env, command, options={}) -> bool | nil (325.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...# => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

絞り込み条件を変える

Kernel.#system(env, program, *args, options={}) -> bool | nil (325.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...umask
* 子プロセスでのリダイレクト
などを変更できます。環境変数のクリアなども指定できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(program, *args, options={}) -> bool | nil (325.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...umask
* 子プロセスでのリダイレクト
などを変更できます。環境変数のクリアなども指定できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel#gem(gem_name, *version_requirements) -> bool (322.0)

$LOAD_PATH に Ruby Gem を追加します。

$LOAD_PATH に Ruby Gem を追加します。

指定された Gem をロードする前にその Gem が必要とする Gem をロードします。
バージョン情報を省略した場合は、最も高いバージョンの Gem をロードします。
指定された Gem やその Gem が必要とする Gem が見つからなかった場合は
Gem::LoadError が発生します。

バージョンの指定方法に関しては Gem::Version を参照してください。

rubygems ライブラリがライブラリバージョンの衝突を検出しない限り、
gem メソッドは全ての require メソッドよりも前に実行されます。

...

Kernel.#require_relative(relative_feature) -> bool (322.0)

現在のファイルからの相対パスで require します。

...じです。

Kernel
.#eval などで文字列を評価した場合に、そこから
require_relative を呼出すと必ず失敗します。

@param relative_feature ファイル名の文字列です。
@raise LoadError ロードに失敗した場合に発生します。
@see Kernel.#require

=== r...
...ラリのローカル変数を
ロード元のスクリプトから直接取得することはできません。
このスコープの扱い方はKernel.#loadでも同様です。

//emlist[例][ruby]{
# ---------- some.rb -----------
$a = 1
@a = 1
A = 1
a = 1
# ---------- end some.rb -------

requi...

Kernel.#open(file, mode_enc = "r", perm = 0666) -> IO (94.0)

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

ブロックが与えられた場合、指定されたファイルをオープンし、
生成した IO オブジェクトを引数としてブロックを実行します。
ブロックの終了時や例外によりブロックを脱出するとき、
ファイルをクローズします。ブロックを評価した結果を返します。

ファイル名 file が `|' で始まる時には続く文字列をコマンドとして起動し、
コマンドの標準入出力に対してパイプラインを生成します

ファイル名が "|-" である時、open は Ruby の子プロセス
を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を...

絞り込み条件を変える