165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
# File 'lib/pdk/util/template_uri.rb', line 165
def self.parse_scp_url(url)
require 'pathname'
require 'addressable'
scp_url = url.match(SCP_PATTERN)
return url unless Pathname.new(url).relative? && scp_url
uri = Addressable::URI.new(scheme: 'ssh', user: scp_url[:user], host: scp_url[:host], path: scp_url[:path])
PDK.logger.warn _('%{scp_uri} appears to be an SCP style URL; it will be converted to an RFC compliant URI: %{rfc_uri}') % {
scp_uri: url,
rfc_uri: uri.to_s,
}
uri.to_s
end
|