+ require 'open-uri'
+ begin
+ if args[0].start_with?('http://', 'https://')
+ username = ''
+ password = ''
+ if (match = args[0].match(%r{(http\://|https\://)(.*):(.*)@(.*)}))
+ # If URL is in the format of https://username:password@example.local/my_hash.yaml
+ protocol, username, password, path = match.captures
+ url = "#{protocol}#{path}"
+ elsif (match = args[0].match(%r{(http\:\/\/|https\:\/\/)(.*)@(.*)}))
+ # If URL is in the format of https://username@example.local/my_hash.yaml
+ protocol, username, path = match.captures
+ url = "#{protocol}#{path}"