ruby - Why 的(令人心酸的)Ruby 指南中使用什么版本的 Ruby

标签 ruby

过去几天我一直在关注 Why 的(令人心酸的)Ruby 指南,我注意到运行他的示例时出现了一些问题。

我现在正处于十字路口,不知道我是否犯了一些我似乎无法识别的拼写错误,或者我的 Ruby 版本不兼容。

我正在运行 Ruby 1.8.6 (Win32),并且我注意到在第 5 章的 irb 提示符中提到了 Ruby 1.8.3。

在我把自己逼疯之前;只有我这样还是我需要降级到 1.8.3?

沿着这些思路,如果代码不兼容,将代码移植到 1.8.6 会有多困难?

最佳答案

我很确定你会没事的。只要“分支”版本保持不变,我就从来没有真正担心过点发布。我想您会发现,无论您使用哪个版本的 Ruby 1.8,您在 Why 指南中所做的事情中的 99.9%(如果不是 100%)仍然有效。

这是 Ruby 1.8 branch policy 的片段来自ruby-lang issue tracker site :

The 1.8 branch, or in general, a "stable" branch is developed and maintained for most casual use by average ruby programmers. Besides fixes for security problems and run-time bugs, there can be performance improvements, feature enhancements and library updates made on the branch. Those kinds of aggressive changes may occur, however, only on condition that backward compatibilities and run-time stabilities are retained to a high degree.

...

Committers are allowed to make a commit on a stable branch without explicit approval from the branch manager, as long as it does not break any backward compatibilities, that is, it does not delete or change any existing features.

A list of exceptions is as follows. A commit may break backward compatibilities only when all of the following conditions are met:

  • It only affects: 1) behaviors which contradicts with the document, 2) internal, unpublicized interface, 3) undocumented features, 4) undefined behaviors, or 5) presumable misuses.
  • The new behavior will not change again in nor contradict with the next major version series of Ruby.
  • If it is assumed that it may silently affect existing code in a subtle way, sufficient information and/or a support tool must be supplied with to help users fix their existing code.
  • It is well considered and reviewed in public and approved by the branch manager.
  • It is well documented and announced in ChangeLog and NEWS as soon as it goes in.

关于ruby - Why 的(令人心酸的)Ruby 指南中使用什么版本的 Ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1931803/

相关文章:

ruby - 在 Capybara-Webkit 中显示 @font-face 字体

ruby - BigTop docker-hadoop.sh 无法启动

ruby-on-rails - 将 Rails 应用程序推送到 Heroku 时出错

ruby - 使用 HTTParty 发布大量数据

ruby - RVM Ruby 安装不成功

ruby-on-rails - will_paginate 未定义方法错误 - Ruby on Rails

ruby - 在 template.erb 中设置 chef vault 变量

ruby-on-rails - 我们如何在其他 Controller View 中使用一个 Controller 方法?

ruby - 我可以删除 Ruby 中的方法别名吗?

ruby-on-rails - Rails 最佳实践问题 : Where should one put shared code and how will it be loaded?