Issue #16824 has been updated by zverok (Victor Shepelev).


@naruse @nobu The "use case" for this is Rubyists nowadays have a very strong intuition that "Foo::BarBaz" module typically required via `foo/bar_baz` path. This convention is encouraged by tutorials (including RubyGems' linked above, with RubyGems being part of Ruby!) and linters. 

I believe it is desirable that Ruby's core and standard library API provided an exemplary following the community conventions and intuitions, where possible.

For my 15 years with Ruby, for the first 8 or 9 I've constantly struggled with `require "file_utils"` and `require "open_struct"` вк oh, I remember there was a quirk `require "openstruct"` вк ugh, oh, `require "ostruct"`.

The change proposed is of negligible size (just creating 8 1-line files), will create zero problems and maintenance burden, and will save a lot of people from everyday frustration.

(I am saying 8 because I believe RDoc, PStore, and TSort shouldn't be affected -- it is kind of abbreviations, RubyGems tutorial even have example of `rdoc-data` containing `RDoc::Data`)

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

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