guides icon indicating copy to clipboard operation
guides copied to clipboard

Document default gems

Open zzak opened this issue 11 years ago • 7 comments

Move original topic from @headius (a.k.a. @headies):

There's currently docs/guides on how to use most aspects of RubyGems except for default gems. I recognize that default gems are largely used by implementers (and perhaps installers) but there should still be some guide or howto written up.

I'm willing to write it, if there's a good place for such articles to live.

cc rubygems/rubygems#662

zzak avatar May 09 '14 08:05 zzak

If by "default gems" the "gems installed by default" are meant, these are now covered (although in a minimalist fashion) on the RubyGems Basics page:

Listing installed gems ... (Ruby ships with some gems by default, bigdecimal, io-console, json, minitest, psych, rake, rdoc, test-unit for ruby 2.0.0).

igneus avatar Oct 17 '20 15:10 igneus

"default gems" are slightly different than "installed by default". The latter is often referred to as "bundled" gems to be clear about the distinction.

"default gems" are gems that get installed directly into the standard library, and which are loadable without loading the RubyGems subsystem at all. If RubyGems is loaded, these stdlib-based gems can be upgraded, and RubyGems handles this by looking at a separate "default" specification directory which holds the specs for these gems.

You can see which gems are default in the CRuby repository by looking for .gemspec files, I believe, but this does not constitute a complete list. An example for the ostruct gem is here: https://github.com/ruby/ruby/blob/d3b2c1a17585ad30fb297ab489da0505e8b9b97a/lib/ostruct/ostruct.gemspec

There is a list of "bundled" gems (i.e. preinstalled but not directly into stdlib) here: https://github.com/ruby/ruby/blob/master/gems/bundled_gems

Note that JRuby handles default gems by maintaining a separate list (as part of our build script) and not versioning those gems in our repository. I would like to see CRuby do the same, since there have been many cases of diverging sources due to this duplicate versioning:

  • https://github.com/ruby/ostruct/issues/11
  • https://github.com/ruby/matrix/issues/12
  • https://github.com/ruby/webrick/issues/48
  • https://github.com/ruby/prime/issues/11
  • https://github.com/ruby/tracer/issues/1
  • https://github.com/ruby/prime/issues/9

cc @marcandre @hsbt

headius avatar Oct 21 '20 17:10 headius

@headius Is what you'd like CRuby to do similar to what I proposed in https://bugs.ruby-lang.org/issues/16778?

deivid-rodriguez avatar Oct 21 '20 17:10 deivid-rodriguez

@deivid-rodriguez That is EXACTLY what I want, and I added a +1000 comment there to support you. Let me know if I can do anything else to make this happen.

headius avatar Oct 26 '20 20:10 headius

:smiley: That's great, thanks for your support! Maybe it gets some traction again, I'll be happy to find some time to work on it.

deivid-rodriguez avatar Oct 26 '20 21:10 deivid-rodriguez

By the way this is an excellent resource for default gems: https://stdgems.org/.

deivid-rodriguez avatar Oct 27 '20 12:10 deivid-rodriguez

By the way this is an excellent resource for default gems: https://stdgems.org/.

Very nice, thank you!

headius avatar Oct 27 '20 22:10 headius