Range#size应该在JRuby 1.7.10 - 2.0模式下工作,但它仍然失败

时间:2014-01-28 00:58:12

标签: jruby

Per http://jruby.org/2014/01/09/jruby-1-7-10.html,主题问题应该通过https://github.com/jruby/jruby/pull/1252在1.7.10中修复。但是,根据我的经验,我的经验是:

MacbookAir1:javlats palfvin$ jruby -v
jruby 1.7.10 (2.0.0p195) 2014-01-09 c4ecd6b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
MacbookAir1:javlats palfvin$ jruby
(1..2).size
NoMethodError: undefined method `size' for 1..2:Range
  (root) at -:1
MacbookAir1:javlats palfvin$

我还没想出如何查看已安装的JRuby版本中的Java代码,所以我无法将已安装的Java源代码与github上的版本进行比较,但这看起来很基本,很难相信我的环境中有什么东西搞砸了。我用Google搜索,看看有没有其他人遇到过这个,但没有找到任何东西。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

如果我的git-fu是对的,我认为这个提交不包含在1.7.10中。实际上,它看起来只是在掌握:

$ git show -s --oneline 01be8f85522e4da8df3968e622fa2c947ea6712c
01be8f8 Add a size method to RubyRange to resolve #1252

$ git branch -r --contains 01be8f85522e4da8df3968e622fa2c947ea6712c
  upstream/master
  upstream/unbox_opts

$ git tag  --contains 01be8f85522e4da8df3968e622fa2c947ea6712c

也许JRuby土地上有一个令人困惑的合并?