Project

General

Profile

Actions

Bug #17317

closed

In 2.7.2, Hash#except doesn't seem to exist, but is in the documentation

Bug #17317: In 2.7.2, Hash#except doesn't seem to exist, but is in the documentation

Added by Anonymous almost 5 years ago. Updated almost 5 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
[ruby-core:100778]

Description

According to https://ruby-doc.org/core-2.7.2/Hash.html#method-i-except, Hash#except is available in 2.7.2, but it doesn't appear to actually be there.

Run the following on the command line:

ruby -v -e 'h={a:1,b:2}; puts h, h.except(:a)'

Output:

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Traceback (most recent call last):
-e:1:in `<main>': undefined method `except' for {:a=>1, :b=>2}:Hash (NoMethodError)

This defines a Hash and then called except on it; the method appears to not be present although the docs indicate it is in this version. Indeed, I cannot find rb_hash_except in hash.c for 2.7.2.

Updated by mame (Yusuke Endoh) almost 5 years ago Actions #1 [ruby-core:100781]

  • Status changed from Open to Third Party's Issue

Thanks for the report, but ruby-doc.org is a third-party project that the ruby-core team is not maintaining. Could you contact on the admin of the site?

Updated by mame (Yusuke Endoh) almost 5 years ago Actions #2 [ruby-core:100783]

If I recall correctly, we have received some issue reports about ruby-doc.org maybe because the site looks official to many people. The site is undoubtedly valuable to Ruby ecosystem, but the confusion is a bit unfortunate. I wonder if we can do anything.

Updated by Anonymous almost 5 years ago Actions #3 [ruby-core:100784]

Thanks, and apologies for raising this in the wrong place! I've emailed the site owner.

Updated by zverok (Victor Shepelev) almost 5 years ago Actions #4 [ruby-core:100785]

Actually, situation with documentation sites is kind of weird now (to say the least).

  • "Official" docs.ruby-lang.org always renders correctly, but other than that is not very usable (because of mixing all the lang and standard library together)
  • ruby-doc.org really "seems" official due to the domain name and high position in Google search, but is frequently behind (when some code structure is changed, it is not always rendered correctly there), closed-source and maintained by a single person (though, fairly responsive on Twitter)
  • rubydoc.info is affilated with YARD and its author, semi-official for the rubygems documentation hosting (though not supported by rubycentral?..) and also renders Ruby core docs. Somehow
  • there is also https://apidock.com/, closed-source, semi-abandoned (?) but high in Google results
  • finally, the most modern one is https://rubyapi.org/, open-source, actively developed, supported by the community, but also unofficial...

The whole situation is kinda messy

Actions

Also available in: PDF Atom