クラス
-
ARGF
. class (267) - BasicObject (11)
- Complex (33)
- Data (14)
- Enumerator (62)
-
Enumerator
:: Lazy (44) - Fiber (25)
- Float (11)
- Hash (22)
- IO (176)
- Method (10)
- Module (22)
- NoMethodError (28)
- Numeric (33)
- Object (132)
- Proc (62)
- String (27)
- Struct (44)
- Thread (55)
モジュール
- Enumerable (22)
- Kernel (233)
- Process (33)
キーワード
- % (11)
- === (11)
- ARGF (11)
- ARGV (11)
- Array (11)
- Float (11)
- Integer (11)
- Method (11)
- Numeric (11)
- Proc (11)
- String (11)
- [] (37)
-
_ dump (11) -
add
_ trace _ func (11) - angle (22)
- args (11)
- argv0 (11)
- call (11)
-
class
_ exec (11) - codepoints (14)
- concat (8)
- define (4)
- each (44)
-
each
_ char (22) -
each
_ codepoint (22) -
each
_ with _ index (22) -
enum
_ for (44) - exec (33)
- fork (11)
- format (11)
- gets (24)
- initialize (11)
-
inplace
_ mode (11) -
inplace
_ mode= (11) - inspect (16)
- lambda (17)
-
marshal
_ dump (11) -
method
_ missing (11) -
module
_ exec (11) - new (90)
- path (11)
- phase (33)
- popen (154)
- pos (11)
- pos= (11)
- prepend (8)
- print (33)
- printf (44)
- proc (18)
-
public
_ send (22) - putc (11)
- puts (22)
-
read
_ nonblock (9) - readpartial (11)
- resume (11)
- send (22)
-
set
_ encoding (22) -
set
_ trace _ func (22) - shift (11)
- skip (11)
- spawn (33)
- sprintf (11)
- start (11)
- system (22)
- tell (11)
-
to
_ enum (44) -
to
_ s (16) - transfer (3)
- with (2)
-
with
_ index (11) - yield (22)
検索結果
先頭5件
-
ARGF
. class # each _ codepoint -> Enumerator (17102.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (17102.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
ARGF
. class # inplace _ mode -> String | nil (17102.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や ARG......F.class#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"
# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|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 # inspect -> String (17102.0) -
常に文字列 "ARGF" を返します。
...常に文字列 "ARGF" を返します。... -
ARGF
. class # pos -> Integer (17102.0) -
ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位 の整数で返します。
...
ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位
の整数で返します。
ARGF.pos # => 0
ARGF.gets # => "This is line one\n"
ARGF.pos # => 17
@see IO#pos, IO#tell, ARGF.class#pos=... -
ARGF
. class # pos=(n) (17102.0) -
ARGFが開いているファイルのファイルポインタを指定位置に移動します。
...
ARGFが開いているファイルのファイルポインタを指定位置に移動します。
@param n 先頭からのオフセットをバイト単位の整数で指定します。
ARGF.pos = 17
ARGF.gets # => "This is line two\n"
@see IO#pos=, ARGF.class#pos... -
ARGF
. class # putc(ch) -> object (17102.0) -
文字 ch を処理対象のファイルに出力します。 ch を返します。
...理対象のファイルに出力します。
ch を返します。
c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#putc と同じです。
@param ch 出力する文字を String オブジェクトで指定します... -
ARGF
. class # readpartial(maxlen , outbuf = nil) -> String (17102.0) -
IO#readpartialを参照。ARGF.class#read などとは違って複数ファ イルを同時に読み込むことはありません。
...IO#readpartialを参照。ARGF.class#read などとは違って複数ファ
イルを同時に読み込むことはありません。
@param maxlen 読み込む長さの上限を整数で指定します。
@param outbuf 読み込んだデータを格納する String オブジェクトを指定し......ます。
@see IO#readpartial, ARGF.class#read_nonblock... -
ARGF
. class # skip -> self (17102.0) -
現在開いている処理対象のファイルをクローズします。 次回の読み込みは次の引数が処理対象になります。 self を返します。
...いている処理対象のファイルをクローズします。
次回の読み込みは次の引数が処理対象になります。
self を返します。
$ echo "foo" > foo
$ echo "bar" > bar
$ ruby argf.rb foo bar
ARGF.filename # => "foo"
ARGF.skip
ARGF.filename # => "bar"... -
Process
. # argv0 -> String (17102.0) -
現在実行中の Ruby スクリプトの名前を表す文字列です。$0 を更新して も本メソッドの戻り値への影響はありません。
...して
も本メソッドの戻り値への影響はありません。
本メソッドは 2.1 以降でグローバル変数を用いないで現在実行中の Ruby スク
リプトの名前を表す文字列を取得する手段として提供されました。
@see Process.#setproctitle, $0...