From: "austin (Austin Ziegler)" Date: 2021-12-02T16:50:45+00:00 Subject: [ruby-core:106402] [Ruby master Feature#18376] Version comparison API Issue #18376 has been updated by austin (Austin Ziegler). deivid (David Rodr��guez) wrote in #note-15: > I'm definitely aware that this is used for what you point out. But most gem authors just use it and don't worry about "what if rubygems is not available?", which I think it's reasonable because rubygems is part of ruby and they are developing a gem after all. Yet there's people who use `--disable-gems` for various reasons, yet might also use a standalone bundle. I just tried this and I _do_ get an uninitialized constant error with `--disable-gems`. I know that gem authors treat Rubygems as a given, but it feels���iffy to me that we depend on this this way. I did just see that `Gem::Version` does not get defined in an idempotent way, as it is declared with `class Gem::Version` and not `class Gem; class Version`: `ruby --disable-gems -rrubygems/version -e 'p Gem::Version'` results in `uninitialized constant Gem`. At any rate, I am using Elixir much more often these days, where I _do_ have a `Version` module built-in for those (admittedly rare) cases where I need version comparison���and it is _really_ nice to have something readily available as part of the core. ---------------------------------------- Feature #18376: Version comparison API https://bugs.ruby-lang.org/issues/18376#change-95040 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal ---------------------------------------- Is there a chance to have version comparison API? For example if `Gem::Version` was extracted into `::Version`. This idea was triggered by this PR [1] and [2], where the `Gem::Version` API is used for comparing Ruby versions. While RubyGems might be available everywhere, it does not look correct to introduce dependencies on RubyGems into libraries which could run without them just fine. [1]: https://github.com/mperham/connection_pool/pull/157 [2]: https://github.com/mperham/connection_pool/issues/158 -- https://bugs.ruby-lang.org/ Unsubscribe: