るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.037秒)
トップページ > クラス:ARGF.class[x] > クエリ:IO#eof[x] > クエリ:gets[x] > バージョン:2.1.0[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. oid= openssl::x509::extension#oid

ライブラリ

キーワード

検索結果

ARGF.class#eof -> bool (54502.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? # =...

ARGF.class#eof? -> bool (18502.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? # =...

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

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

...est.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 (70.0)

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

...est.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 (70.0)

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

...est.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...

絞り込み条件を変える