キーワード
- argv (11)
- binmode (11)
- binmode? (11)
- bytes (14)
- chars (14)
- close (11)
- closed? (11)
- codepoints (14)
- each (44)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (22) -
each
_ line (44) - eof (11)
- eof? (11)
-
external
_ encoding (11) - file (11)
- filename (11)
- fileno (11)
- getbyte (11)
- getc (11)
- gets (33)
-
inplace
_ mode (11) -
inplace
_ mode= (11) - inspect (11)
-
internal
_ encoding (11) - lineno (11)
- lineno= (11)
- lines (42)
- path (11)
- pos (11)
- pos= (11)
- print (11)
- printf (11)
- putc (11)
- puts (11)
- read (11)
-
read
_ nonblock (11) - readbyte (11)
- readchar (11)
- readline (33)
- readlines (33)
- readpartial (11)
- rewind (11)
- seek (11)
-
set
_ encoding (33) - skip (11)
- tell (11)
-
to
_ a (33) -
to
_ i (11) -
to
_ io (11) -
to
_ s (11) -
to
_ write _ io (11) - write (11)
検索結果
先頭5件
-
ARGF
. class # external _ encoding -> Encoding (9015.0) -
ARGF が処理するファイルに対する外部エンコーディングを返します。 デフォルトは Encoding.default_external です。
...ARGF が処理するファイルに対する外部エンコーディングを返します。
デフォルトは Encoding.default_external です。
ARGF.class#set_encoding で設定します。
例:
ARGF.external_encoding # => #<Encoding:UTF-8>
@see IO, ARGF.class#internal_encoding... -
ARGF
. class # getbyte -> Integer | nil (9015.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
...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 (9015.0) -
self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。
...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 # gets(limit) -> String | nil (9015.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(limit , chomp: false) -> String | nil (9015.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 (9015.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 = $ / , chomp: false) -> String | nil (9015.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 (9015.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 , chomp: false) -> String | nil (9015.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 # inplace _ mode -> String | nil (9015.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や ARGF.class#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ c......ine {|e|print e.upcase} # => "TEST"
例:
# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"
# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=... -
ARGF
. class # internal _ encoding -> Encoding | nil (9015.0) -
ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...いない場合は nil を返します。
まだ読み込み処理を始めていない場合は Encoding.default_external を返します。
ARGF.class#set_encoding で設定します。
例:
# $ ruby -Eutf-8 test.rb
# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
AR......GF.set_encoding('utf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>
例:
ARGF.binmode
ARGF.internal_encoding # => nil
@see IO, ARGF.class#external_encoding... -
ARGF
. class # lineno -> Integer (9015.0) -
全引数ファイルを一つのファイルとみなしたときの現在の行番号を返します。 個々の引数ファイル毎の行番号を得るには ARGF.file.lineno とします。
...。
個々の引数ファイル毎の行番号を得るには ARGF.file.lineno とします。
この値を書き換えたい場合は ARGF.class#lineno= を使用してください。
ARGF.lineno # => 0
ARGF.readline # => "This is line 1\n"
ARGF.lineno # => 1
@see ARGF.class#lineno=... -
ARGF
. class # lineno=(number) (9015.0) -
全引数ファイルを一つのファイルとみなしたときの現在の行番号を number に書き換えます。
...み込みたい場合は ARGF.class#lineno を使用してください。
@param number 更新後の行番号を指定する
ARGF.lineno # => 0
ARGF.readline # => "This is line 1\n"
ARGF.lineno # => 1
ARGF.lineno = 0 # => 0
ARGF.lineno # => 0
@see ARGF.class#lineno...