`
dawuafang
  • 浏览: 1159902 次
文章分类
社区版块
存档分类
最新评论

Ruby on Rails: 3.2 RC1 Released, 4.0 Will Drop Ruby 1.8.7

 
阅读更多

The Ruby on Rails team announced the first release candidate of Rails 3.2 just in time for Christmas. After 3.2, the next major release of Rails will be 4.0.

Rails 3.2 introduces a hand full of new features and many small improvements. The most notable new feature that will affect all users is the faster development mode. According to the detailed change log, this will "speed up development by only reloading classes if dependencies files changed", compared to the current behavior where Rails reloads classes on every request. If you want a similar feature for previous Rails versions, you can try the ActiveReload plug-in.

If you're fighting performance problems due to inefficient database queries, the new explain feature might help you locate the problem. Arel now offers an explain method that shows the result of running EXPLAIN on the generated query. This works with the sqlite3, mysql2, and postgresql adapters. When Rails discovers a slow query (default is 0.5 seconds), it will even automatically run explain and show you the results.

Other new features include a simple key/value store extension for Active Record, and a tagged logger that lets you add custom tags to the log. See the detailed change log for a complete overview over all changes.

After the 3.2 release, development will concentrate on the 4.0 release, which is tentatively scheduled for summer 2012. DHH explains why they're jumping to the next major number:

There’s not a lot of details about what we’re going to include in Rails 4.0 yet as the primary purpose for bumping the major version number is to drop Ruby 1.8.7 support. But unlike Rails 3.0, we intend for it to be a much smoother transition.

Dropping 1.8.7 might seem hard on the first glance, but the Ruby team itself is also moving away from 1.8: "We continue to provide normal maintenance for 1.8.7 as usual, until June 2012. [..] After that we stop bugfixes. We still provide security fixes until June 2013, in case you are still using 1.8.7. We will no longer support 1.8.7 in all senses after June 2013". So unless someone else steps up and continues maintaining it (like Engine Yard did with Ruby 1.8.6), it's time to finally move on to Ruby 1.9 or one of the alternative implementations.


Ruby on Rails团队宣告在圣诞节时发布Rails3.2的候选版本。在3.2之后,Rails的下一个主要版本将会是4.0。

Rails3.2引入了大量的新特性和许多细微的改进。对所有开发者影响最为显著的新特性是更快的开发模式。从详细的更新日志来看,与当前Rails根据每次请求重新加载类相比,新版本可以通过“只有在依赖文件的变化的情况下才重新加载类”的方式来加快开发。如果需要为以前的版本提供相似的特性,可以试试ActiveReload插件。

如果你一直被因为数据库低效的查询带来的性能问题所困扰,新的解释查询功能可能会帮你解决这个问题。现在Arel提供一个解释方法,可以显示运行解释生成的查询结果。它和sqlite3,mysql2,postgresql适配器协同工作。当Rails发现一个比较慢的查询(默认是0.5秒),他会自动运行解释程序并显示相应的结果。

其他新特性包括ActiveRecord的一个简单键值对存储扩展和可以在日志中添加个性化标签的一个标签化日志记录方式,如果想了解完整的更新概述,请参阅详细的更新日志。

在3.2发布之后,开发工作将会集中在4.0版本,暂定为2012年的夏季。DHH解释他们为何跳跃到下一个主版本号时说道:

还有为数不多的一些细节我们将会引入到Rails4.0中,与这个主版本号一起发布的主要目的是要放弃对Ruby1.8.7的支持。但是与Rails3.0不同的是,我们打算使它成为一个平稳的过渡。

放弃对1.8.7的支持乍一看似乎很难,但是Ruby工作组自身也在远离Ruby1.8:“我们会继续提供对1.8.7的正常维护,就像过去一样,一直到2012年6月。之后,我们就会停止修复bug。如果你仍然在使用1.8.7,我们会继续提供安全方面的修复直至2013年6月。在2013年6月之后,我们将全面停止对1.8.7的支持。”所以是时候转移到1.9或其可选的实现之一了,除非有其他人接班并且继续维护它(就像Engine Yard对待1.8.6那样)。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics