種類
ライブラリ
- English (48)
- ビルトイン (838)
- csv (36)
-
io
/ console (36) -
irb
/ input-method (48) - monitor (24)
- nkf (12)
- openssl (24)
- rake (12)
- socket (72)
- stringio (60)
- tempfile (36)
- thread (2)
- timeout (21)
-
webrick
/ httpproxy (24) -
webrick
/ utils (12) - zlib (132)
クラス
-
ARGF
. class (120) - BasicSocket (24)
- CSV (36)
- IO (588)
-
IRB
:: FileInputMethod (12) -
IRB
:: InputMethod (12) -
IRB
:: ReadlineInputMethod (12) -
IRB
:: StdioInputMethod (12) - Object (24)
- Socket (24)
- StringIO (60)
- Tempfile (36)
-
Zlib
:: GzipReader (132)
モジュール
- Kernel (168)
-
OpenSSL
:: Buffering (12) -
OpenSSL
:: SSL :: SocketForwarder (12) - Process (12)
- Timeout (21)
-
WEBrick
:: Utils (12)
オブジェクト
-
WEBrick
:: NullReader (24)
キーワード
-
$ -0 (12) -
$ / (12) -
$ DEFAULT _ INPUT (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ LAST _ PAREN _ MATCH (12) -
$ RS (12) -
$ _ (12) -
$ stdin (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - ARGF (12)
- DATA (12)
- IO (12)
- Monitor (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) - NKF (12)
- Rubyの起動 (7)
- SizedQueue (12)
- TCPServer (12)
- TCPSocket (12)
- autoclose= (12)
- bigdecimal (12)
- cooked (12)
- delete (12)
- each (72)
-
each
_ byte (24) -
each
_ line (72) - file (12)
- getbyte (12)
- getc (24)
- getservbyname (12)
- getservbyport (12)
- getservername (12)
- getsid (12)
- getsockname (12)
- getsockopt (24)
-
lex
_ get _ str (12) -
lex
_ getline (12) - lineno (36)
- loop (24)
- new (12)
- noecho (12)
- open (36)
- pipe (84)
- popen (168)
- pos (24)
- raw (12)
-
rb
_ ary _ push (12) - read (24)
- readchar (12)
- readline (108)
- readlines (48)
- readpartial (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) - shift (12)
- sysread (12)
- tell (24)
- timeout (21)
- ungetc (12)
- unlink (12)
- 制御構造 (12)
検索結果
先頭5件
-
ARGF
. class # gets(limit) -> String | nil (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...mit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2......\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, AR......GF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(limit , chomp: false) -> String | nil (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # =...... 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.t......xt
# $ 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 (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...mit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2......\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, AR......GF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / , chomp: false) -> String | nil (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # =...... 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.t......xt
# $ 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 (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...mit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # => "line1\n"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets(2......\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, AR......GF.class#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit , chomp: false) -> String | nil (24239.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets # =...... 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.t......xt
# $ 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... -
Kernel
. # gets(rs = $ / ) -> String | nil (24237.0) -
ARGFから一行読み込んで、それを返します。 行の区切りは引数 rs で指定した文字列になります。
...。
@return ファイルの終り(EOF)に到達した時、 nil を返します。
@raise Errno::EXXX 読み込みに失敗した場合に発生します。
//emlist[main.rb][ruby]{
ARGV << 'b.txt' << 'c.txt'
p gets #=> "hello\n"
p gets(nil) #=> "it\ncommon\n"
p gets("") #=> "ARGF\n\n"
p gets('、'......ct::ARGV を参照) をファイル名と\n# みなして、"
p gets #=> "それらのファイルを連結した 1 つの仮想ファイルを表すオブジェクトです。\n"
p gets #=> nil
p readline # end of file reached (EOFError)
//}
//emlist[b.txt][ruby]{
hello
it
common
//}
//emlist[c.t......xt][ruby]{
ARGF
# スクリプトに指定した引数 (Object::ARGV を参照) をファイル名と
# みなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェクトです。
//}
@see $/,ARGF,Kernel.#readlines,Kernel.#readline... -
Zlib
:: GzipReader # gets(rs = $ / ) -> String | nil (24229.0) -
IO クラスの同名メソッドIO#getsと同じです。
...IO クラスの同名メソッドIO#getsと同じです。
但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。
gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッターに......合は
Zlib::GzipFile::NoFooter, Zlib::GzipFile::CRCError,
Zlib::GzipFile::LengthError 例外を発生させます。
* EOF (圧縮データの最後) を越えて読み込み要求を受けた時。
すなわち Zlib::GzipReader#read,
Zlib::GzipReader#gets メソッド等が nil を返......File::NoFooter Zlib::GzipFile::NoFooterを参照
@raise Zlib::GzipFile::CRCError Zlib::GzipFile::CRCErrorを参照
@raise Zlib::GzipFile::LengthError Zlib::GzipFile::LengthErrorを参照
require 'zlib'
=begin
# hoge.gz がない場合は下記で作成できる。
Zlib::GzipWriter.open('ho... -
IO
# gets(limit) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......mit 最大の読み込みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets... -
IO
# gets(limit , chomp: false) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......m limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets......#=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs = $ / ) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......mit 最大の読み込みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets... -
IO
# gets(rs = $ / , chomp: false) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......m limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets......#=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs , limit) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......mit 最大の読み込みバイト数
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets... -
IO
# gets(rs , limit , chomp: false) -> String | nil (24215.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエンコーディングがマルチバイトエンコーディン......m limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.gets......#=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
StringIO
# gets(rs = $ / ) -> String | nil (24213.0) -
自身から 1 行読み込んで、その文字列を返します。文字列の終端に到達した時には nil を返します。 $_ に読み込んだ行がセットされます。
...ror 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.gets #=> "hoge"
$_ #=> "hoge"
a.gets #=> nil
$_ #=> nil
//}
@see $/...