るりまサーチ

最速Rubyリファレンスマニュアル検索!
462件ヒット [1-100件を表示] (0.014秒)

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel::NIL -> NilClass (18236)

非推奨です。 nil と同じ。

...非推奨です。 nil と同じ。

この定数は過去との互換性のために提供されています。擬似変数 nil を使ってください。

Ruby では false と nil が偽として扱われます。
偽でない値(false でも nil でもない値) は全て真とみなされま...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (307)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (307)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...

Kernel#check_sizeof(type, headers = nil) -> Integer | nil (211)

与えられた型のサイズを返します。

...ーバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。

例えば、

check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロを...

Kernel#check_sizeof(type, headers = nil) { ... } -> Integer | nil (211)

与えられた型のサイズを返します。

...ーバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。

例えば、

check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロを...

絞り込み条件を変える

Kernel#have_library(lib, func = nil, headers = nil) -> bool (211)

ライブラリ lib がシステムに存在し、関数 func が定義されているかどうかをチェックします。 チェックが成功すれば $libs に lib を追加し true を返します。 チェックが失敗したら false を返します。

...敗したら false を返します。

@param lib ライブラリの名前を指定します。

@param func 検査する関数名を指定します。
nil
または空文字列のときは、"main" になります。

@param headers 追加のヘッダファイルを指定します。...

Kernel#have_library(lib, func = nil, headers = nil) { ... } -> bool (211)

ライブラリ lib がシステムに存在し、関数 func が定義されているかどうかをチェックします。 チェックが成功すれば $libs に lib を追加し true を返します。 チェックが失敗したら false を返します。

...敗したら false を返します。

@param lib ライブラリの名前を指定します。

@param func 検査する関数名を指定します。
nil
または空文字列のときは、"main" になります。

@param headers 追加のヘッダファイルを指定します。...

Kernel#try_constant(const, headers = nil, opt = "") -> Integer | nil (211)

定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。

...定数 const がシステムに存在するかどうか検査します。
Kernel
#have_const を使ってください。

@param const C 言語の定数名を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを...
...指定します。
$CFLAGS もコンパイラには渡されます。

@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。...

Kernel#try_constant(const, headers = nil, opt = "") { ... } -> Integer | nil (211)

定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。

...定数 const がシステムに存在するかどうか検査します。
Kernel
#have_const を使ってください。

@param const C 言語の定数名を指定します。

@param headers 追加のヘッダファイルを指定します。

@param opt コンパイラに渡すオプションを...
...指定します。
$CFLAGS もコンパイラには渡されます。

@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。...

Kernel#find_executable(bin, path = nil) -> String | nil (209)

パス path から実行ファイル bin を探します。

...

実行ファイルが見つかった場合は、そのフルパスを返します。
実行ファイルが見つからなかった場合は、nilを返します。

このメソッドは Makefile を変更しません。

@param bin 実行ファイルの名前を指定します。

@param path...

絞り込み条件を変える

Kernel#convertible_int(type, headers = nil, opts = nil) (205)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (205)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

Kernel.#open(name, mode = 'r', perm = nil, options = {}) {|ouri| ...} -> nil (204)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトとして返します。 StringIO オブジェクトは OpenURI::Meta モジュールで extend されています。

...ock) のように name の open メソッドが呼ばれます。

これ以外の場合は、name はファイル名として扱われ、従来の
Kernel
.#open(name, *rest) が呼ばれます。

ブロックを与えた場合は上の場合と同様、name が http:// や ftp:// で
始まって...
...ram mode モードを文字列で与えます。Kernel.#open と同じです。

@param perm open(2) の第 3 引数のように、ファイルを生成する場合のファイルのパーミッションを
整数で指定します。Kernel.#open と同じです

@param options ハッシ...

Kernel#dir_config(target, idefault = nil, ldefault = nil) -> [String, String] (203)

configure オプション --with-TARGET-dir, --with-TARGET-include, --with-TARGET-lib をユーザが extconf.rb に指定できるようにします。

configure オプション
--with-TARGET-dir,
--with-TARGET-include,
--with-TARGET-lib
をユーザが extconf.rb に指定できるようにします。

--with-TARGET-dir オプションは
システム標準ではない、
ヘッダファイルやライブラリがあるディレクトリをまとめて指定するために使います。
ユーザが extconf.rb に --with-TARGET-dir=PATH を指定したときは
$CFLAGS に "-IPATH/include" を、
$LDFLAGS に "-LPATH/lib" を、
それぞれ追加し...

Kernel#install_files(mfile, ifiles, map = nil, srcprefix = nil) -> [] (203)

このメソッドは create_makefile, install_rb が使用します。 内部用のメソッドです。

このメソッドは create_makefile, install_rb が使用します。
内部用のメソッドです。

@param mfile Makefile を表す File のインスタンスです。

@param ifiles インストールするファイルのリストを指定します。

@param map ???

@param srcprefix ソースディレクトリを指定します。

絞り込み条件を変える

Kernel.#select(reads, writes = [], excepts = [], timeout = nil) -> [[IO]] | nil (203)

IO.select と同じです。

IO.select と同じです。

@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照
@see IO.select

Kernel.#print(*arg) -> nil (138)

引数を順に標準出力 $stdout に出力します。引数が与えられない時には変数 $_ の値を出力します。

...ただし、nil に対しては文字列 "nil" を出力します

変数 $, (出力フィールドセパレータ)に nil
ない値がセットされている時には、各引数の間にその文字列を出力します。
変数 $\ (出力レコードセパレータ)に nil でな
い値が...
...失敗した場合に発生します。

print "Hello, world!"
print "Regexp is",/ant/
print nil
print "\n"
#=> Hello, world!Regexp is(?-mix:ant)nil

$_ = "input"
$, = "<and>"
$\ = "<end>\n"
print
print "AA","BB"
#=> input<end>
#=> AA<and>BB<end>
@see Kernel.#puts,Kernel.#p...

Kernel#modified?(target, times) -> Time | nil (134)

target が times の全ての要素よりも新しい場合は target の更新時刻を返します。 そうでない場合は nil を返します。target が存在しない場合も nil を返します。

...times の全ての要素よりも新しい場合は target の更新時刻を返します。
そうでない場合は nil を返します。target が存在しない場合も nil を返します。

@param target 対象のファイル名を指定します。

@param times Time の配列か Time を...

Kernel.#warn(message) -> nil (130)

message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。

...message を 標準エラー出力 $stderr に出力します。 $VERBOSE
フラグ が nil のときは何も出力しません。

文字列以外のオブジェクトが引数として与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。

...
...です。
@raise IOError 標準エラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。

warn "caution!" #=> caution!
$VERBOSE = nil
warn "caution!" # 何もしない

@see $stderr,$VERBOSE...

Kernel$$1 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

絞り込み条件を変える

Kernel$$10 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$11 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$2 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$3 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$4 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

絞り込み条件を変える

Kernel$$5 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$6 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$7 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$8 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

Kernel$$9 -> String | nil (128)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_matc...

絞り込み条件を変える

Kernel.#trace_var(varname) {|new_val| .... } -> nil (127)

グローバル変数 varname への代入のフックを登録します。

...、hook に nil
指定するか、Kernel.#untrace_var を用います。

hook が nil ならば、設定されていた
hook をすべて解除してその配列を返します(ブロックで登録されていれば
Proc オブジェクトで返されます)
それ以外は、nil を返しま...
... nil を返します。解除した場合は解除した
フックを並べた配列を返します。

trace_var(:$v){|val| puts "hook: $v=#{val.inspect}" }
$v = 1 #=> hook: $v=1
$v = "foo" #=> hook: $v="foo"
$v.upcase!
p $v #=> "FOO"

@see Kernel.#unt...

Kernel.#trace_var(varname, hook) -> nil (127)

グローバル変数 varname への代入のフックを登録します。

...、hook に nil
指定するか、Kernel.#untrace_var を用います。

hook が nil ならば、設定されていた
hook をすべて解除してその配列を返します(ブロックで登録されていれば
Proc オブジェクトで返されます)
それ以外は、nil を返しま...
... nil を返します。解除した場合は解除した
フックを並べた配列を返します。

trace_var(:$v){|val| puts "hook: $v=#{val.inspect}" }
$v = 1 #=> hook: $v=1
$v = "foo" #=> hook: $v="foo"
$v.upcase!
p $v #=> "FOO"

@see Kernel.#unt...

Kernel.#caller(level_num = 1) -> [String] | nil (126)

level_num 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...ます。

指定した level_num 段上が存在しない場合は nil を返します。

@param level_num long の範囲を超えない正の整数でスタックレベルを指定します。
@see Kernel.#set_trace_func,Kernel.#raise

def foo
p caller(0)
p caller(1)
p calle...
...r
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13"]
# ["-:10:in `bar'", "-:13"]
# ["-:13"]
# []
# nil

以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。

def parse_caller...
...bar
foo
p parse_caller(caller.first)
end

bar
p parse_caller(caller.first)

#=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil

以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。

$DEBUG = true

def debug(*args)...
...> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# []
# nil

以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。

def parse_caller...

Kernel.#gets(rs = $/) -> String | nil (126)

ARGFから一行読み込んで、それを返します。 行の区切りは引数 rs で指定した文字列になります。

...ARGFから一行読み込んで、それを返します。
行の区切りは引数 rs で指定した文字列になります。

rs に nil を指定すると行区切りなしとみなしてファイルの内容を
すべて読み込みます。ARGVに複数のファイル名が存在する場...
... nil を返します。
@raise Errno::EXXX 読み込みに失敗した場合に発生します。

---main.rb---
ARGV << 'b.txt' << 'c.txt'
p gets #=> "hello\n"
p gets(nil) #=> "it\ncommon\n"
p gets("") #=> "ARGF\n\n"
p gets('、') #=> "スクリプトに指定した引数 (Kernel::AR...
...想ファイルを表すオブジェクトです。 \n"
p gets #=> nil
p readline # end of file reached (EOFError)
--- b.txt ---
hello
it
common
--- c.txt ---
ARGF

スクリプトに指定した引数 (Kernel::ARGV を参照) をファイル名と
みなして、それらの...

Kernel.#puts(*arg) -> nil (126)

引数と改行を順番に 標準出力 $stdout に出力します。 引数がなければ改行のみを出力します。

...ェクトを最初に to_ary により配列へ、
次に to_s メソッドにより文字列へ変換を試みます。
ただし、nil に対しては文字列 "nil" を出力します
末尾が改行で終っている引数や配列の要素に対しては puts 自身
は改行を出力しませ...
...した場合に発生します。

puts "foo", "bar\n", "baz"
puts "" # 改行のみ出力
puts # 改行のみ出力
puts nil
puts ["oui", "non"]
#=> foo
# bar
# baz
#
#
# nil
# oui
# non

@see Kernel.#print, Kernel.#p, IO#puts...

絞り込み条件を変える

Kernel.#__callee__ -> Symbol | nil (125)

現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。

...現在のメソッド名を返します。
メソッドの外で呼ばれると nil を返します。

def foo
p __method__
end
foo #=> :foo
p __method__ #=> nil...

Kernel.#__method__ -> Symbol | nil (125)

現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。

...現在のメソッド名を返します。
メソッドの外で呼ばれると nil を返します。

def foo
p __method__
end
foo #=> :foo
p __method__ #=> nil...

Kernel$$& -> String | nil (124)

現在のスコープで最後に成功した正規表現のパターンマッチでマッチした文字列です。 最後のマッチが失敗していた場合には nil となります。

...最後のマッチが失敗していた場合には nil となります。

Regexp.last_match[0] と同じです。

この変数はローカルスコープかつスレッドローカル、読み取り専用です。
Ruby起動時の初期値は nil です。

=== 例
str = '<p><a href="http://exam...
<< 1 2 3 ... > >>