Ruby 2.4.0 正式版发布了。Ruby 是一门跨平台、面向对象的动态类型编程语言。Ruby 体现了表达的一致性和简单性,它不仅是一门编程语言,更是表达想法的一种简练方式。 此文档是除了错误修复之外的用户可见的功能更改的列表。注意:每个条目保持如此简短,以致不提供背后的原因或参考信息。有关具体所有的完整更改列表,请参阅 ChangeLog 文件或 Redmine。 部分更新内容: Changes since the 2.3.0 release Language changes Multiple assignment in conditional expression is now allowed. [Feature #10617] Refinements is enabled at method by Symbol#to_proc. [Feature #9451] Refinements is enabled with Kernel#send and BasicObject#__send__. [Feature #11476] Rescue modifier now applicable to method arguments. [Feature #12686] Toplevel return is now allowed. [Feature #4840]
Core classes updates (outstanding ones only) Array Now takes multiple arguments. This
may cause a tiny incompatibility: if you redefine Enumerable#max and
call max to an Array, your redefinition will be now ignored. You should
also redefine Array#max. Now takes optional argument `buffer:' to reuse already allocated buffer. This is different from Enumerable#sum in that Array#sum doesn't depend on the definition of each method. Comparable Dir Enumerable Enumerable#chunk called without a block now return an Enumerator [Feature #2172] Enumerable#sum [Feature #12217] Enumerable#uniq [Feature #11090]
Enumerator::Lazy File Float Float#ceil, Float#floor, and Float#truncate now take an optional digits, as well as Float#round. [Feature #12245] Float#round
now takes an optional keyword argument, half option, and the default
behavior is round-up. [Bug #12548] [Bug #12958] half option can be one of :even, :up, and :down. [Feature #12953]
Hash Integer Fixnum and Bignum are unified into Integer [Feature #12005] Integer#ceil, Integer#floor, and Integer#truncate now take an optional digits, as well as Integer#round. [Feature #12245] Integer#digits for extracting columns of place-value notation [Feature #12447] Integer#round
now takes an optional keyword argument, half option, and the default
behavior is round-up now. [Bug #12548] [Bug #12958] half option can be one of :even, :up, and :down. [Feature #12953]
IO IO#gets,
IO#readline, IO#each_line, IO#readlines, IO.foreach now takes an
optional keyword argument, chomp flag. [Feature #12553]
Kernel MatchData Module Numeric Process 完整更新内容和发布主页 下载地址 |