4件ヒット
[1-4件を表示]
(0.022秒)
別のキーワード
モジュール
- Kernel (4)
キーワード
-
$ DEFAULT _ INPUT (1) -
$ DEFAULT _ OUTPUT (1) -
$ ERROR _ INFO (1) -
$ ERROR _ POSITION (1)
検索結果
先頭4件
-
Kernel
$ $ ERROR _ POSITION -> [String] | nil (18610.0) -
$@ の別名
...$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end... -
Kernel
$ $ DEFAULT _ INPUT -> IO (613.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
$ $ DEFAULT _ OUTPUT -> IO (613.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
$ $ ERROR _ INFO -> Exception | nil (610.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...