Ruby Ruby 2.5.0-preview1 Released

ksec · 2017年10月11日 · 最后由 ksec 回复于 2017年10月29日 · 2142 次阅读

https://www.ruby-lang.org/en/news/2017/10/10/ruby-2-5-0-preview1-released/

Ruby 2.5.0-preview1 is the first preview release toward Ruby 2.5.0. It introduces some new features and performance improvements, for example: New Features

  • Print backtrace and error message in reverse order if STDERR is unchanged and a tty. [Feature #8661] [experimental]
  • Top-level constant look-up is removed. [Feature #11547]
  • rescue/else/ensure are allowed inside do/end blocks. [Feature #12906]
  • yield_self [Feature #6721]

Other notable changes since 2.4

  • Merge Onigmo to 6.1.1. It adds absent operator Note that Ruby 2.4.1 also includes this change.
  • Merge bundler to standard libraries.
  • Merge rubygems-2.6.13.
  • Merge rdoc-6.0.0.beta2. Change lexer IRB based one to Ripper. It much improves the speed of generating document. https://github.com/ruby/rdoc/pull/512 This also includes
  • Fix so many bugs in the last dozen years or so
  • Support new Ruby syntaxes in the last several years
  • Update supported Unicode version to 10.0.0.

See NEWS or commit logs for details.

With those changes, 6162 files changed, 28537 insertions(+), 339582 deletions(-) since Ruby 2.4.0!

Enjoy Ruby 2.5.0-preview1!

I wish there is more ...><

不要简单的复制粘贴。

新版没记错 block 可以直接写 rescue 比如

foo.call do
  # do sth
rescue => _ex
  # handle error
end

不用套 begin ... end,好看了很多

期待正式版😁

jasl 回复

这个在我刚开始用 ruby 的时候想当然的写过

bundler 加入核心库这个变动,感觉还可以更进一步,去掉 bundle 命令,全部集成到 gem 中来的更爽快一点,像前端只有 npm/yarn 一样

Rei 回复

Sorry couldn't type Chinese at the time... ( Or even now >< )

Will more add to it next time.

需要 登录 后方可回复, 如果你还没有账号请 注册新账号