net-ssh / net-scp

Pure Ruby implementation of the SCP protocol
http://github.com/delano/net-scp
MIT License
154 stars 63 forks source link

Use ruby 3.1's uri's register_scheme if available #73

Open rtokarek-fastly opened 5 months ago

rtokarek-fastly commented 5 months ago

Ruby 3.1 adopted uri 0.11.0. That version changes how schemes can be registered. There is now a register_scheme method.

https://github.com/ruby/uri/pull/26 as part of https://github.com/ruby/uri/releases/tag/v0.11.0

This commit supports both ways and works with the new method if available. The old way errors out when run on uri>=0.11.0/ruby>=3.1.