From: deivid Date: 2021-12-06T09:02:23+00:00 Subject: [ruby-core:106504] [Ruby master Feature#18376] Version comparison API Issue #18376 has been updated by deivid (David Rodr��guez). Thinking a bit more about this, current `Gem::Version` functionality seems quite independent, so there may be a way to provide this feature that's also llow friction for rubygems maintainers. Something like https://github.com/rubygems/rubygems/pull/5136 would already address the "I don't want to load all of rubygems just to compare some versions" concern. But if we extracted rubygems `version.rb` file to a new default gem, that would provide the same functionality through the `::Version` class for users that explicitly `require "version"`, also addressing the "`Gem::Version` is confusing for some version usages not related to gems" concern. Nothing would have to change for us in rubygems, we would need to vendor `version.rb` under the `Gem` namespace like we do for other default gems, which is exactly what we are already doing. ---------------------------------------- Feature #18376: Version comparison API https://bugs.ruby-lang.org/issues/18376#change-95164 * 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: