Issue #14004 has been updated by shevegen (Robert A. Heiler).


I think I noticed that in regards to aliased-method names some time ago, but it does not appear with all aliased names, right? For example, Array#collect and Array#map was always there. I myself only use the online docu though, or only parts of ri, e. g. via method_source (for ruby addons that is). 

If one goes to https://ruby-doc.org/core/Hash.html#method-i-to_s, the docu shows in italic letters:

"Alias for: inspect"

For Array#map and collect, it is identical docu:

https://ruby-doc.org/core/Array.html#method-i-map

Not sure why ri gets confused sometimes and sometimes not.

----------------------------------------
Bug #14004: ri confused by method aliases and by Queue versus Thread::Queue
https://bugs.ruby-lang.org/issues/14004#change-67171

* Author: kernigh (George Koehler)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-10-10 trunk 60155) [x86_64-openbsd6.2]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
`ri` in Ruby trunk fails to find documentation for some methods.

Array#append and Array#prepend are new in trunk. ri knows that these methods exist, but has no document for them.

```
$ ri Array#append

= Array#append

(from ruby core)
------------------------------------------------------------------------------
  append(*args)

------------------------------------------------------------------------------
```

The same problem happens with all methods from `rb_define_alias()` in Ruby's source code. For example, Array#size, IO#to_i, Hash#to_s, and Thread#inspect have no document. These are all aliases of other methods that have document.

There is another problem with Queue, an alias for Thread::Queue. ri doesn't know that Queue has methods.

```
$ ri Queue#push
Nothing known about Queue#push
```

The command `ri Queue` shows the document for the class, but it has no methods. The command `ri Thread::Queue` shows methods, but no class document. The same problem happens with other classes in rthread_sync.c, like Mutex.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>