モジュール
- Kernel (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - CSV (12)
-
NEWS for Ruby 2
. 5 . 0 (8)
検索結果
-
Kernel
$ $ stderr -> object (18280.0) -
標準エラー出力です。
...ます。
初期値は Object::STDERR です。
$stderr に代入するオブジェクトには
write という名前のメソッドが定義されていなければいけません。
自プロセスの標準エラー出力をリダイレクトしたいときには、
$stderr に代入すれば十......
$stderr = File.open("/tmp/foo", "w")
puts "foo" # 出力する
$stderr = STDERR # 元に戻す
//}
自プロセスだけでなく、子プロセスの標準エラー出力も
リダイレクトしたいときは以下のように IO#reopen を使います。
//emlist[例][ruby]{
$stderr......uby]{
stderr_old = $stderr.dup # 元の $stderr を保存する
$stderr.reopen("/tmp/foo") # $stderr を /tmp/foo にリダイレクトする
puts "foo" # /tmp/foo に出力
$stderr.flush # 念のためフラッシュする
$stderr.reopen stderr_old... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (432.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...組み込み変数/$deferr>)) [obsolete]
: ((<組み込み変数/$stdout>)) [change]
: ((<組み込み変数/$stderr>)) [change]
: ((<組み込み変数/$stdin>)) [change]
$stdout, $stderr は、$defout, $deferr の別名になり
$defout, $deferr は ((<obsolete>)) になりました
$stdi......スは特異クラス自身であると定義されました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;
class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i5......537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09-05) [i586-linux]
[537771634, #<Class:Object>]
[537771634, #<Class:Object>]
さらに、オブジェクトの特異クラスのスーパークラスの特異クラスと
オブジェクトの特... -
NEWS for Ruby 2
. 5 . 0 (48.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...追加 12508 11003
* Integer#allbits?, Integer#anybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加 13219
* Kernel
* Object#yield_self を追加 6721
* Kernel.#pp をrequireなしで使えるようにしました 14123
* Kernel.#warn :uplevel というキーワ......ead.report_on_exception のデフォルト値がtrueになりました。
スレッドの終了時に捕捉していない例外の情報を $stderr に出力します。 14143
* Time
* Time.at は第2引数の精度を指定するための第3引数を指定できるようになりま......{ [:then, 1, 3, 2, 3, 8] => 0,
# [:else, 2, 5, 2, 5, 8] => 2
# }
# },
# :methods => {
# [Object, :foo, 1, 0, 7, 3] => 2
# }
# }
# }
//}
* ラインカバレッジについての変更はありません。ラインカバレッ... -
CSV (12.0)
-
このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。
...ta here} } # to a String
CSV($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
//}
=== CSV と文字エンコーディング (M17n or Multilingualization)
This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written t......'s Encodings.
Anyway, the practical side of this is simple: make sure IO and String objects
passed into CSV have the proper Encoding set and everything should just work.
CSV methods that allow you to open IO objects (CSV::foreach(), CSV::open(),
CSV::read(), and CSV::readlines()) do allow you to s...