Project

General

Profile

Actions

Bug #15376

closed

Default gems: how will it work exactly?

Added by marcandre (Marc-Andre Lafortune) over 5 years ago. Updated about 5 years ago.

Status:
Closed
Target version:
-
[ruby-core:90274]

Description

Some standard libraries will be gemified in Ruby 2.6+.

  1. I believe we need to provide documentation for this. The NEWS file doesn't have much at all. The respective READMEs also have no relevant information and are misleading (see https://github.com/ruby/ostruct/pull/6). I'll be glad to write an initial draft if need be, with the answers to the following questions...

  2. Can we play with this right now? Maybe publishing prelease versions of these libraries?

  3. Has this been tested with Gemfile and gemspec, i.e. it will be possible to add a specification for one of these?

  4. What is supposed to happen if one does gem install ostruct in Ruby 2.5 (with current bundler, and with future bundler)?

  5. Will it be possible to use these in Gemfiles even with older Ruby (but recent bundler), so one could say gem 'ostruct' in a Gemfile and run bundle install in Ruby 2.5 without things exploding?

  6. Depending on 4/5, shouldn't we specify a required_rubygems_version and/or required_ruby_version in the gemspecs?


Related issues 1 (0 open1 closed)

Related to Ruby master - Misc #15486: Default gems README.mdFeedbackhsbt (Hiroshi SHIBATA)Actions

Updated by shevegen (Robert A. Heiler) over 5 years ago

I can not answer most of these question due to my own lack of knowledge but I agree
with mentioning it in NEWS and with some documentation - in particular I
think the most important mention may be what happens, or what should happen,
when there may be more than one version installed.

Most gems or possible all of them already have a .gemspec file as far as I know;
at the least I remember that .gemspec files before have been written and
added to ruby for the default gems provided there (is there any .gemspec still
missing?).

Updated by mame (Yusuke Endoh) over 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to hsbt (Hiroshi SHIBATA)
Actions #3

Updated by naruse (Yui NARUSE) over 5 years ago

  • Target version deleted (2.6)

Updated by hsbt (Hiroshi SHIBATA) over 5 years ago

  1. I believe we need to provide documentation for this. The NEWS file doesn't have much at all. The respective READMEs also have no relevant information and are misleading (see https://github.com/ruby/ostruct/pull/6). I'll be glad to write an initial draft if need be, with the answers to the following questions...

I think so. But default gems is not introduced at Ruby 2.6. It's provided from Ruby 2.0.0. No one put its details and behavior as document into ruby repository.

I speak these behavior in RubyKaigi 2017 and RubyConf 2017.

https://www.slideshare.net/hsbt/gemification-for-ruby-2530-82222826

And I wrote the Japanese article of WEB+DB press.

http://gihyo.jp/magazine/wdpress/archive/2018/vol103

  1. Can we play with this right now? Maybe publishing prerelease versions of these libraries?

It's the maintainer's convenience. I or the maintainer should merge the latest stable versions into ruby core repository before the final releasing.

But rubygems.org protect namespace of the standard library contained default gems like this: https://rubygems.org/gems/digest

We need to coordinate with rubygems.org team before publishing pre-release version of default gems. Fortunately, I got namespaces of default gems that will ship Ruby 2.6.

@marcandre (Marc-Andre Lafortune) Can you give the email address of rubygems.org? I grant you to owner of matrix and ostruct gems.

After that, Please release the stable versions of them to rubygems.org and backport them to ruby core repository.

  1. Has this been tested with Gemfile and gemspec, i.e. it will be possible to add a specification for one of these?

I'm not sure what mean tested. Can you describe it?

  1. What is supposed to happen if one does gem install ostruct in Ruby 2.5 (with current bundler, and with future bundler)?

The users can use ostruct gems same as 3rd party gems like rails or rspec from rubygems.org. But the users needs to specify gem "ostruct", "0.1.0" or Gemfile of Bundler.

  1. Will it be possible to use these in Gemfiles even with older Ruby (but recent bundler), so one could say gem 'ostruct' in a Gemfile and run bundle install in Ruby 2.5 without things exploding?

It's possible with RubyGems 2.x and 3.0. But it's not same as default gems installed by Ruby 2.6.0. Because gem install foo --default only install gemspec file. I didn't know why its behavior. But I'm working to change it with https://github.com/rubygems/rubygems/pull/2166

  1. Depending on 4/5, shouldn't we specify a required_rubygems_version and/or required_ruby_version in the gemspecs?

It's the maintainer's convenience. My personal opinion, We specify only supporting versions of Ruby like >= 2.3 now.

Updated by marcandre (Marc-Andre Lafortune) about 5 years ago

  • Status changed from Assigned to Closed

Thank you for the answers. I've started improving the README for the matrix gem according to this info.

Actions #6

Updated by marcandre (Marc-Andre Lafortune) about 5 years ago

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0