228件ヒット
[1-100件を表示]
(0.033秒)
種類
- 変数 (99)
- インスタンスメソッド (77)
- 文書 (31)
- ライブラリ (11)
- モジュール関数 (10)
モジュール
- Kernel (109)
キーワード
-
$ ARGV (11) -
$ DEFAULT _ INPUT (11) -
$ ERROR _ INFO (11) -
$ ERROR _ POSITION (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ LAST _ PAREN _ MATCH (11) -
$ NR (11) -
$ ORS (11) -
$ OUTPUT _ RECORD _ SEPARATOR (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) - abort (10)
- irb (11)
- rand (33)
-
ruby 1
. 8 . 4 feature (11)
検索結果
先頭5件
-
Kernel
. # abort -> () (21024.0) -
Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
...Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
このメソッドと Kernel.#exit との違いは、プログラムの終了ステー
タスが 1 (正確にはCレベルの定数 EXIT_FAILURE の値)固定であることと、......#(標準出力)
#=> start
# start1...
# end1 with #<SystemExit: error1>
# start2...
# end2...
#終了ステータス:1
#(標準エラー出力)
#=> error1
# Traceback (most recent call last):
# sample.rb:11:in `<main>': RuntimeError (RuntimeError)
//}
@see Kernel.#exit,Kernel.#exit!... -
Kernel
. # abort(message) -> () (21024.0) -
Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
...Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
このメソッドと Kernel.#exit との違いは、プログラムの終了ステー
タスが 1 (正確にはCレベルの定数 EXIT_FAILURE の値)固定であることと、......#(標準出力)
#=> start
# start1...
# end1 with #<SystemExit: error1>
# start2...
# end2...
#終了ステータス:1
#(標準エラー出力)
#=> error1
# Traceback (most recent call last):
# sample.rb:11:in `<main>': RuntimeError (RuntimeError)
//}
@see Kernel.#exit,Kernel.#exit!... -
Kernel
$ $ ARGV -> [String] (21012.0) -
$* の別名
...$* の別名
require "English"
p $ARGV
# end of sample.rb
ruby sample.rb 31 /home/hoge/fuga.txt
#=> ["31", "/home/hoge/fuga.txt"]... -
Kernel
$ $ DEFAULT _ INPUT -> IO (21012.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
$ $ INPUT _ LINE _ NUMBER -> Integer (21012.0) -
$. の別名
...$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5... -
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (21012.0) -
$+ の別名
...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://localhost/link.html>link</a></td> </tr>
#enf of sample.rb
$ ruby sample.rb
"http://localhost/a.jpg"
"link"... -
Kernel
$ $ NR -> Integer (21012.0) -
$. の別名
...$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5... -
Kernel
$ $ ORS -> String | nil (21012.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
$ $ OUTPUT _ RECORD _ SEPARATOR -> String | nil (21012.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
$ $ ERROR _ INFO -> Exception | nil (21006.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 (21006.0) -
$@ の別名
...$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end...