312件ヒット
[1-100件を表示]
(0.109秒)
別のキーワード
種類
- モジュール関数 (276)
- 変数 (24)
- インスタンスメソッド (12)
キーワード
-
$ INPUT _ RECORD _ SEPARATOR (12) -
$ RS (12) - Array (12)
- Hash (12)
- caller (36)
-
caller
_ locations (24) - exec (48)
-
install
_ files (12) - readlines (12)
- select (12)
- spawn (48)
- srand (24)
- system (48)
検索結果
先頭5件
-
Kernel
. # select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (301.0) -
IO.select と同じです。
IO.select と同じです。
@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照
@see IO.select -
Kernel
# install _ files(mfile , ifiles , map = nil , srcprefix = nil) -> [] (202.0) -
このメソッドは create_makefile, install_rb が使用します。 内部用のメソッドです。
このメソッドは create_makefile, install_rb が使用します。
内部用のメソッドです。
@param mfile Makefile を表す File のインスタンスです。
@param ifiles インストールするファイルのリストを指定します。
@param map ???
@param srcprefix ソースディレクトリを指定します。 -
Kernel
. # Hash(arg) -> Hash (117.0) -
引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で Hash オブジェクトに変換します。nil か [] を指定した場合は空の Hash オブジェクトを返します。
...。nil か [] を指定した場合は空の
Hash オブジェクトを返します。
@param arg 変換対象のオブジェクトを指定します。
//emlist[例][ruby]{
Hash([]) # => {}
Hash(nil) # => {}
Hash(key: :value) # => {:key => :value}
Hash([1, 2, 3]) # => TypeError... -
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (107.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
$ $ RS -> String | nil (107.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
. # Array(arg) -> Array (107.0) -
引数を配列(Array)に変換した結果を返します。
...します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_ary, to_a の返り値が配列でなければ発生します
//emlist[例][ruby]{
p Array({:it => 3}) #=> [[:it, 3]]
p Array(nil) #=> []
p Array("fefe") #=> ["fefe"]
//}
@see Object#to_a,Object#to_ary,Array... -
Kernel
. # caller(range) -> [String] | nil (107.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]......# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method =......(caller.first)
#=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug in... -
Kernel
. # caller(start = 1) -> [String] | nil (107.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]......# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method =......(caller.first)
#=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug in... -
Kernel
. # caller(start , length) -> [String] | nil (107.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]......# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method =......(caller.first)
#=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug in...