Issue #16427 has been updated by rbjl (Jan Lelis).


I want to make point for the default gem promotion.

One of Ruby's goal is to be very appealing to developers. did_you_mean is very helpful in this regard. As are well written error messages. Or source_locations of Ruby methods. Or a well usable REPL. You are right about the perfomance implication, but - of course, this is a matter of taste -  the improved experience for developers can outweigh this.

One thing about the "auto-requiring" of did_you_mean -> I think this also a reason for having did_you_mean included as a default gem. It was some kind of inconsistent that did_you_mean would be loaded implicitly, but can be removed. Now being a default gem, this behavior is not problematic anymore.

----------------------------------------
Bug #16427: Revert did_you_mean promotion to default gem.
https://bugs.ruby-lang.org/issues/16427#change-83193

* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-12-10 master af11efd377) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
One of the points made in #16363 was:

> so we can always reliably require it whenever we want to.

That is not true anymore, because did_you_mean is always required when RubyGems are enabled since [1]:

~~~
$ ruby -e 'puts $LOADED_FEATURES' | grep did
~~~

Removing all traces of did_you_mean from my system only results in:

~~~
$ ruby -e 'puts $LOADED_FEATURES' | grep did
Traceback (most recent call last):
	2: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
	1: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- did_you_mean (LoadError)
~~~

just confirming what I said above.

IMO, did_you_mean gem might be useful for development, but should not be required for runtime at all. On one hand there are taken steps to improve Ruby speed, but this is going contrary to that goal.

[1]: https://github.com/ruby/ruby/commit/0fef526606c72e7d2a3c83aebd9204da34016d96



-- 
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>