4件ヒット
[1-4件を表示]
(0.017秒)
ライブラリ
- English (4)
モジュール
- Kernel (4)
キーワード
-
$ DEFAULT _ OUTPUT (1) -
$ INPUT _ LINE _ NUMBER (1) -
$ LAST _ READ _ LINE (1) -
$ NR (1)
検索結果
先頭4件
-
Kernel
$ $ LAST _ READ _ LINE -> String | nil (18325.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
$ $ DEFAULT _ OUTPUT -> IO (22.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
$ $ INPUT _ LINE _ NUMBER -> Integer (22.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
$ $ NR -> Integer (22.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