種類
- 文書 (41)
- 特異メソッド (22)
- インスタンスメソッド (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
IO
. write(path , string , **opts) -> Integer (18324.0) -
path で指定されるファイルを開き、string を書き込み、 閉じます。
...s line two\nThis is line three\nAnd so on...\n"
IO.write("testfile", text) # => 66
IO.write("testfile", "0123456789", 20) #=> 10
IO.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO.write("testfile", "0123456789") #=> 10
IO.read("tes......tfile") # => "0123456789"
//}
@see IO.binwrite... -
IO
. write(path , string , offset=nil , **opts) -> Integer (18324.0) -
path で指定されるファイルを開き、string を書き込み、 閉じます。
...s line two\nThis is line three\nAnd so on...\n"
IO.write("testfile", text) # => 66
IO.write("testfile", "0123456789", 20) #=> 10
IO.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO.write("testfile", "0123456789") #=> 10
IO.read("tes......tfile") # => "0123456789"
//}
@see IO.binwrite... -
Pathname
# write(string , offset=nil , **opts) -> Integer (18321.0) -
...IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write... -
NEWS for Ruby 2
. 7 . 0 (72.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...**)を足すことで警告を回避できます。
このように書けばRuby 3でも同じ意味で動きます。
//emlist[][ruby]{
def foo(key: 42); end; foo({key: 42}) # warned
def foo(**kw); end; foo({key: 42}) # warned
def foo(key: 42); end; foo(**{key: 42}) # OK
def foo(**kw)......ドはヒープの生きているオブジェクトをコンパクションして、
ページ数を減らして、ヒープをCoW (copy-on-write)フレンドリーに
しようとします。 15626
* アルゴリズムの詳細と注意点は
https://bugs.ruby-lang.org......エンコーディングを設定する
IO#set_encoding_by_bomメソッドが追加されました。 15210
* Integer
* 変更されたメソッド
* Integer#[] がRangeを受け付けるようになりました。 8842
//emlist[][ruby]{
0b01001101[2, 4] #=> 0b0011
0b01001100[... -
ruby 1
. 6 feature (54.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]
: 2002-06-03 sprintf()
"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。
p sprintf("%d", nil)
=> -:1:in `sprintf': no implicit conversio......イプの dup を close_write するとエラーになっていました。
((<ruby-dev:17155>))
open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex I......2
: String#succ
((<ruby-talk:22557>))
p "***".succ
p "*".succ
p sprintf("%c", 255).succ
p sprintf("*%c", 255).succ
p sprintf("**%c", 255).succ
=> ruby 1.6.5 (2001-09-19) [i586-linux]
"**+"
"\001+"
"\001\000"... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (48.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への変更点(まとめ)/サポートプラットフォームの追加>))
...リテラルの prefix として 0d が追加されました。
8進リテラルの prefix として 0 以外に 0o が追加されました。
Integer(), String#to_i、String#oct もこの prefix を認識します。
: ((<メソッド引数の & 修飾|メソッド呼び出し/イテレー......け付けないために、long の範囲の
数値を指定することができませんでした。((<ruby-talk:72257>))
syscall(1, 2**30)
=> -:1:in `syscall': wrong argument type Bignum (expected String) (TypeError)
from -:1
ruby 1.6.8 (2002-12-24)......りますが、こちらは未修正です。
((<ruby-dev:19299>))
: ((<IO#putc|IO/putc>)) [bug]
出力メソッドのうち putc だけが write メソッドを使用していませんでした。
((<ruby-dev:18038>))
: IO#read, gets ..., etc. [bug]
File::NONBLOCK を指定した IO の... -
NEWS for Ruby 2
. 2 . 0 (48.0) -
NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...インクリメンタルマーキングを導入しました。 10137
* IO
* 改善: Windows上でパイプのための IO#read_nonblock, IO#write_nonblock をサポートしました。
* Kernel
* 追加: Kernel.#itself(Object#itself)
* 改善: Kernel.#throw は、対応する cat......yZfrhEEnc8/edit?usp=sharing
* Hash
* 非互換: 重複するキーの上書きに関するポリシーを変更しました 10315
{ **hash1, **hash2 } は重複するキーについては hash2 の値を持ちます
* IO
* 非互換: IO#flush を使ったとき、ファイルの......しました 9502
* Check_SafeStr -> SafeStringValue
* rb_check_safe_str -> SafeStringValue
* rb_quad_pack -> rb_integer_pack
* rb_quad_unpack -> rb_integer_unpack
* rb_read_check : access struct FILE internal. no replacement.
* rb_struct_iv_get : internal function. no repla... -
NEWS for Ruby 3
. 0 . 0 (36.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......e given keys and their values. 15822
* IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution contex......redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modi...