Issue #16824 has been updated by yuki24 (Yuki Nishijima).


While I understand the intention of this request, I'm not sure this would be practically useful for us. As mentioned, there are definitely gems that people are already comfortable with that we probably don't want to change, and shifting the direction at this point would create even more confusion later on (e.g. why can't I require `optionparser` in Ruby 2.7?). And even if all the standard/bundled gems were to follow the naming conventions, the entire world would never be as consistent as you wish because of the existence of popular gems such as `activesupport`, `rest-client`, etc.

Also, see how much of effort the `rest-client` maintainers have put into this: https://github.com/rest-client/rest-client/tree/master/lib. It could make us fall down the rabbit hole of claiming a lot more gem names than initially anticipated.

In response to the argument against hard-to-remember gem names, I have added a "Did you mean?" feature to `LoadError` to help resolves issues like this quickly: https://github.com/ruby/did_you_mean/pull/143. This way you would get gem name suggestions on an `LoadError` and it should save you from not remembering thae gem name correctly. Going forward, other static analysis tools like sorbet and steep should be able to do the same as well statically rather than doing so at runtime.

----------------------------------------
Feature #16824: Follow RubyGems naming conventions for the stdlib
https://bugs.ruby-lang.org/issues/16824#change-85790

* Author: shan (Shannon Skipper)
* Status: Rejected
* Priority: Normal
----------------------------------------
It's been really nice that most gems these days follow the RubyGems naming convention, so you know exactly what to require just from seeing the gem name: https://guides.rubygems.org/name-your-gem/

I wonder if it would be possible to add aliases for parts of the stdlib that don't follow the convention for Ruby 3.0. I was thinking maybe shims like lib/optionparser.rb, which just does a require_relative of lib/optparse.rb. The following files are what I'd expect, given the namespaces.

	new file:   file_utils.rb
	new file:   getopt_long.rb
	new file:   ip_addr.rb
	new file:   open_struct.rb
	new file:   open_uri.rb
	new file:   option_parser.rb
	new file:   p_store.rb
	new file:   r_doc.rb
	new file:   secure_random.rb
	new file:   t_sort.rb
	new file:   weak_ref.rb

Eventually the old name could be the shim and new one actually contain the code on the path to deprecating old names in some future Ruby.

Anyway, I just wanted to put the suggestion out there to adopt naming conventions for the stdlib as it's gemified. Ruby 3 seems like a nice time. :)



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