Bug #15376
closedDefault gems: how will it work exactly?
Description
Some standard libraries will be gemified in Ruby 2.6+.
-
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...
-
Can we play with this right now? Maybe publishing prelease versions of these libraries?
-
Has this been tested with
Gemfile
andgemspec
, i.e. it will be possible to add a specification for one of these? -
What is supposed to happen if one does
gem install ostruct
in Ruby 2.5 (with current bundler, and with future bundler)? -
Will it be possible to use these in
Gemfile
s even with older Ruby (but recentbundler
), so one could saygem 'ostruct'
in a Gemfile and runbundle install
in Ruby 2.5 without things exploding? -
Depending on 4/5, shouldn't we specify a
required_rubygems_version
and/orrequired_ruby_version
in the gemspecs?
Updated by shevegen (Robert A. Heiler) almost 6 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) almost 6 years ago
- Status changed from Open to Assigned
- Assignee set to hsbt (Hiroshi SHIBATA)
Updated by hsbt (Hiroshi SHIBATA) almost 6 years ago
- 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
- 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.
- 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?
- 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.
- 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
- 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) almost 6 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.
Updated by marcandre (Marc-Andre Lafortune) almost 6 years ago
- Related to Misc #15486: Default gems README.md added