5件ヒット
[1-5件を表示]
(0.010秒)
別のキーワード
モジュール
- Kernel (5)
キーワード
-
$ < (1) -
$ DEFAULT _ INPUT (1) -
$ ERROR _ INFO (1) -
$ ERROR _ POSITION (1) -
$ LAST _ PAREN _ MATCH (1)
検索結果
先頭5件
-
Kernel
$ $ < -> IO (18304.0) -
すべての引数または標準入力で構成される仮想ファイルです。 定数 Object::ARGF の別名です。
すべての引数または標準入力で構成される仮想ファイルです。
定数 Object::ARGF の別名です。
この変数はグローバルスコープ、読み取り専用です。 -
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (76.0) -
$+ の別名
$+ の別名
require "English"
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>... -
Kernel
$ $ DEFAULT _ INPUT -> IO (22.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
$ $ ERROR _ INFO -> Exception | nil (22.0) -
$! の別名
$! の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end -
Kernel
$ $ ERROR _ POSITION -> [String] | nil (22.0) -
$@ の別名
$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end