发布于 2016-12-24 01:25:41 | 215 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Ruby教程,程序狗速度看过来!

Ruby编程语言

Ruby,一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言,在20世纪90年代由日本人松本行弘开发,遵守GPL协议和Ruby License。它的灵感与特性来自于 Perl、Smalltalk、Eiffel、Ada以及 Lisp 语言。


Ruby 2.4.0 正式版发布了。

此文档是除了错误修复之外的用户可见的功能更改的列表。注意:每个条目保持如此简短,以致不提供背后的原因或参考信息。有关具体所有的完整更改列表,请参阅 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

  • Array#concat [Feature #12333]

Now takes multiple arguments.

  • Array#max and Array#min.  [Feature #12172] 

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.

  • Array#pack [Feature #12754]

Now takes optional argument `buffer:' to reuse already allocated buffer.

  • Array#sum  [Feature #12217]

This is different from Enumerable#sum in that Array#sum doesn't depend on the definition of each method.

Comparable

  • Comparable#clamp.  [Feature #10594]

Dir

  • Dir.empty?.  [Feature #10121]

Enumerable

  • Enumerable#chunk called without a block now return an Enumerator [Feature #2172]

  • Enumerable#sum  [Feature #12217]

  • Enumerable#uniq  [Feature #11090]

Enumerator::Lazy

  • Enumerator::Lazy#chunk_while  [GH-1186]

  • Enumerator::Lazy#uniq  [Feature #11090]

File

  • File.empty?.  [Feature #9969]

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

  • Hash#compact and Hash#compact!  [Feature #11818]

  • Hash#transform_values and Hash#transform_values!  [Feature #12512]

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

  • Kernel#clone now takes an optional keyword argument, freeze flag. [Feature #12300]

MatchData

  • MatchData#named_captures [Feature #11999]

  • MatchData#values_at supports named captures [Feature #9179]

Module

  • Module#refine accepts a module as the argument now. [Feature #12534]

  • Module.used_modules [Feature #7418]

Numeric

  • Numeric#finite?, Numeric#infinite? [Feature #12039]

Process

  • Support CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced by macOS 10.12.

完整更新内容发布主页

下载地址



历史版本 :
Ruby 2.5.0 发布,提升 5-10% 性能
Ruby 2.3.6,2.2.9 发布,动态类型编程语言
Ruby 2.4.2 发布,修复安全问题
Ruby 2.1 已结束支持,不再释放更新补丁和修复
Ruby 2.2.7 发布,开源的动态编程语言
Ruby 2.4.1 发布,开源的动态编程语言
Ruby 2.4.0 正式版发布
Ruby 2.4.0 rc1 发布,2.4 首个候选版
Ruby 2.3.3 发布,多项错误修复
Ruby v2.4.0 preview3 发布
Ruby 2.4.0-preview2 发布,修复多项问题
Ruby 2.3.0 正式发布
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务