gpt4 book ai didi

ruby - 在 Why's (Poignant) Guide to Ruby 中使用什么版本的 Ruby

转载 作者:数据小太阳 更新时间:2023-10-29 08:34:56 25 4
gpt4 key购买 nike

在过去的几天里,我一直在关注 Why's (Poignant) Guide to Ruby,并且我注意到在运行他的示例时存在一些问题。

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

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

在我把自己逼疯之前;是我一个人还是需要降级到 1.8.3?

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

最佳答案

我很确定你会没事的。只要“分支”版本保持不变,我就从来没有真正担心过点发布。我想您会发现,无论您使用哪个版本的 Ruby 1.8,您在为什么指南中完成的事情中有 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's (Poignant) Guide to Ruby 中使用什么版本的 Ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1931803/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com