48件ヒット
[1-48件を表示]
(0.013秒)
種類
- インスタンスメソッド (24)
- 変数 (12)
- 文書 (12)
ライブラリ
- ビルトイン (36)
クラス
-
ARGF
. class (24)
モジュール
- Kernel (12)
キーワード
-
$ stdin (12) -
internal
_ encoding (12) -
ruby 1
. 8 . 2 feature (12)
検索結果
先頭4件
-
Kernel
$ $ stdin -> object (18191.0) -
標準入力です。
...は
$stdin に代入すれば十分です。
//emlist[例][ruby]{
# 標準入力の入力元 /tmp/foo に変更
$stdin = File.open("/tmp/foo", "r")
gets # 入力する
$stdin = STDIN # 元に戻す
//}
ただし、Kernel.#gets など、特定の組み込みメソッドは
$stdin......るには、
$stdin オブジェクトに代入したオブジェクトが以下のメソッドを
正しく実装していなければいけません。
gets, readline, readlines, getc, readchar, tell, seek,
pos=, rewind, fileno, to_io, eof, each_line, each_byte,
binmode, closed?
//em......list[例][ruby]{
$stdin = Object.new
def $stdin.gets
"foo"
end
p gets() # => "foo"
//}
自プロセスだけでなく、子プロセスの標準入力もリダイレクトしたいときは
以下のように IO#reopen を使います。
//emlist[例][ruby]{
$stdin.reopen("/tmp/foo")
//}
ま... -
ARGF
. class # binmode -> self (18131.0) -
self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。
...test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.binmode
ARGF.read.size # => 292
例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.read.size # => 290
@see IO#binmode, ARGF.class#binmode?... -
ruby 1
. 8 . 2 feature (132.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...((<ruby-core:03922>))
$ ruby1.8.1 -e "puts '# #{}'.inspect"
"# #{}"
$ ruby1.8.2 -e "puts '# #{}'.inspect"
"# \#{}"
: String#dump [ruby] [bug]
式展開にならない '#'がエスケープされないようになりました。
((<ruby-core:03922>))
$ ruby1.8.1 -e "puts '......# #{}'.dump"
"\# \#{}"
$ ruby1.8.2 -e "puts '# #{}'.dump"
"# \#{}"
=== 2004-12-08
: rss/rss [lib] [obsolete]
#item=/#set_item and so on are obsolete.
=== 2004-12-06
: Hash#hash [ruby] [new]
追加
((<ruby-talk:122482>))
Hash#hash は 2004-12-16 に削除されました。......] [obsolete]
CSV::Row と CSV::Cell が deprecated になりました。
: CSV.open, CSV.parse, and CSV,generate
必要ならばユーザが binmode をセットしなければならなくなりました。
: CSV.read [lib] [new]
: CSV.readlines [lib] [new]
追加。
: Marshal.dump [r... -
ARGF
. class # internal _ encoding -> Encoding | nil (12.0) -
ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...t_encoding で設定します。
例:
# $ ruby -Eutf-8 test.rb
# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
ARGF.set_encoding('utf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>
例:
ARGF.binmode
ARGF.internal_encoding # =>...
