別のキーワード
種類
クラス
-
ARGF
. class (60) - CSV (36)
- IO (216)
- Object (12)
- StringIO (48)
キーワード
-
$ -0 (12) -
$ / (12) -
$ DEFAULT _ INPUT (12) -
$ LAST _ PAREN _ MATCH (12) -
$ _ (12) -
$ stdin (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - ARGF (12)
- DATA (12)
- Monitor (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (5) - NKF (12)
- Rubyの起動 (12)
- SizedQueue (12)
- bigdecimal (12)
- each (72)
-
each
_ line (72) - getbyte (12)
- getc (12)
-
lex
_ getline (12) - loop (24)
- new (12)
- open (24)
- pos (12)
- pos= (12)
-
rb
_ ary _ push (12) - readline (24)
- readlines (48)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) - shift (12)
- tell (12)
- timeout (21)
- 制御構造 (12)
検索結果
先頭5件
-
ARGF
. class # gets(limit) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
ARGF
. class # gets(limit , chomp: false) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
ARGF
. class # gets(rs = $ / ) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
ARGF
. class # gets(rs = $ / , chomp: false) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
ARGF
. class # gets(rs , limit) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
ARGF
. class # gets(rs , limit , chomp: false) -> String | nil (18163.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...# $ 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) # => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby t......t.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#... -
Kernel
. # gets(rs = $ / ) -> String | nil (18155.0) -
ARGFから一行読み込んで、それを返します。 行の区切りは引数 rs で指定した文字列になります。
...ます。
//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('、') #=> "# スクリプトに指定した引数 (Object::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.txt][ruby]{
ARGF
# スクリプトに指定した引数 (Object::ARGV を参照) をファイ... -
StringIO
# gets(rs = $ / ) -> String | nil (18119.0) -
自身から 1 行読み込んで、その文字列を返します。文字列の終端に到達した時には nil を返します。 $_ に読み込んだ行がセットされます。
...ror 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.gets #=> "hoge"
$_ #=> "hoge"
a.gets #=> nil
$_ #=> nil
//}
@see $/... -
CSV
# gets -> Array | CSV :: Row (18107.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
...n ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]
__END__
header1,header2... -
Rubyの起動 (6267.0)
-
Rubyの起動 * cmd_option * shebang
...Rubyの起動
* cmd_option
* shebang
Rubyインタプリタの起動は以下の書式のコマンドラインにより行います。
ruby [ option ...] [ -- ] [ programfile ] [ argument ...]
ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプシ......ョン列の終りを明示するため
に使用できます。programfile は、Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。
programfile が `#!' で始まるファイル......はRubyの配列変数($:)に追加されます。
: -l
行末の自動処理を行います。まず、$\ を
$/ と同じ値に設定し, printでの出力
時に改行を付加するようにします。それから, -n
フラグまたは-pフラグが指定されていると
gets... -
ruby 1
. 6 feature (5143.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) ->......EWOULDBLOCK
=> ruby 1.6.7 (2002-03-01) [i586-linux]
Errno::EAGAIN
Errno::EWOULDBLOCK
=> ruby 1.6.8 (2002-12-24) [i586-linux]
Errno::EAGAIN
-:2: uninitialized constant EWOULDBLOCK at Errno (NameError)
=> ruby 1.6.8 (2003-02-13) [i......なりました。
p Hash.new("foo") == Hash.new("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false
# : 2002-08-01 IO#read, gets ..., etc.
#
# File::NONBLOCK を指定した IO の読み込みで EWOU... -
ruby 1
. 8 . 2 feature (3641.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...ruby 1.8.2 feature
ruby 1.8.2 での ruby 1.8.1 からの変更点です。
掲載方針
*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。......以下は各変更点に付けるべきタグです。
*カテゴリ
* [ruby]: ruby インタプリタの変更
* [api]: 拡張ライブラリ API
* [lib]: ライブラリ
*レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更された......た。((<ruby-dev:24561>))
=== 2004-10-20
: Proc#dup [new]
追加 ((<ruby-talk:116915>))
=== 2004-10-19
: ARGF [change]
コマンドライン引数に与えたファイルを読んだ後には標準入力を読まなくなりました。
((<ruby-dev:24452>))
: IO#gets [ruby] [bug]
"\3...