Project

General

Profile

Bug #15376

Default gems: how will it work exactly?

Added by marcandre (Marc-Andre Lafortune) 9 days ago. Updated 1 day ago.

Status:
Assigned
Priority:
Normal
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?

History

#1 [ruby-core:90281] Updated by shevegen (Robert A. Heiler) 9 days 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?).

#2 [ruby-core:90334] Updated by mame (Yusuke Endoh) 7 days ago

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

#3 Updated by naruse (Yui NARUSE) 3 days ago

  • Target version deleted (2.6)

#4 [ruby-core:90434] Updated by hsbt (Hiroshi SHIBATA) 1 day 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

2) 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.

3) 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?

4) 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.

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?

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

6) 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.

Also available in: Atom PDF