# File lib/rubygems/local_remote_options.rb, line 19
def accept_uri_http
OptionParser.accept URI::HTTP do |value|
begin
uri = URI.parse value
rescue URI::InvalidURIError
raise OptionParser::InvalidArgument, value
end
valid_uri_schemes = ["http", "https", "file", "s3"]
unless valid_uri_schemes.include?(uri.scheme)
msg = "Invalid uri scheme for #{value}\nPreface URLs with one of #{valid_uri_schemes.map{|s| "#{s}://"}}"
raise ArgumentError, msg
end
value
end
end