Aaron Patterson 5ccaeee2e8 [ruby/rubygems] Undeprecate Gem::Version.new(nil)
It seems like we were trying to deprecate passing `nil` to
Gem::Version.new.  This breaks existing code, and I don't think there is
a good reason to deprecate this usage.

I believe what we want to prevent is the following code:

```ruby
Gem::Specification.new do |spec|
  spec.version = nil
  # suddenly the spec version is 0!
  p spec.version
end
```

This commit allows people to manually construct `Gem::Version.new(nil)`,
but when someone assigns `nil` as the Gem specification version, it sets
the spec version to `nil` (making the specification invalid).  People
who manually construct `Gem::Version` objects and use nil should be
allowed to do it, and `Gem::Version.new(nil) == Gem::Version.new("0")`,
but people who assign `nil` in a gemspec will get an invalid gemspec.

I think deprecation started
[here](https://github.com/ruby/rubygems/pull/2203) but there doesn't
seem to be a reason to do it.

Fixes https://github.com/ruby/rubygems/pull/9052

https://github.com/ruby/rubygems/commit/ded5e909c2
2025-11-18 04:53:07 +00:00
..
2025-11-12 21:48:07 +00:00
2025-11-13 16:01:15 +00:00
2025-11-04 06:53:18 +00:00
2025-10-31 00:14:23 +00:00
2025-10-29 07:34:58 +00:00
2025-11-10 09:25:45 +00:00
2025-10-29 06:50:19 +00:00
2025-11-10 10:03:07 +00:00