Skip to content

Commit 8dc9df4

Browse files
Restore ruby 2.5 support
As far as I know, this is the only stdlib that has dropped ruby 2.5, which hasn't yet reached its End of Life date. The motivation for this is that there's no gemified version of `net-http` that supports ruby 2.5, and that makes it hard for libraries depending on `net-http` to properly declare the dependency, since the only way is to drop support for ruby 2.5, which many maintainers will not yet want to do. The reason for wanting to declare the `net-http` dependency is mainly that it helps bundler & rubygems with avoiding double loads of different versions of `net-http` (the stdlib version and a higher gemified version). As far as I can observe from commit history, the only reason for dropping support for ruby 2.5 was that tests didn't pass, so I made them pass.
1 parent 9ad5696 commit 8dc9df4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

net-http.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
1616
spec.summary = %q{HTTP client api for Ruby.}
1717
spec.description = %q{HTTP client api for Ruby.}
1818
spec.homepage = "https://github.com/ruby/net-http"
19-
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
19+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
2020
spec.licenses = ["Ruby", "BSD-2-Clause"]
2121

2222
spec.metadata["homepage_uri"] = spec.homepage

test/net/http/test_https.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_get
4545
assert_equal($test_net_http_data, res.body)
4646
}
4747
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
48-
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
48+
certs.zip([CA_CERT, SERVER_CERT][-certs.size..-1]) do |actual, expected|
4949
assert_equal(expected.to_der, actual.to_der)
5050
end
5151
rescue SystemCallError
@@ -66,7 +66,7 @@ def test_get_SNI
6666
assert_equal($test_net_http_data, res.body)
6767
}
6868
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
69-
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
69+
certs.zip([CA_CERT, SERVER_CERT][-certs.size..-1]) do |actual, expected|
7070
assert_equal(expected.to_der, actual.to_der)
7171
end
7272
end

0 commit comments

Comments
 (0)