Skip to content

Commit

Permalink
Restore ruby 2.5 support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deivid-rodriguez committed Mar 25, 2021
1 parent 9ad5696 commit 8dc9df4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net-http.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.summary = %q{HTTP client api for Ruby.}
spec.description = %q{HTTP client api for Ruby.}
spec.homepage = "https://github.com/ruby/net-http"
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
spec.licenses = ["Ruby", "BSD-2-Clause"]

spec.metadata["homepage_uri"] = spec.homepage
Expand Down
4 changes: 2 additions & 2 deletions test/net/http/test_https.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_get
assert_equal($test_net_http_data, res.body)
}
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
certs.zip([CA_CERT, SERVER_CERT][-certs.size..-1]) do |actual, expected|
assert_equal(expected.to_der, actual.to_der)
end
rescue SystemCallError
Expand All @@ -66,7 +66,7 @@ def test_get_SNI
assert_equal($test_net_http_data, res.body)
}
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
certs.zip([CA_CERT, SERVER_CERT][-certs.size..-1]) do |actual, expected|
assert_equal(expected.to_der, actual.to_der)
end
end
Expand Down

0 comments on commit 8dc9df4

Please sign in to comment.