是什么阻止您编写特定于 ruby​​ 1.9 的代码?

发布于 2024-08-29 14:44:55 字数 1436 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

飘过的浮云 2024-09-05 14:44:55

另外,如果我们谈论的是 Rails,那么问题就在于 gems/plugins 与 ruby​​ 1.9 的兼容性。相信想升级到1.9的大家都关注isitruby19.com

Also, if we're talking about rails, then the problem there is the compatibility of gems/plugins with ruby 1.9. I'm sure everyone who wants to upgrade to 1.9 keeps an eye on isitruby19.com

誰ツ都不明白 2024-09-05 14:44:55

Ruby 1.9.2 的第一个候选版本将于 5 月底发布,我相信很多人都在等待 1.9.2 搭上 1.9 的列车。

这并不是你问题的真正答案,但现在要开始使用 1.9.2 方法编写代码,你可以需要“向后移植”,并且大多数功能都将可用,即使在 Ruby 1.8.6 中也是如此(尽管当然,没有那么快)。

The first release candidate for Ruby 1.9.2 is due end of May and I believe many are waiting for 1.9.2 to hop on the 1.9 train.

Not really an answer to your question, but to start writing code uses 1.9.2 methods now, you can require "backports" and most features will be available to you, even in Ruby 1.8.6 (albeit not nearly as fast, of course).

浅黛梨妆こ 2024-09-05 14:44:55

我希望在处理 unicode 数据时能够忘记 Iconv,如下所示:

Iconv.conv("utf-8", "utf-16le", blob).split("\n")

但到目前为止我还没有找到 1.9 unicode 处理的好例子/教程。

I wish I could forget about Iconv when handling unicode data, like this:

Iconv.conv("utf-8", "utf-16le", blob).split("\n")

but so far I could not find good examples/tutorial of 1.9 unicode handling yet.

っ〆星空下的拥抱 2024-09-05 14:44:55

没有什么能让我沮丧。我已经使用 Ruby 1.9.1 来完成我所做的一切工作近一年了,并且几乎没有遇到任何问题。我的专业 gems 由于各种原因(简单的 UTF-8、光纤等)需要 1.9,我对此没有任何疑虑。对于其他一些 琐碎 gems,我可能会做出象征性的努力来保持它们与 1.8 兼容,其中大部分只是意味着不使用更干净的新哈希语法。

1.9 是当前的 Ruby。我可以看到需要保留旧的 Ruby,以保留不值得更新的遗留代码,或者更喜欢替代的 Ruby(JRuby、Rubinius 等)——但这确实让我困惑,为什么这么多人仍在开始使用较慢、过时的 Ruby 1.8.x 系列中的新项目。

Nothing is discouraging me. I've been using Ruby 1.9.1 for everything I do for close to a year now and had few problems. My major gems require 1.9 for various reasons (easy UTF-8, fibers, etc.) and I've felt no qualms about it. For some other trivial gems I might make a token effort to keep them 1.8 compatible, which mostly just means not using the cleaner new hash syntax.

1.9 is the current Ruby. I can see needing to keep the old Ruby around for legacy code that isn't worth updating, or having a preference for an alternative Ruby (JRuby, Rubinius, etc.) -- but it truly baffles me why so many people are still starting new projects in the slower, obsolete Ruby 1.8.x line.

睫毛上残留的泪 2024-09-05 14:44:55

在许多操作系统中,安装 ruby​​ 1.8 比安装 ruby​​ 1.9 更容易。

  • 某些 Linux 发行版有 1.8 的软件包,但没有 1.9 的软件包。
  • OS X 预装了 ruby​​ 1.8.7。 1.8.7 运行 ruby​​ 1.9 语言。
  • Windows 的一键安装程序是 ruby​​ 1.8。

In many operating systems, it is easier to install ruby 1.8 than ruby 1.9.

  • Some distributions of Linux have packages for 1.8 but not for 1.9.
  • OS X has ruby 1.8.7 pre-installed. 1.8.7 runs the ruby 1.9 language.
  • The one-click installer for Windows is ruby 1.8.
打小就很酷 2024-09-05 14:44:55

我不太了解 Ruby,无法区分 1.8 和 1.9(这就是我的原因:P)

I don't know Ruby so well to distinguish 1.8 from 1.9 ( well that's my reason :P )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文