lib/bolt/apply_target.rb in bolt-2.7.0 vs lib/bolt/apply_target.rb in bolt-2.8.0
- old
+ new
@@ -55,10 +55,14 @@
@port = uri_obj.port || t_conf['port']
@protocol = uri_obj.scheme || transport
@user = Addressable::URI.unencode_component(uri_obj.user) || t_conf['user']
end
+ def to_s
+ @safe_name
+ end
+
def parse_uri(string)
require 'addressable/uri'
if string.nil?
Addressable::URI.new
# Forbid empty uri
@@ -70,8 +74,12 @@
# Initialize with an empty scheme to ensure we parse the hostname correctly
Addressable::URI.parse("//#{string}")
end
rescue Addressable::URI::InvalidURIError => e
raise Bolt::ParseError, "Could not parse target URI: #{e.message}"
+ end
+
+ def hash
+ @name.hash
end
end
end