るりまサーチ

最速Rubyリファレンスマニュアル検索!
205件ヒット [1-100件を表示] (0.015秒)

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. argf.class to_a
  5. argf.class gets

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

ARGF.class#eof -> bool (21190.0)

現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。

...イルがEOFに達したらtrueを返します。そうでない場合は
falseを返します。

@raise IOError ファイルがopenされていない場合に発生します。

$ echo "eof" | ruby argf.rb

ARGF
.eof? # => false
3.times { ARGF.readchar }
ARGF
.eof?...
...# => false
ARGF
.readchar # => "\n"
ARGF
.eof? # => true

@see IO#eof, IO#eof?...

ARGF.class#eof? -> bool (9190.0)

現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。

...イルがEOFに達したらtrueを返します。そうでない場合は
falseを返します。

@raise IOError ファイルがopenされていない場合に発生します。

$ echo "eof" | ruby argf.rb

ARGF
.eof? # => false
3.times { ARGF.readchar }
ARGF
.eof?...
...# => false
ARGF
.readchar # => "\n"
ARGF
.eof? # => true

@see IO#eof, IO#eof?...

ARGF.class#getbyte -> Integer | nil (3094.0)

self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。

...self から 1 バイト(0..255)を読み込み整数として返します。
既に EOF に達していれば nil を返します。

ARGF
はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想フ...
...cho "bar" > file2
$ ruby argf.rb file1 file2

ARGF
.getbyte # => 102
ARGF
.getbyte # => 111
ARGF
.getbyte # => 111
ARGF
.getbyte # => 10
ARGF
.getbyte # => 98
ARGF
.getbyte # => 97
ARGF
.getbyte # => 114
ARGF
.getbyte # => 10
ARGF
.getbyte # => nil

@see ARGF.class#getc, ARGF.class#gets...

ARGF.class#getc -> String | nil (3094.0)

self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。

...self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。

ARGF
はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェ...
...foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2

ARGF
.getc # => "f"
ARGF
.getc # => "o"
ARGF
.getc # => "o"
ARGF
.getc # => "\n"
ARGF
.getc # => "b"
ARGF
.getc # => "a"
ARGF
.getc # => "r"
ARGF
.getc # => "\n"
ARGF
.getc # => nil

@see ARGF.class#getbyte, ARGF.class#gets...

ARGF.class#readchar -> String (3080.0)

ARGFから 1 文字読み込んで、その文字に対応する String を返します。EOF に 到達した時には EOFErrorを発生します。

...
ARGF
から 1 文字読み込んで、その文字に対応する String を返します。EOF
到達した時には EOFErrorを発生します。

@raise EOFError EOFに達した時発生する

$ echo "foo" > file
$ ruby argf.rb file

ARGF
.readchar # => "f"
ARGF
.readchar # => "o"
A...
...RGF.readchar # => "o"
ARGF
.readchar # => "\n"
ARGF
.readchar # => end of file reached (EOFError)

@see ARGF.class#getc...

絞り込み条件を変える

ARGF.class#gets(limit) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#gets(limit, chomp: false) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#gets(rs = $/) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#gets(rs = $/, chomp: false) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#gets(rs, limit) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

絞り込み条件を変える

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (3068.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...rb
ARGF
.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
....
...gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF
.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#readbyte -> Integer (3058.0)

自身から 1 バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。

...既に EOF に達していれば EOFError が発生します。

@raise EOFError 既に EOF に達している場合に発生します。

$ echo "foo" > file
$ ruby argf.rb file

ARGF
.readbyte # => 102
ARGF
.readbyte # => 111
ARGF
.readbyte # => 111
ARGF
.readbyte # => 10
ARGF
.readb...
...yte # => end of file reached (EOFError)...

ARGF.class#readline(limit) -> String (3044.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は EOFError を発生します。

...
ARGF
の現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
EOFError を発生します。

@param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指...
...定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@param limit 最大の読み込みバイト数

@raise EOFError EOFに達したら発生する

@see Kernel.#readline, ARGF.class#gets...
<< 1 2 3 > >>