ライブラリ
- ビルトイン (440)
- csv (33)
-
io
/ console (33) -
irb
/ input-method (44) - openssl (22)
- rake (11)
- socket (22)
- stringio (22)
- tempfile (33)
- zlib (176)
クラス
-
ARGF
. class (121) - BasicSocket (22)
- CSV (33)
- IO (352)
-
IRB
:: FileInputMethod (11) -
IRB
:: InputMethod (11) -
IRB
:: ReadlineInputMethod (11) -
IRB
:: StdioInputMethod (11) - StringIO (22)
- Tempfile (33)
-
Zlib
:: GzipReader (176)
モジュール
- Kernel (11)
-
OpenSSL
:: Buffering (11) -
OpenSSL
:: SSL :: SocketForwarder (11)
キーワード
- autoclose= (11)
- cooked (11)
- delete (11)
- each (88)
-
each
_ byte (22) -
each
_ line (88) - file (11)
- getbyte (11)
- getc (22)
- getsockname (11)
- getsockopt (22)
- lineno (33)
- lineno= (22)
- noecho (11)
- open (11)
- pos (22)
- pos= (22)
- raw (11)
- read (11)
- readchar (11)
- readline (88)
- readlines (44)
- readpartial (11)
- rewind (11)
- shift (11)
- sysread (11)
- tell (22)
- ungetc (11)
- unlink (11)
検索結果
先頭5件
-
ARGF
. class # gets(limit) -> String | nil (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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 (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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 (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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 (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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 (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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 (18140.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...GF.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... -
Zlib
:: GzipReader # gets(rs = $ / ) -> String | nil (18130.0) -
IO クラスの同名メソッドIO#getsと同じです。
...IO クラスの同名メソッドIO#getsと同じです。
但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。
gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッターに......* EOF (圧縮データの最後) を越えて読み込み要求を受けた時。
すなわち Zlib::GzipReader#read,
Zlib::GzipReader#gets メソッド等が nil を返す時。
* EOF まで読み込んだ後、Zlib::GzipFile#close メソッドが
呼び出された時。
* EOF......を参照
require 'zlib'
=begin
# hoge.gz がない場合は下記で作成できる。
Zlib::GzipWriter.open('hoge.gz') { |gz|
gz.puts 'hoge'
gz.puts 'fuga'
}
=end
Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
puts l
end
}
#=> hoge
#=> fuga... -
IO
# gets(limit) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
IO
# gets(limit , chomp: false) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
IO
# gets(rs = $ / ) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
IO
# gets(rs = $ / , chomp: false) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
IO
# gets(rs , limit) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
IO
# gets(rs , limit , chomp: false) -> String | nil (18116.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...プンされていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO... -
StringIO
# gets(rs = $ / ) -> String | nil (18114.0) -
自身から 1 行読み込んで、その文字列を返します。文字列の終端に到達した時には nil を返します。 $_ に読み込んだ行がセットされます。
...ror 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.gets #=> "hoge"
$_ #=> "hoge"
a.gets #=> nil
$_ #=> nil
//}
@see $/... -
OpenSSL
:: Buffering # gets(eol= $ / , limit=nil) -> String | nil (18108.0) -
通信路から一行読み込んで、それを返します。
...limit が nil の場合は
eol に到達するまで読み込みます。
読み込みが終端に到達した場合は nil を返します。
IO#gets と同様ですが、区切り文字列に
"" を渡した場合や、nil を渡したときの意味が異なり、
これらの場合は正しく... -
CSV
# gets -> Array | CSV :: Row (18102.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
String や IO をラップしたデータソースから一行だけ読み込んで
フィールドの配列か CSV::Row のインスタンスを返します。
データソースは読み込み用にオープンされている必要があります。
@return ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "r...