After the changes implemented in #127, connecting to a URI without an explicit port in it (e.g. demo.nats.io) caused a crash:
irb(main):004:0> NATS.connect("demo.nats.io")
/usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:1828:in `block in process_uri': undefined method `scheme' for "nats://demo.nats.io":String (NoMethodError)
from /usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:1818:in `map'
from /usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:1818:in `process_uri'
from /usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:296:in `parse_and_validate_options'
from /usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:265:in `connect'
from /usr/local/bundle/gems/nats-pure-2.3.0/lib/nats/io/client.rb:52:in `connect'
from (irb):4:in `<main>'
from bin/console:7:in `<main>'
After the changes implemented in #127, connecting to a URI without an explicit port in it (e.g.
demo.nats.io
) caused a crash:This PR fixes that bug.