るりまサーチ (Ruby 3.3)

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

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d
  4. rsa d=
  5. matrix d

ライブラリ

キーワード

検索結果

<< 1 2 > >>

Kernel#have_header(header, preheaders = nil) -> bool (18904.0)

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header が存在する場合は、グローバル変数 $defs に
"-DHAVE_header" を追加して true を返します。ヘッダファイル header が存
在しない場合は $defs は変更せず false を返します。

@param header 検査したいヘッダファイルを指定します。

@param preheaders ヘッダファイルを検査する前に読み込んでおくヘッダファイルを指定します。

Kernel#have_header(header, preheaders = nil) { ... } -> bool (18904.0)

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header がシステムに存在するかどうか検査します。

ヘッダファイル header が存在する場合は、グローバル変数 $defs に
"-DHAVE_header" を追加して true を返します。ヘッダファイル header が存
在しない場合は $defs は変更せず false を返します。

@param header 検査したいヘッダファイルを指定します。

@param preheaders ヘッダファイルを検査する前に読み込んでおくヘッダファイルを指定します。

Kernel#create_header(header = "extconf.h") -> String (18604.0)

Kernel#have_func, Kernel#have_header などの検査結果を元に、 ヘッダファイルを生成します。

...
Kernel
#have_func, Kernel#have_header などの検査結果を元に、
ヘッダファイルを生成します。

このメソッドは extconf.rb の最後で呼び出すようにしてください。

@param header ヘッダファイルの名前を指定します。

@return ヘッダファイ...

Kernel#depend_rules(depend) -> Array (18604.0)

ファイルの依存関係の書かれた depend ファイルの内容を処理します。

ファイルの依存関係の書かれた depend ファイルの内容を処理します。

@param depend depend ファイルの内容を指定します。

@return 見つかった依存関係を Makefile 形式で返します。

Kernel#desc(description) -> String (18604.0)

直後の Rake タスクの説明を登録します。

直後の Rake タスクの説明を登録します。

@param description 直後のタスクの説明を指定します。

例:
desc "Run the Unit Tests"
task :test => [:build] do
runtests
end

絞り込み条件を変える

Kernel#directory(dir) -> () (18604.0)

与えられたディレクトリを作成するタスクを定義します。

与えられたディレクトリを作成するタスクを定義します。

@param dir 作成するディレクトリを指定します。

例:
directory 'testdata/doc'

Kernel.#BigDecimal(s, exception: true) -> BigDecimal | nil (18604.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

引数で指定した値を表す BigDecimal オブジェクトを生成します。

@param s 数値を表現する初期値を文字列、Integer、
Float、Rational、BigDecimal オブジェクトのい
ずれかで指定します。
文字列中のスペースは無視されます。また、判断できない文字が出現
した時点で文字列は終了したものとみなされます。

@param n 必要な有効桁数(self の最大有効桁数)を整数で指定します。 n が
0 または省略されたときは、n の値は s の有効桁数とみなされます。...

Kernel.#BigDecimal(s, n, exception: true) -> BigDecimal | nil (18604.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

引数で指定した値を表す BigDecimal オブジェクトを生成します。

@param s 数値を表現する初期値を文字列、Integer、
Float、Rational、BigDecimal オブジェクトのい
ずれかで指定します。
文字列中のスペースは無視されます。また、判断できない文字が出現
した時点で文字列は終了したものとみなされます。

@param n 必要な有効桁数(self の最大有効桁数)を整数で指定します。 n が
0 または省略されたときは、n の値は s の有効桁数とみなされます。...

Kernel.#binding -> Binding (18604.0)

変数・メソッドなどの環境情報を含んだ Binding オブジェクトを 生成して返します。通常、Kernel.#eval の第二引数として使います。

...変数・メソッドなどの環境情報を含んだ Binding オブジェクトを
生成して返します。通常、Kernel.#eval の第二引数として使います。

//emlist[例][ruby]{
def foo
a = 1
binding
end

eval("p a", foo) #=> 1
//}

@see Kernel.#eval,Object::TOPLEVEL_BINDING...

Kernel$$-d -> bool (18343.0)

この値が真のときはインタプリタがデバッグモードになります。

この値が真のときはインタプリタがデバッグモードになります。

コマンドラインオプション -d でセットされます。
スクリプトから代入することもできます。

デバッグモードでは、通常モードに比べて以下の違いがあります。

* 通常時はいずれかのスレッドが例外によって終了しても
他のスレッドは実行を続けますが、デバッグモードでは
いずれかのスレッドが例外によって終了した時に
インタプリタ全体が中断されるようになります。
Thread.abort_on_exception を
true にセットするのと同じ効果です。
* Thread.abort_on_excep...

絞り込み条件を変える

Kernel$$DEBUG -> bool (18343.0)

この値が真のときはインタプリタがデバッグモードになります。

この値が真のときはインタプリタがデバッグモードになります。

コマンドラインオプション -d でセットされます。
スクリプトから代入することもできます。

デバッグモードでは、通常モードに比べて以下の違いがあります。

* 通常時はいずれかのスレッドが例外によって終了しても
他のスレッドは実行を続けますが、デバッグモードでは
いずれかのスレッドが例外によって終了した時に
インタプリタ全体が中断されるようになります。
Thread.abort_on_exception を
true にセットするのと同じ効果です。
* Thread.abort_on_excep...

Kernel.#lambda { ... } -> Proc (18322.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...生します。][ruby]{
pr = Proc.new { break }
(1..5).each(&pr)
//}

===[a:lambda_proc] lambda と proc と Proc.new とイテレータの違い

Kernel
.#lambda と Proc.new はどちらも Proc クラスのインスタンス(手続きオブジェクト)を生成しますが、
生成された手...
...。 lambda の生成する手続きオブジェクトのほうが
よりメソッドに近い働きをするように設計されています。

Kernel
.#proc は Proc.new と同じになります。
引数に & を付けることで手続きオブジェクト化したブロックは、Proc.new で...

Kernel#DelegateClass(superclass) -> object (18304.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。

@param superclass 委譲先となるクラス

例:

//emlist{
require 'delegate'

class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}

Kernel#Digest(name) -> object (18304.0)

"MD5"や"SHA1"などのダイジェストを示す文字列 name を指定し、 対応するダイジェストのクラスを取得します。

...
Digest::MD5などを直接呼び出すと問題があるときはこのメソッドを使
うか、起動時に使用するライブラリを Kernel.#require してください。

@param name "MD5"や"SHA1"などのダイジェストを示す文字列を指定します。
@return Digest::MD5や...

Kernel#cc_command(opt = "") -> String (18304.0)

実際にコンパイルする際に使用するコマンドを返します。

実際にコンパイルする際に使用するコマンドを返します。

@param opt コンパイラに与える追加のコマンドライン引数を指定します。

@see RbConfig.expand

絞り込み条件を変える

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

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 (18304.0)

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#chmod -> () (18304.0)

ファイルのアクセス権を変更します。

ファイルのアクセス権を変更します。

Change the mode of each FILE to OCTAL-MODE.

ruby -run -e chmod -- [OPTION] OCTAL-MODE FILE

-v 詳細表示

@see chmod(1)

Kernel#cpp_command(outfile, opt = "") -> String (18304.0)

実際にプリプロセッサを実行する際に使用するコマンドを返します。

実際にプリプロセッサを実行する際に使用するコマンドを返します。

@param outfile 出力ファイルの名前を指定します。

@param opt プリプロセッサに与える追加のコマンドライン引数を指定します。

@see RbConfig.expand

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

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#dummy_makefile(srcdir) -> String (18304.0)

ダミーの Makefile を作成します。

ダミーの Makefile を作成します。

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

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

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

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

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

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

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

@param path パスを指定します。デフォルトは環境変数 PATH です。
環境変数 PATH が定義されていない場合は /usr/local/bin,
/usr/ucb, /usr/bin, /bin を使います。

Kernel#find_header(header, *paths) -> bool (18304.0)

与えられた paths から header を検索し、見つかった場合は真を返します。 そうでない場合は偽を返します。

与えられた paths から header を検索し、見つかった場合は真を返します。
そうでない場合は偽を返します。

ヘッダが見つかったディレクトリをコンパイラに渡すコマンドラインオプショ
ンに追加します(-I オプションを経由します)。

@param header ヘッダを指定します。

@param paths ヘッダを検索するパスを指定します。

Kernel#find_library(lib, func, *paths) -> bool (18304.0)

関数 func が定義されたライブラリ lib を探します。

...査してもライブラリ lib が見つからないときは、
変数を変更せず false を返します。

paths を指定しないときは Kernel#have_library と同じ動作です。

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

@param func 関数名を指定します。...

Kernel#find_library(lib, func, *paths) { ... } -> bool (18304.0)

関数 func が定義されたライブラリ lib を探します。

...査してもライブラリ lib が見つからないときは、
変数を変更せず false を返します。

paths を指定しないときは Kernel#have_library と同じ動作です。

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

@param func 関数名を指定します。...

絞り込み条件を変える

Kernel#find_type(type, opt, *headers) -> Array (18304.0)

静的な型 type がシステムに存在するかどうか検査します。

...な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

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

@see Kernel#have_type...

Kernel#find_type(type, opt, *headers) { ... } -> Array (18304.0)

静的な型 type がシステムに存在するかどうか検査します。

...な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

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

@see Kernel#have_type...

Kernel#have_devel? -> bool (18304.0)

開発環境がインストールされているかどうか検査するために何もしない実行ファ イルを作成しようと試みます。成功した場合は、真を返します。失敗した場合 は、偽を返します。

開発環境がインストールされているかどうか検査するために何もしない実行ファ
イルを作成しようと試みます。成功した場合は、真を返します。失敗した場合
は、偽を返します。

Kernel#httpd -> () (18304.0)

WEBrick HTTP server を起動します。

WEBrick HTTP server を起動します。

ruby -run -e httpd -- [OPTION] [DocumentRoot]

--bind-address=ADDR バインドアドレスを指定します
--port=NUM ポート番号を指定します
--max-clients=MAX 同時接続数の最大値
--temp-dir=DIR 一時ディレクトリを指定します
--do-not-reverse-lookup 逆引きを無効にします
--requ...

Kernel#link_command(ldflags, opt = "", libpath = $DEFLIBPATH|$LIBPATH) -> String (18304.0)

実際にリンクする際に使用するコマンドを返します。

実際にリンクする際に使用するコマンドを返します。

@param ldflags LDFLAGS に追加する値を指定します。

@param opt LIBS に追加する値を指定します。

@param libpath LIBPATH に指定する値を指定します。

@see RbConfig.expand

絞り込み条件を変える

Kernel#mkdir -> () (18304.0)

ディレクトリを作成します。

ディレクトリを作成します。


ruby -run -e mkdir -- [OPTION] DIR

-p ディレクトリが存在してもエラーになりません。
必要であれば親ディレクトリも作成します。
-v 詳細表示

@see mkdir(1)

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

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

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

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

@param times Time の配列か Time を一つ指定します。

Kernel#rmdir -> () (18304.0)

空のディレクトリを削除します。

空のディレクトリを削除します。

ruby -run -e rmdir -- [OPTION] DIR

-p DIR で指定されたディレクトリとその上位ディレクトリを削除します
-v 詳細表示

@see rmdir(1)

Kernel#try_do(src, command, *opts) -> () (18304.0)

@param src C プログラムのソースコードを指定します。

...aram src C プログラムのソースコードを指定します。

@param command コマンドを指定します。

@param opts オプションを Hash で指定します。

@raise RuntimeError 開発環境がインストールされていない場合に発生します。

@see Kernel#xsystem...

Kernel#try_do(src, command, *opts) { ... } -> () (18304.0)

@param src C プログラムのソースコードを指定します。

...aram src C プログラムのソースコードを指定します。

@param command コマンドを指定します。

@param opts オプションを Hash で指定します。

@raise RuntimeError 開発環境がインストールされていない場合に発生します。

@see Kernel#xsystem...

絞り込み条件を変える

Kernel$$CHILD_STATUS -> Process::Status | nil (18304.0)

$? の別名

$? の別名

require "English"

out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`

if $CHILD_STATUS.to_i == 0
print "wget success\n"
out.split(/\n/).each { |line|
printf "%s\n", line
}
else
print "wget failed\n"
end

Kernel$$DEFAULT_INPUT -> IO (18304.0)

$< の別名

$< の別名

require "English"
while line = $DEFAULT_INPUT.gets
p line
end
# end of sample.rb

ruby sample.rb < /etc/passwd
# => "hoge:x:500:501::/home/hoge:/bin/bash\n"
...

Kernel$$DEFAULT_OUTPUT -> IO (18304.0)

$> の別名

$> の別名

require "English"

dout = $DEFAULT_OUTPUT.dup
$DEFAULT_OUTPUT.reopen("out.txt", "w")
print "foo"
$DEFAULT_OUTPUT.close
$DEFAULT_OUTPUT = dout
p "bar" # => bar
p File.read("out.txt") #=> foo

Kernel$$FIELD_SEPARATOR -> String | nil (18304.0)

$; の別名

$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]

Kernel$$INPUT_RECORD_SEPARATOR -> String | nil (18304.0)

$/ の別名

$/ の別名

require "English"

$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]

__END__
ugo|ego|fogo

絞り込み条件を変える

Kernel$$LAST_READ_LINE -> String | nil (18304.0)

$_ の別名

$_ の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

ruby -rEnglish -ne'p $LAST_READ_LINE' a.txt
#=>
"1 e\n"
"2 f\n"
"3 g\n"
"4 h\n"
"5 i\n"

Kernel$$LDFLAGS -> String (18304.0)

拡張ライブラリをリンクするときのリンカのオプション、 ライブラリファイルのディレクトリを指定する文字列です。

...拡張ライブラリをリンクするときのリンカのオプション、
ライブラリファイルのディレクトリを指定する文字列です。

Kernel
#find_library または Kernel#dir_config
の検査が成功すると、$LDFLAGS の値に "-Ldir" を追加します。...

Kernel$$PID -> Integer (18304.0)

$$ の別名

$$ の別名

require "English"

p sprintf("something%s", $PID) #=> "something5543" など

Kernel$$PROCESS_ID -> Integer (18304.0)

$$ の別名

$$ の別名

require "English"

p sprintf("something%s", $PID) #=> "something5543" など

Kernel$$archdir -> String (18304.0)

マシン固有のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/バージョン/arch" です。

マシン固有のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/バージョン/arch" です。

絞り込み条件を変える

Kernel$$defs -> [String] (18304.0)

拡張ライブラリをコンパイルするときのマクロ定義を指定する配列です。

...例えば

["-DHAVE_FUNC", "-DHAVE_HEADER_H"]

のような形式の配列です。

Kernel
#have_func または Kernel#have_header
を呼び出すと、その検査結果が $defs に追加されます。

Kernel
#create_header
はこの変数の値を参照してヘッダファイルを生成し...

Kernel$$hdrdir -> String (18304.0)

Ruby のヘッダファイル ruby.h が存在するディレクトリです。 通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。

Ruby のヘッダファイル ruby.h が存在するディレクトリです。
通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。

Kernel$$libdir -> String (18304.0)

Ruby のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/バージョン" です。

Ruby のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/バージョン" です。

Kernel$$sitearchdir -> String (18304.0)

サイト固有でかつマシン固有のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/site_ruby/バージョン/arch" です。

サイト固有でかつマシン固有のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/site_ruby/バージョン/arch" です。

Kernel$$sitelibdir -> String (18304.0)

サイト固有のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/site_ruby/バージョン" です。

サイト固有のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/site_ruby/バージョン" です。

絞り込み条件を変える

Kernel$$srcdir -> String (18304.0)

Ruby インタプリタを make したときのソースディレクトリです。

Ruby インタプリタを make したときのソースディレクトリです。

Kernel$$stderr -> object (18304.0)

標準エラー出力です。

...標準エラー出力です。

Ruby インタプリタが出力するエラーメッセージや
警告メッセージ、Kernel.#warn の出力先となります。
初期値は Object::STDERR です。

$stderr に代入するオブジェクトには
write という名前のメソッドが定義...

Kernel$$stdin -> object (18304.0)

標準入力です。

...# 入力する
$stdin = STDIN # 元に戻す
//}

ただし、Kernel.#gets など、特定の組み込みメソッドは
$stdin オブジェクトにメソッドを転送して実装されています。
従って、Kernel.#gets などが正しく動作するには、
$stdin オブジェク...

Kernel$$topdir -> String (18304.0)

拡張ライブラリを make するためのヘッダファイル、 ライブラリ等が存在するディレクトリです。 通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。

拡張ライブラリを make するためのヘッダファイル、
ライブラリ等が存在するディレクトリです。
通常は $archdir と同じで、"/usr/local/lib/ruby/バージョン/arch" です。

Kernel.#__dir__ -> String | nil (18304.0)

現在のソースファイル(__FILE__)のあるディレクトリ名を正規化された絶対パ スで返します。シンボリックリンクも解決されます。また、__FILE__ が nil の場合は nil を返します。

現在のソースファイル(__FILE__)のあるディレクトリ名を正規化された絶対パ
スで返します。シンボリックリンクも解決されます。また、__FILE__ が nil
の場合は nil を返します。

絞り込み条件を変える

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

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

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

//emlist[例][ruby]{
def foo
p __method__
end
alias :bar :foo
foo #=> :foo
bar #=> :foo
p __method__ #=> nil
//}

現在のメソッド名が alias されたメソッドの場合でも alias 元のメソッド名
を返します。

Kernel.#autoload(const_name, feature) -> nil (18304.0)

定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。

...定数 const_name を最初に参照した時に feature を
Kernel
.#require するように設定します。

const_name には、 "::" 演算子を含めることはできません。
ネストした定数を指定する方法は Module#autoload を参照してください。

const_name が aut...
...対象を指定します。
@raise LoadError featureのロードに失敗すると発生します。

//emlist[][ruby]{
# ------- /tmp/foo.rb ---------
class Bar
end
# ----- end of /tmp/foo.rb ----

autoload :Bar, '/tmp/foo'
p Bar #=> Bar
//}

@see Kernel.#autoload?,Module#autoload,Kernel.#require...

Kernel.#autoload?(const_name) -> String | nil (18304.0)

const_name が Kernel.#autoload 設定されているか調べます。

...const_name が Kernel.#autoload 設定されているか調べます。

autoload 設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。

autoload 設定されていないか、ロード済みなら nil を返し...
...lass Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?(:Bar) #=> "/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}

@see Kernel.#autoload...

Kernel.#load(file, priv = false) -> true (18304.0)

Ruby プログラム file をロードして実行します。再ロード可能です。

...
@raise LoadError ロードに失敗した場合に発生します。
@see Kernel.#require

=== require と load の違い

Kernel
.#require は同じファイルは一度だけしかロードしませんが、
Kernel
.#load は無条件にロードします。
また、require は拡張子.rb や...

Kernel.#rand(max = 0) -> Integer | Float (18304.0)

擬似乱数を発生させます。

...を、少なくとも片方が実数の場合は実数を返します。
range に含まれる数が無い場合は nil を返します。

まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。

擬似乱数生成器として Random クラスオブジェクトを使用...
...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(range) -> Integer | Float | nil (18304.0)

擬似乱数を発生させます。

...を、少なくとも片方が実数の場合は実数を返します。
range に含まれる数が無い場合は nil を返します。

まだ Kernel.#srand が呼ばれていなければ自動的に呼び出します。

擬似乱数生成器として Random クラスオブジェクトを使用...
...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.#readline(rs = $/) -> String (18304.0)

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

...t ---
hello
it
common
# --- c.txt ---
ARGF
# スクリプトに指定した引数 (Object::ARGV を参照) をファイル名と
# みなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェクトです。
//}


@see $/,ARGF,Kernel.#readlines,Kernel.#gets...

Kernel.#readlines(rs = $/) -> [String] (18304.0)

ARGFを Kernel.#gets(rs) でEOFまで読み込んで、その各行を要素としてもつ配列を返します。 行の区切りは引数 rs で指定した文字列になります。

...ARGFを Kernel.#gets(rs) でEOFまで読み込んで、その各行を要素としてもつ配列を返します。
行の区切りは引数 rs で指定した文字列になります。

rs に nil を指定すると行区切りなしとみなします。
空文字列 "" を指定すると連続...
...s("") #=> ["hello\nit\n\n", "common\n", "hello\nit\n\n", "common\n"]

ARGV << 'b.txt' << 'b.txt'
p readlines('it') #=> ["hello\nit", "\n\ncommon\n", "hello\nit", "\n\ncommon\n"]
p readlines #=> []
//}

//emlist[b.txt][ruby]{
hello
it

common
//}

@see $/,ARGF,Kernel.#gets, Kernel.#readline...

Kernel.#srand -> Integer (18304.0)

Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。

...
Kernel
.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。

seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱いま...
...す。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。

seed が省略された時には
現在の時刻やプロセス ID、srand を呼び出した回数、
また可能なら /dev/urandom から読み出したデータなどを元に種を作ります...
...6) #=> 3
p rand(0) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251

seeds << srand(num)

p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701

seeds << srand

p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}

@see Kernel.#rand...

Kernel.#srand(seed) -> Integer (18304.0)

Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。

...
Kernel
.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。

seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱いま...
...す。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。

seed が省略された時には
現在の時刻やプロセス ID、srand を呼び出した回数、
また可能なら /dev/urandom から読み出したデータなどを元に種を作ります...
...6) #=> 3
p rand(0) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251

seeds << srand(num)

p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701

seeds << srand

p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}

@see Kernel.#rand...

絞り込み条件を変える

Kernel$$LOAD_PATH -> [String] (9394.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...

Kernel$$KCODE -> object (9322.0)

通常のグローバル変数です。

通常のグローバル変数です。

Ruby 2.7 以前は特殊変数でしたが、Ruby 3.0 から通常のグローバル変数になりました。
任意のオブジェクトを代入して nil 以外の値に設定できます。

@see spec/rubycmd

Kernel$$stdout -> object (9322.0)

標準出力です。

...標準出力です。

組み込み関数 Kernel.#print、Kernel.#puts や
Kernel
.#p などのデフォルトの出力先となります。
初期値は Object::STDOUT です。
コマンドラインオプションオプション -i を指定した場合には
読み込み元と同じ名前のフ...

Kernel$$LOADED_FEATURES -> [String] (9304.0)

Kernel.#require でロードされたファイル名を含む配列です。

...
Kernel
.#require でロードされたファイル名を含む配列です。

Kernel
.#require で同じファイルを
複数回ロードしないようにするためのロックとして使われます。

この変数はグローバルスコープです。...

Kernel$$OUTPUT_FIELD_SEPARATOR -> String | nil (9304.0)

$, の別名

$, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"

絞り込み条件を変える

Kernel$$OUTPUT_RECORD_SEPARATOR -> String | nil (9304.0)

$\ の別名

$\ の別名

require "English"

print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby sample.rb
hoge
huga
fuge
ugo

Kernel.#proc { ... } -> Proc (9022.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...生します。][ruby]{
pr = Proc.new { break }
(1..5).each(&pr)
//}

===[a:lambda_proc] lambda と proc と Proc.new とイテレータの違い

Kernel
.#lambda と Proc.new はどちらも Proc クラスのインスタンス(手続きオブジェクト)を生成しますが、
生成された手...
...。 lambda の生成する手続きオブジェクトのほうが
よりメソッドに近い働きをするように設計されています。

Kernel
.#proc は Proc.new と同じになります。
引数に & を付けることで手続きオブジェクト化したブロックは、Proc.new で...

Kernel$$FS -> String | nil (9004.0)

$; の別名

$; の別名

require "English"

str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]

Kernel$$RS -> String | nil (9004.0)

$/ の別名

$/ の別名

require "English"

$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]

__END__
ugo|ego|fogo

Kernel#enable_config(config, default) {|config, default| ... } -> bool | String (604.0)

configure のオプションを検査します。

configure のオプションを検査します。

configure のオプションに --enable-<config> が指定された場合は、真を返し
ます。--disable-<config> が指定された場合は。偽を返します。どちらでもな
い場合は default を返します。

これはデバッグ情報などのカスタム定義を、追加するのに役立ちます。

@param config configure のオプションの名前を指定します。

@param default デフォルト値を返します。


require 'mkmf'
if enable_config("debug")
...

絞り込み条件を変える

Kernel#with_config(config, default = nil) {|config, default| ... } -> bool | String (604.0)

configure のオプションを検査します。

configure のオプションを検査します。

configure のオプションに --with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。

これはデバッグ情報などのカスタム定義を、追加するのに役立ちます。

@param config configure のオプションの名前を指定します。

@param default デフォルト値を返します。


require 'mkmf'
if with_config("debug")
$defs...

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

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

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

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

=== sprintf フォーマット

Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)...
...tf("%p", /e+/) #=> "/e+/"
//}


: d
: i

引数の数値を10進表現の整数として出力します。

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

//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint...

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

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

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

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

=== sprintf フォーマット

Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)...
...tf("%p", /e+/) #=> "/e+/"
//}


: d
: i

引数の数値を10進表現の整数として出力します。

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

//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint...

Kernel.#`(command) -> String (322.0)

command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。

...タスを得るには、$? を参照します。

コマンドの出力を得る必要がなく、単にコマンドを実行したいだけなら
Kernel
.#system を使います。特に端末を制御するコマンドでは
`command` は失敗するかもしれません。

d:spec/literal#command...
...Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。

//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}

@see Kernel.#system,Kernel.#exec,Kernel.#spawn...

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (322.0)

単体のファイルでファイルテストを行います。

単体のファイルでファイルテストを行います。

@param cmd 以下に示す文字リテラル、文字列、あるいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返します。

以下は cmd として指定できる文字リテラルとその意味です。

: ?r
ファイルを実効 uid で読むことができる
: ?w
ファイルに実効 uid で書くことができる
: ?x
ファイルを...

絞り込み条件を変える

Kernel.#test(cmd, file1, file2) -> bool (307.0)

2ファイル間のファイルテストを行います。

2ファイル間のファイルテストを行います。

@param cmd 以下に示す文字リテラル、文字列、あるいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 真偽値を返します。

以下は cmd として指定できる文字リテラルとその意味です。

: ?=
ファイル1とファイル2の最終更新時刻が等しい
: ?>
フ...

Kernel#arg_config(config, default) { ... } -> object | String | true | nil (304.0)

configure オプション --config の値を返します。

configure オプション --config の値を返します。

@param config オプションを文字列で指定します。

@param default 引数 config で指定したオプションのデフォルト値を指定します。

@return オプションが指定されてた場合は true を、指定されなかった場合は
nil を返します。
引数 default、あるいはブロックを指定すると、オプションが指定さ
れていない場合に引数 default の値かブロックの評価結果を返します
(両方指定した場合はブロックが優先されます)...

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

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

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

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

例えば、

require 'mkmf'
check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型を指定します。

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

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

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

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

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

例えば、

require 'mkmf'
check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型を指定します。

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

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

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) { ... } (304.0)

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#enable_config(config, default) -> bool | String (304.0)

configure のオプションを検査します。

configure のオプションを検査します。

configure のオプションに --enable-<config> が指定された場合は、真を返し
ます。--disable-<config> が指定された場合は。偽を返します。どちらでもな
い場合は default を返します。

これはデバッグ情報などのカスタム定義を、追加するのに役立ちます。

@param config configure のオプションの名前を指定します。

@param default デフォルト値を返します。


require 'mkmf'
if enable_config("debug")
...

Kernel#have_func(func, headers = nil) -> bool (304.0)

関数 func がシステムに存在するかどうかを検査します。

関数 func がシステムに存在するかどうかを検査します。

関数 func が存在すれば $defs に "-DHAVE_func" (func は大文字に変
換されます) を追加して true を返します。関数 func が見つからないときは
グローバル変数を変更せず false を返します。

@param func 関数名を指定します。

@param headers 関数 func を使用するのに必要なヘッダファイル名を指定しま
す。これは関数の型をチェックするためではなく、関数が実際
にはマクロで定義されている場合などの...

Kernel#have_func(func, headers = nil) { ... } -> bool (304.0)

関数 func がシステムに存在するかどうかを検査します。

関数 func がシステムに存在するかどうかを検査します。

関数 func が存在すれば $defs に "-DHAVE_func" (func は大文字に変
換されます) を追加して true を返します。関数 func が見つからないときは
グローバル変数を変更せず false を返します。

@param func 関数名を指定します。

@param headers 関数 func を使用するのに必要なヘッダファイル名を指定しま
す。これは関数の型をチェックするためではなく、関数が実際
にはマクロで定義されている場合などの...

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

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

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

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

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

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

絞り込み条件を変える

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

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

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

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

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

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

Kernel#have_macro(macro, headers = nil, opt = "") -> bool (304.0)

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。 そうでない場合は偽を返します。

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。
そうでない場合は偽を返します。

@param macro マクロの名前を指定します。

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

@param opt C コンパイラに渡すコマンドライン引数を指定します。

Kernel#have_macro(macro, headers = nil, opt = "") { ... } -> bool (304.0)

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。 そうでない場合は偽を返します。

与えられた macro が共通のヘッダファイルか headers に定義されている場合は真を返します。
そうでない場合は偽を返します。

@param macro マクロの名前を指定します。

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

@param opt C コンパイラに渡すコマンドライン引数を指定します。

Kernel#have_struct_member(type, member, headers = nil) -> bool (304.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

Kernel#have_struct_member(type, member, headers = nil) { ... } -> bool (304.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

絞り込み条件を変える

Kernel#have_type(type, headers = nil, opt = "") -> bool (304.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

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

@param opt ...

Kernel#have_type(type, headers = nil, opt = "") { ... } -> bool (304.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

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

@param opt ...

Kernel#have_var(var, headers = nil) -> bool (304.0)

変数 var がシステムに存在するかどうか検査します。

変数 var がシステムに存在するかどうか検査します。

変数 var がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_var" を追加し、真を返します。変数 var がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_var('foo') # => true

である場合、HAVE_FOO というプリプロセッサマクロをコンパイラに渡します。

@param var 検査したい変数名を指定します。

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

Kernel#have_var(var, headers = nil) { ... } -> bool (304.0)

変数 var がシステムに存在するかどうか検査します。

変数 var がシステムに存在するかどうか検査します。

変数 var がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_var" を追加し、真を返します。変数 var がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_var('foo') # => true

である場合、HAVE_FOO というプリプロセッサマクロをコンパイラに渡します。

@param var 検査したい変数名を指定します。

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

Kernel#install_rb(mfile, dest, srcdir = nil) -> Array (304.0)

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

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

ディレクトリ srcdir/lib 配下の Ruby スクリプト (*.rb ファイル)
を dest にインストールするための Makefile 規則を mfile に出力します。

srcdir/lib のディレクトリ構造はそのまま dest 配下に反映されます。

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

@param dest インストールする先のディレクトリを指定します。

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

絞り込み条件を変える

<< 1 2 > >>