るりまサーチ

最速Rubyリファレンスマニュアル検索!
239件ヒット [1-100件を表示] (0.105秒)
トップページ > クエリ:l[x] > クエリ:line=[x]

別のキーワード

  1. matrix l
  2. _builtin $-l
  3. kernel $-l
  4. lupdecomposition l
  5. l

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

CSV::FieldInfo#line=(val) (24200.0)

行番号をセットします。

...行番号をセットします。

@param val 行番号を指定します。...

RDoc::Markdown#break_on_newline=(val) (12200.0)

改行を保持した状態で出力するかどうかを設定します。

改行を保持した状態で出力するかどうかを設定します。

Kernel#file(*args) { ... } -> Rake::FileTask (6206.0)

ファイルタスクを定義します。

...と依存ファイル名を指定します。

例:
file "config.cfg" => ["config.template"] do
open("config.cfg", "w") do |outfile|
open("config.template") do |infile|
while line = infile.gets
outfile.puts line
end
end
end
end

@see Rake::T...

RubyVM::InstructionSequence.compile(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (6202.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...@param file ファイル名を文字列で指定します。

@param path 引数 file の絶対パスファイル名を文字列で指定します。

@param line 引数 source の 1 行目の行番号を指定します。

@param options コンパイル時のオプションを true、false、Hash...
...かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

Kernel$$DEFAULT_INPUT -> IO (6106.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$$LAST_PAREN_MATCH -> String | nil (6106.0)

$+ の別名

...glish"

r1 = Regexp.compile("<img src=(http:.+?)>")
r2 = Regexp.compile("<a href=(http|ftp).+?>(.+?)</a>")

while line = DATA.gets
[ r1, r2 ].each {|rep|
rep =~ line
p $+
}
end
__END__
<tr> <td><img src=http://localhost/a.jpg></td> <td>ikkou</td> <td><a href=http://lo...
...calhost/link.html>link</a></td> </tr>
#enf of sample.rb

$ ruby sample.rb
"http://localhost/a.jpg"
"link"...

Kernel.#caller(range) -> [String] | nil (6106.0)

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

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@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'",...
...[]
# nil
//}

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

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line =
$2.to_i
method = $3
[file, line, method]...

Kernel.#caller(start = 1) -> [String] | nil (6106.0)

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

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@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'",...
...[]
# nil
//}

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

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line =
$2.to_i
method = $3
[file, line, method]...

Kernel.#caller(start, length) -> [String] | nil (6106.0)

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

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@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'",...
...[]
# nil
//}

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

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line =
$2.to_i
method = $3
[file, line, method]...

Kernel.#loop -> Enumerator (6106.0)

(中断されない限り)永遠にブロックの評価を繰り返します。 ブロックが指定されなければ、代わりに Enumerator を返します。

...りに Enumerator を返します。

//emlist[例][ruby]{
l
oop do
print "Input: "
line =
gets
break if !line or line =~ /^qQ/
# ...
end
//}

与えられたブロック内で StopIteration を Kernel.#raise すると
ループを終了して nil を返します。
ループを終了させ...

絞り込み条件を変える

<< 1 2 3 > >>